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

#   customize add to cart button

##

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

Less More

- Posts: 5
- Thank you received: 0
-
-

13 years 2 months ago -  13 years 2 months ago [\#118871](#118871) by [akroll](/forum/user/26385-akroll "View akroll's Profile")  *[customize add to cart button](/forum/4-how-to/861108-customize-add-to-cart-button#118871 "It is possile to add (in my case) the &quot;add&#95;to&#95;cart&quot; button in category layout: Got this in quantity.php:  I want to add a css class. But where is the button composed?")* was created by *[akroll](/forum/user/26385-akroll "View akroll's Profile")*

It is possile to add (in my case) the "add_to_cart" button in category layout:
Got this in quantity.php: Code:

$this-&gt;cart-&gt;displayButton(JText::_('CHOOSE_OPTIONS'),'choose_options',$this-&gt;params,hikashop_completeLink('product&amp;task=show&amp;product_id='.$this-&gt;row-&gt;product_id.'&amp;name='.$this-&gt;row-&gt;alias.$this-&gt;itemid.$this-&gt;category_pathway),' window.location = \''.str_replace("'","\'",hikashop_completeLink('product&amp;task=show&amp;product_id='.$this-&gt;row-&gt;product_id.'&amp;name='.$this-&gt;row-&gt;alias.$this-&gt;itemid.$this-&gt;category_pathway)).'\';return false;','');

I want to add a css class. But where is the button composed?

Last edit: 13 years 2 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: use code tags

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTEwOC1jdXN0b21pemUtYWRkLXRvLWNhcnQtYnV0dG9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 2 months ago [\#118902](#118902) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[customize add to cart button](/forum/4-how-to/861108-customize-add-to-cart-button#118902 "It is possile to add (in my case) the &quot;add&#95;to&#95;cart&quot; button in category layout: Got this in quantity.php:  I want to add a css class. But where is the button composed?")*

Hi,

The function is a function in the Cart Helper. It is not a function that you can change easily (because it is in the HikaShop core, so your modification will be remove with HikaShop updates).
We will see to change and improve this function, it is in our TODO list for some refactoring parts.

For the moment, I can recommend you to use the code from the cart helper (administrator/components/com_hikashop/helper/cart.php) and put it directly in your view override.
It will be easier for you to change some elements without loosing them with updates.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTEwOC1jdXN0b21pemUtYWRkLXRvLWNhcnQtYnV0dG9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

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

Less More

- Posts: 5
- Thank you received: 0
-
-

13 years 2 months ago [\#118985](#118985) by [akroll](/forum/user/26385-akroll "View akroll's Profile")  Replied by *[akroll](/forum/user/26385-akroll "View akroll's Profile")* on topic *[customize add to cart button](/forum/4-how-to/861108-customize-add-to-cart-button#118985 "It is possile to add (in my case) the &quot;add&#95;to&#95;cart&quot; button in category layout: Got this in quantity.php:  I want to add a css class. But where is the button composed?")*

thanks for the fast reply.

next question:
where is the hikashop_product_stock composed?

i mean this form in which you can type the quantitiy with the "+" and "-" buttons

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTEwOC1jdXN0b21pemUtYWRkLXRvLWNhcnQtYnV0dG9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 2 months ago [\#119000](#119000) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[customize add to cart button](/forum/4-how-to/861108-customize-add-to-cart-button#119000 "It is possile to add (in my case) the &quot;add&#95;to&#95;cart&quot; button in category layout: Got this in quantity.php:  I want to add a css class. But where is the button composed?")*

Hi,

I think you want to override the quantity input field, like explain in our developer documentation.
[ www.hikashop.com/support/documentation/6...tation.html#override](http://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#override)

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTEwOC1jdXN0b21pemUtYWRkLXRvLWNhcnQtYnV0dG9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

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

Less More

- Posts: 5
- Thank you received: 0
-
-

13 years 2 months ago -  13 years 2 months ago [\#119033](#119033) by [akroll](/forum/user/26385-akroll "View akroll's Profile")  Replied by *[akroll](/forum/user/26385-akroll "View akroll's Profile")* on topic *[customize add to cart button](/forum/4-how-to/861108-customize-add-to-cart-button#119033 "It is possile to add (in my case) the &quot;add&#95;to&#95;cart&quot; button in category layout: Got this in quantity.php:  I want to add a css class. But where is the button composed?")*

some examples are very usefull
maybe for function hikashop_image_toggle_js(&amp;$obj){
??
}

Last edit: 13 years 2 months ago by [akroll](/forum/user/26385-akroll "View akroll's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTEwOC1jdXN0b21pemUtYWRkLXRvLWNhcnQtYnV0dG9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 2 months ago [\#119074](#119074) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[customize add to cart button](/forum/4-how-to/861108-customize-add-to-cart-button#119074 "It is possile to add (in my case) the &quot;add&#95;to&#95;cart&quot; button in category layout: Got this in quantity.php:  I want to add a css class. But where is the button composed?")*

Hi,

I don't understand why your are talking about the function "hikashop_image_toggle_js".
I said that you have to override the quantity input field.

> **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.

regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTEwOC1jdXN0b21pemUtYWRkLXRvLWNhcnQtYnV0dG9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

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

Less More

- Posts: 5
- Thank you received: 0
-
-

13 years 2 months ago [\#119142](#119142) by [akroll](/forum/user/26385-akroll "View akroll's Profile")  Replied by *[akroll](/forum/user/26385-akroll "View akroll's Profile")* on topic *[customize add to cart button](/forum/4-how-to/861108-customize-add-to-cart-button#119142 "It is possile to add (in my case) the &quot;add&#95;to&#95;cart&quot; button in category layout: Got this in quantity.php:  I want to add a css class. But where is the button composed?")*

Sorry, I've been to the next question.
I want to override the output of the small images on the product page.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTEwOC1jdXN0b21pemUtYWRkLXRvLWNhcnQtYnV0dG9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 2 months ago [\#119163](#119163) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[customize add to cart button](/forum/4-how-to/861108-customize-add-to-cart-button#119163 "It is possile to add (in my case) the &quot;add&#95;to&#95;cart&quot; button in category layout: Got this in quantity.php:  I want to add a css class. But where is the button composed?")*

Hi,

Ok, I see !

We don't provide example because you have to copy the code from the indicated file.
In the case of the function "hikashop_image_toggle_js", it is the helper image file.

When you open it, you can search for the text "hikashop_image_toggle_js" in the file and you will see the default javascript content include in the helper file.
The override is just a simple php file with a function which will return some "text", you can copy paste the javascript content in the helper image file as the base.

This override will be improved, we are currently working on a new image system for HikaShop.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzg2MTEwOC1jdXN0b21pemUtYWRkLXRvLWNhcnQtYnV0dG9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) 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.100 seconds

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

[](#top)
