[Skip to main content](#vessel-content)

#   Customize the add to cart and quantity in product

##

- **[Tangram](/forum/user/15436-tangram "View Tangram's Profile")**
- [![Tangram's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/15436-tangram "View Tangram's Profile") Topic Author
- [ Offline](/forum/user/15436-tangram)

Less More

- Posts: 10
- Thank you received: 0
-
-

13 years 4 months ago -  13 years 4 months ago [\#109931](#109931) by [Tangram](/forum/user/15436-tangram "View Tangram's Profile")  *[Customize the add to cart and quantity in product](/forum/4-how-to/83917-customize-the-add-to-cart-and-quantity-in-product#109931 "Hello.  Inside the product page i want to customize the way the add to cart button and quantity option is displayed. In the Product - show&#95;default view there is a div with a php code that seems to display this. Is this code calling another view where i can customize with css the way the add to cart button and quantity option is shown?  Here's the div in the show&#95;default view that contains this:   row = &amp; $this-&gt;element; $this-&gt;ajax = 'if(hikashopCheckChangeForm(&#92;'item&#92;',&#92;'hikashop&#95;product&#95;form&#92;')){ return hikashopModifyQuantity(&#92;'' . $this-&gt;row-&gt;product&#95;id . '&#92;',field,1' . $form . ',&#92;'cart&#92;'); } else { return false; }'; $this-&gt;setLayout('quantity'); echo $this-&gt;loadTemplate(); ?&gt;   I'll apreciate any help.  Regards.")* was created by *[Tangram](/forum/user/15436-tangram "View Tangram's Profile")*

Hello.

Inside the product page i want to customize the way the add to cart button and quantity option is displayed.
In the Product - show_default view there is a div with a php code that seems to display this.
Is this code calling another view where i can customize with css the way the add to cart button and quantity option is shown?

Here's the div in the show_default view that contains this:

**&lt;div id="hikashop\_product\_quantity\_main" class="hikashop\_product\_quantity\_main"&gt;
&lt;?php
$this-&gt;row = &amp; $this-&gt;element;
$this-&gt;ajax = 'if(hikashopCheckChangeForm(\\'item\\',\\'hikashop\_product\_form\\')){ return hikashopModifyQuantity(\\'' . $this-&gt;row-&gt;product\_id . '\\',field,1' . $form . ',\\'cart\\'); } else { return false; }';
$this-&gt;setLayout('quantity');
echo $this-&gt;loadTemplate();
?&gt;
&lt;/div&gt;**

I'll apreciate any help.

Regards.

Last edit: 13 years 4 months ago by [Tangram](/forum/user/15436-tangram "View Tangram's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgzOTE3LWN1c3RvbWl6ZS10aGUtYWRkLXRvLWNhcnQtYW5kLXF1YW50aXR5LWluLXByb2R1Y3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 4 months ago [\#109993](#109993) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Customize the add to cart and quantity in product](/forum/4-how-to/83917-customize-the-add-to-cart-and-quantity-in-product#109993 "Hello.  Inside the product page i want to customize the way the add to cart button and quantity option is displayed. In the Product - show&#95;default view there is a div with a php code that seems to display this. Is this code calling another view where i can customize with css the way the add to cart button and quantity option is shown?  Here's the div in the show&#95;default view that contains this:   row = &amp; $this-&gt;element; $this-&gt;ajax = 'if(hikashopCheckChangeForm(&#92;'item&#92;',&#92;'hikashop&#95;product&#95;form&#92;')){ return hikashopModifyQuantity(&#92;'' . $this-&gt;row-&gt;product&#95;id . '&#92;',field,1' . $form . ',&#92;'cart&#92;'); } else { return false; }'; $this-&gt;setLayout('quantity'); echo $this-&gt;loadTemplate(); ?&gt;   I'll apreciate any help.  Regards.")*

Hi,

You have to do a template override, there is some documentation about it here:
[ www.hikashop.com/fr/support/documentatio...tation.html#override](http://www.hikashop.com/fr/support/documentation/62-hikashop-developer-documentation.html#override)

> **For the quantity input:**
>
> You need to create the file templates/YOUR\_TEMPLATE/html/hikashop\_button.php. We invite you to look at the file administrator/components/com\_hikashop/helpers/cart.php for the default code of the function you will define in it. In that file, you will be able to define the function:
>
> hikashop\_quantity\_render($html,$i,$max\_quantity,$min\_quantity) =&gt; The $html variable will contain the HTML of the "add to cart" button, the $i variable will contain a unique int which will be different for each quantity input on the page, the $max\_quantity and $min\_quantity will contain the min and max quantity possible for the product. You need to return the whole HTML at the end of your function.
>
> Also, please note that it only works if the option for "Display the quantity field on the product page" is set to "Ajax Input" in the configuration of HikaShop.

The following user(s) said Thank You: [Tangram](/forum/user/15436-tangram "View Tangram's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzgzOTE3LWN1c3RvbWl6ZS10aGUtYWRkLXRvLWNhcnQtYW5kLXF1YW50aXR5LWluLXByb2R1Y3Q/dG1wbD1tYXJrZG93bg==) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.076 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
