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

#   How to create 2 Different Add To Cart Buttons

##

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

Less More

- Posts: 24
- Thank you received: 0
-
-

15 years 5 months ago [\#18678](#18678) by [axyswebs](/forum/user/1550-axyswebs "View axyswebs's Profile")  *[How to create 2 Different Add To Cart Buttons](/forum/4-how-to/18678-how-to-create-2-different-add-to-cart-buttons#18678 "Hi  I would like to use a different add-to-cart button for each product category or at least have different wordings for the add-to-cart buttons in each category. Hope you can help??  Thanks  Tony")* was created by *[axyswebs](/forum/user/1550-axyswebs "View axyswebs's Profile")*

Hi

I would like to use a different add-to-cart button for each product category or at least have different wordings for the add-to-cart buttons in each category. Hope you can help??

Thanks

Tony

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86564
- Thank you received: 14311
-
-

15 years 5 months ago [\#18691](#18691) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: How to create 2 Different Add To Cart Buttons](/forum/4-how-to/18678-how-to-create-2-different-add-to-cart-buttons#18691 "Hi  I would like to use a different add-to-cart button for each product category or at least have different wordings for the add-to-cart buttons in each category. Hope you can help??  Thanks  Tony")*

Hi,

You should use a button template override: [ www.hikashop.com/support/documentation/6...tation.html#override](http://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#override)
You will have to get the id of the product on the page (or the id of the category for the products listing on the page) from the request and then load the category of the product ( or the category from the category id of the request ) and then display the button accordingly.

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

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

Less More

- Posts: 24
- Thank you received: 0
-
-

15 years 1 week ago [\#29460](#29460) by [axyswebs](/forum/user/1550-axyswebs "View axyswebs's Profile")  Replied by *[axyswebs](/forum/user/1550-axyswebs "View axyswebs's Profile")* on topic *[Re: How to create 2 Different Add To Cart Buttons](/forum/4-how-to/18678-how-to-create-2-different-add-to-cart-buttons#29460 "Hi  I would like to use a different add-to-cart button for each product category or at least have different wordings for the add-to-cart buttons in each category. Hope you can help??  Thanks  Tony")*

Hi

I am wanting to show an alternative text for the add to cart link. I currently have an override ADD_TO_CART="Request CA" but would like to show different text for another category. Is this possible in this code?

&lt;?php

if($this-&gt;params-&gt;get('show_price')){
$this-&gt;setLayout('listing_price');
echo $this-&gt;loadTemplate();
}
if($this-&gt;params-&gt;get('add_to_cart')){
?&gt;&lt;form action="&lt;?php echo hikashop::completeLink('product&amp;task=updatecart'); ?&gt;" method="post" name="hikashop_product_form_&lt;?php echo $this-&gt;row-&gt;product_id.'_'.$this-&gt;params-&gt;get('main_div_name'); ?&gt;"&gt;&lt;?php
$this-&gt;ajax='';
$this-&gt;setLayout('quantity');
echo $this-&gt;loadTemplate();
?&gt;
&lt;input type="hidden" name="product_id" value="&lt;?php echo $this-&gt;row-&gt;product_id; ?&gt;" /&gt;
&lt;input type="hidden" name="add" value="1"/&gt;
&lt;input type="hidden" name="ctrl" value="product"/&gt;
&lt;input type="hidden" name="task" value="updatecart"/&gt;
&lt;/form&gt;&lt;?php
}
?&gt;

Or do I need a programmer to do as you have suggested above?

Thanks

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86564
- Thank you received: 14311
-
-

15 years 1 week ago [\#29469](#29469) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: How to create 2 Different Add To Cart Buttons](/forum/4-how-to/18678-how-to-create-2-different-add-to-cart-buttons#29469 "Hi  I would like to use a different add-to-cart button for each product category or at least have different wordings for the add-to-cart buttons in each category. Hope you can help??  Thanks  Tony")*

Hi,

If you just want to change the text of the button, it can be done without a button template override.

You can change the code :
echo $this-&gt;cart-&gt;displayButton(JText::_('ADD_TO_CART'),'add',$this-&gt;params,$url,$this-&gt;ajax,'',$this-&gt;row-&gt;product_max_per_order,$this-&gt;row-&gt;product_min_per_order);

in the file "quantity" of the view "product" via the menu Display-&gt;Views.
But that still requires some programming skills to load the category of the current product and change the JText::_('ADD_TO_CART') based on the category...

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

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

Less More

- Posts: 24
- Thank you received: 0
-
-

15 years 1 week ago [\#29482](#29482) by [axyswebs](/forum/user/1550-axyswebs "View axyswebs's Profile")  Replied by *[axyswebs](/forum/user/1550-axyswebs "View axyswebs's Profile")* on topic *[Re: How to create 2 Different Add To Cart Buttons](/forum/4-how-to/18678-how-to-create-2-different-add-to-cart-buttons#29482 "Hi  I would like to use a different add-to-cart button for each product category or at least have different wordings for the add-to-cart buttons in each category. Hope you can help??  Thanks  Tony")*

Does Hikashop offer a service for this?

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

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86564
- Thank you received: 14311
-
-

15 years 1 week ago [\#29496](#29496) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: How to create 2 Different Add To Cart Buttons](/forum/4-how-to/18678-how-to-create-2-different-add-to-cart-buttons#29496 "Hi  I would like to use a different add-to-cart button for each product category or at least have different wordings for the add-to-cart buttons in each category. Hope you can help??  Thanks  Tony")*

Sure, you can use our contact form to request a quote. We should be able to do that for you for a small fee.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzE4Njc4LWhvdy10by1jcmVhdGUtMi1kaWZmZXJlbnQtYWRkLXRvLWNhcnQtYnV0dG9ucz90bXBsPW1hcmtkb3du) 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.063 seconds

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