Jump to content

Quantity box size


MarkL

Recommended Posts

How can I make the quantity input box larger so that i can enter and display more than a 3 digit number ?  Also, can I make the add to basket button smaller ?

default foundation theme

**Interestingly, when I open the same page on my phone,

Mark

size.png

Link to comment
Share on other sites

This is skin dependent. So, for Foundation, let's look at the templates content.category.php, content.product.php, and content.homepage.php.

Each has similar (but not exactly the same) code that shows the quantity field next to a Add button -- when viewing on a desktop. There could be a slightly different layout for phone screens.

The code in the content.homepage.php template, find:

Near line 172:

               {elseif $product.ctrl_stock && !$CATALOGUE_MODE}
               <div class="row collapse marg-top">
                  <div class="small-3 columns">
                     <input type="text" name="quantity" value="1" maxlength="3" class="quantity text-center" disabled>
                  </div>
                  <div class="small-9 columns ">
                     <button type="submit" value="{$LANG.catalogue.add_to_basket}" class="button small postfix">{$LANG.catalogue.add_to_basket}</button>
                     <input type="hidden" name="add" value="{$product.product_id}">
                  </div>
               </div>

Note that in the "row", there are two blocks of "columns" where the small widths add to 12. You can change these values but the sum must still be 12.

Also, note the "maxlength". Cubecart decided a few versions ago that, in order to keep PHP from having to deal with values that far exceed the limits of integers, limited the quantity to 999 - both in the HTML form element code, and in the core code that processes the quantity. If you need to allow for a greater quantity, then there will be edits needed in both locations.

The same or similar code can be found in the other templates.

After making any changes, please have CubeCart clear its internal cache.

Link to comment
Share on other sites

  • 3 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...