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

#   How to add a button below the "add to cart"

##

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

Less More

- Posts: 9
- Thank you received: 0
-
-

15 years 9 months ago [\#7114](#7114) by [49grill](/forum/user/997-49grill "View 49grill's Profile")  *[How to add a button below the "add to cart"](/forum/4-how-to/7114-how-to-add-a-button-below-the-add-to-cart#7114 "I was wondering if there is a native function within HikaShip to be able to place a &quot;button&quot; that is formated like the &quot;add to cart&quot; button, but have it right below the &quot;add to cart&quot; button.  I want to let my customers download my product, so I was hoping that I could add a button that then upon &quot;click&quot; would launch me into the download page.  Can Hika do this or would I have to add custom code? And if I had to add custom code, where would I need to put it into the template?  Thanks in advance, 49grill")* was created by *[49grill](/forum/user/997-49grill "View 49grill's Profile")*

I was wondering if there is a native function within HikaShip to be able to place a "button" that is formated like the "add to cart" button, but have it right below the "add to cart" button.

I want to let my customers download my product, so I was hoping that I could add a button that then upon "click" would launch me into the download page.

Can Hika do this or would I have to add custom code? And if I had to add custom code, where would I need to put it into the template?

Thanks in advance,
49grill

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzcxMTQtaG93LXRvLWFkZC1hLWJ1dHRvbi1iZWxvdy10aGUtYWRkLXRvLWNhcnQ/dG1wbD1tYXJrZG93bg==) 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: 86358
- Thank you received: 14292
-
-

15 years 9 months ago [\#7118](#7118) 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 add a button below the "add to cart"](/forum/4-how-to/7114-how-to-add-a-button-below-the-add-to-cart#7118 "I was wondering if there is a native function within HikaShip to be able to place a &quot;button&quot; that is formated like the &quot;add to cart&quot; button, but have it right below the &quot;add to cart&quot; button.  I want to let my customers download my product, so I was hoping that I could add a button that then upon &quot;click&quot; would launch me into the download page.  Can Hika do this or would I have to add custom code? And if I had to add custom code, where would I need to put it into the template?  Thanks in advance, 49grill")*

There is no function within hikashop for that.

If you want to add a button below the "add to cart" button, you can edit the file quantity of the view product.
The button is displayed using 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);

If you want to use your own link, you can do like this:
echo $this-&gt;cart-&gt;displayButton(JText::_('MY_BUTTON'),'my_button',$this-&gt;params,$link,'window.location = \''.$link.'\';return false;','');

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

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

Less More

- Posts: 9
- Thank you received: 0
-
-

15 years 8 months ago [\#7508](#7508) by [49grill](/forum/user/997-49grill "View 49grill's Profile")  Replied by *[49grill](/forum/user/997-49grill "View 49grill's Profile")* on topic *[Re: How to add a button below the "add to cart"](/forum/4-how-to/7114-how-to-add-a-button-below-the-add-to-cart#7508 "I was wondering if there is a native function within HikaShip to be able to place a &quot;button&quot; that is formated like the &quot;add to cart&quot; button, but have it right below the &quot;add to cart&quot; button.  I want to let my customers download my product, so I was hoping that I could add a button that then upon &quot;click&quot; would launch me into the download page.  Can Hika do this or would I have to add custom code? And if I had to add custom code, where would I need to put it into the template?  Thanks in advance, 49grill")*

Hello Nicolas,
Thanks for the code, but I have tried several times, however it does not work..below you will sere where I have inserted the 2nd piece of code you provided, but the "My Button" still does not display:

&lt;?php
/**
* @package HikaShop for Joomla!
* @version 1.4.4
* @author hikashop.com
* @copyright (C) 2010 HIKARI SOFTWARE. All rights reserved.
* @license GNU/GPLv3 [ www.gnu.org/licenses/gpl-3.0.html](http://www.gnu.org/licenses/gpl-3.0.html)
*/
defined('_JEXEC') or die('Restricted access');
?&gt;
&lt;?php
if(!$this-&gt;params-&gt;get('catalogue')){
if(!empty($this-&gt;row-&gt;has_options)){
echo $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.$this-&gt;itemid),'window.location = \''.hikashop::completeLink('product&amp;task=show&amp;product_id='.$this-&gt;row-&gt;product_id.$this-&gt;itemid).'\';return false;','');
}elseif($this-&gt;config-&gt;get('display_add_to_cart_for_free_products') &#124;&#124; !empty($this-&gt;row-&gt;prices)){
$url = '';
if(empty($this-&gt;ajax)){
$this-&gt;ajax = 'return hikashopModifyQuantity(\''.$this-&gt;row-&gt;product_id.'\',field,1,0);';
}
if($this-&gt;row-&gt;product_sale_end &amp;&amp; $this-&gt;row-&gt;product_sale_end&lt;time()){
?&gt;
&lt;span class="hikashop_product_sale_end"&gt;
&lt;?php echo JText::_('ITEM_NOT_SOLD_ANYMORE'); ?&gt;
&lt;/span&gt;
&lt;?php
}elseif($this-&gt;row-&gt;product_sale_start &amp;&amp; $this-&gt;row-&gt;product_sale_start&gt;time()){
?&gt;
&lt;span class="hikashop_product_sale_start"&gt;
&lt;?php
echo JText::sprintf('ITEM_SOLD_ON_DATE',hikashop::getDate($this-&gt;row-&gt;product_sale_start,$this-&gt;params-&gt;get('date_format','%d %B %Y')));
?&gt;
&lt;/span&gt;
&lt;?php
}else{
if($this-&gt;row-&gt;product_quantity==-1){
?&gt;
&lt;span class="hikashop_product_stock"&gt;
&lt;?php
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);
}elseif($this-&gt;row-&gt;product_quantity&gt;0){
?&gt;
&lt;?php
echo $this-&gt;cart-&gt;displayButton(JText::_('MY_BUTTON'),'my_button',$this-&gt;params,$link,'window.location = \''.$link.'\';return false;',''); ?&gt;
&lt;span class="hikashop_product_stock"&gt;
&lt;?php
echo JText::sprintf('X_ITEMS_IN_STOCK',$this-&gt;row-&gt;product_quantity);
echo '&lt;br/&gt;';
$config =&amp; hikashop::config();
if($config-&gt;get('button_style','normal')=='css'){
echo '&lt;br /&gt;';
}
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);
}else{
?&gt;
&lt;span class="hikashop_product_no_stock"&gt;
&lt;?php
echo JText::_('NO_STOCK');
}?&gt;
&lt;/span&gt;
&lt;?php
}
}
}
?&gt;
&lt;br/&gt;

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzcxMTQtaG93LXRvLWFkZC1hLWJ1dHRvbi1iZWxvdy10aGUtYWRkLXRvLWNhcnQ/dG1wbD1tYXJrZG93bg==) 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: 86358
- Thank you received: 14292
-
-

15 years 8 months ago [\#7511](#7511) 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 add a button below the "add to cart"](/forum/4-how-to/7114-how-to-add-a-button-below-the-add-to-cart#7511 "I was wondering if there is a native function within HikaShip to be able to place a &quot;button&quot; that is formated like the &quot;add to cart&quot; button, but have it right below the &quot;add to cart&quot; button.  I want to let my customers download my product, so I was hoping that I could add a button that then upon &quot;click&quot; would launch me into the download page.  Can Hika do this or would I have to add custom code? And if I had to add custom code, where would I need to put it into the template?  Thanks in advance, 49grill")*

You added the my_button code just after the line
}elseif($this-&gt;row-&gt;product_quantity&gt;0){

which means that it will only be displayed if the stock of your product is not unlimited. You also need to set the variable $link with the link where you want your users to be redirected when clicking on the button.

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

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

Less More

- Posts: 9
- Thank you received: 0
-
-

15 years 8 months ago [\#7518](#7518) by [49grill](/forum/user/997-49grill "View 49grill's Profile")  Replied by *[49grill](/forum/user/997-49grill "View 49grill's Profile")* on topic *[Re: How to add a button below the "add to cart"](/forum/4-how-to/7114-how-to-add-a-button-below-the-add-to-cart#7518 "I was wondering if there is a native function within HikaShip to be able to place a &quot;button&quot; that is formated like the &quot;add to cart&quot; button, but have it right below the &quot;add to cart&quot; button.  I want to let my customers download my product, so I was hoping that I could add a button that then upon &quot;click&quot; would launch me into the download page.  Can Hika do this or would I have to add custom code? And if I had to add custom code, where would I need to put it into the template?  Thanks in advance, 49grill")*

Yep. Great.
that totally worked now.
Thank you so much.

However the quantity box with the default "1" and the +/- shows up to the left of the "my button"

Why is that? and how do I remove those two item?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzcxMTQtaG93LXRvLWFkZC1hLWJ1dHRvbi1iZWxvdy10aGUtYWRkLXRvLWNhcnQ/dG1wbD1tYXJrZG93bg==) 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: 86358
- Thank you received: 14292
-
-

15 years 8 months ago [\#7519](#7519) 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 add a button below the "add to cart"](/forum/4-how-to/7114-how-to-add-a-button-below-the-add-to-cart#7519 "I was wondering if there is a native function within HikaShip to be able to place a &quot;button&quot; that is formated like the &quot;add to cart&quot; button, but have it right below the &quot;add to cart&quot; button.  I want to let my customers download my product, so I was hoping that I could add a button that then upon &quot;click&quot; would launch me into the download page.  Can Hika do this or would I have to add custom code? And if I had to add custom code, where would I need to put it into the template?  Thanks in advance, 49grill")*

That's because it's the way it's made on the product page.

What do you mean by "those two item" ?

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

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

Less More

- Posts: 9
- Thank you received: 0
-
-

15 years 8 months ago [\#7523](#7523) by [49grill](/forum/user/997-49grill "View 49grill's Profile")  Replied by *[49grill](/forum/user/997-49grill "View 49grill's Profile")* on topic *[Re: How to add a button below the "add to cart"](/forum/4-how-to/7114-how-to-add-a-button-below-the-add-to-cart#7523 "I was wondering if there is a native function within HikaShip to be able to place a &quot;button&quot; that is formated like the &quot;add to cart&quot; button, but have it right below the &quot;add to cart&quot; button.  I want to let my customers download my product, so I was hoping that I could add a button that then upon &quot;click&quot; would launch me into the download page.  Can Hika do this or would I have to add custom code? And if I had to add custom code, where would I need to put it into the template?  Thanks in advance, 49grill")*

remove the "quantity box" and the "+/-" for that row?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzcxMTQtaG93LXRvLWFkZC1hLWJ1dHRvbi1iZWxvdy10aGUtYWRkLXRvLWNhcnQ/dG1wbD1tYXJrZG93bg==) 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: 86358
- Thank you received: 14292
-
-

15 years 8 months ago [\#7524](#7524) 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 add a button below the "add to cart"](/forum/4-how-to/7114-how-to-add-a-button-below-the-add-to-cart#7524 "I was wondering if there is a native function within HikaShip to be able to place a &quot;button&quot; that is formated like the &quot;add to cart&quot; button, but have it right below the &quot;add to cart&quot; button.  I want to let my customers download my product, so I was hoping that I could add a button that then upon &quot;click&quot; would launch me into the download page.  Can Hika do this or would I have to add custom code? And if I had to add custom code, where would I need to put it into the template?  Thanks in advance, 49grill")*

Ah yes,
You can use that code instead then:
$empty='';
$params = new JParameter($empty);
$this-&gt;cart-&gt;displayButton(JText::_('MY_BUTTON'),'my_button',$params,$link,'window.location = \''.$link.'\';return false;','');

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

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

Less More

- Posts: 9
- Thank you received: 0
-
-

15 years 8 months ago [\#7543](#7543) by [49grill](/forum/user/997-49grill "View 49grill's Profile")  Replied by *[49grill](/forum/user/997-49grill "View 49grill's Profile")* on topic *[Re: How to add a button below the "add to cart"](/forum/4-how-to/7114-how-to-add-a-button-below-the-add-to-cart#7543 "I was wondering if there is a native function within HikaShip to be able to place a &quot;button&quot; that is formated like the &quot;add to cart&quot; button, but have it right below the &quot;add to cart&quot; button.  I want to let my customers download my product, so I was hoping that I could add a button that then upon &quot;click&quot; would launch me into the download page.  Can Hika do this or would I have to add custom code? And if I had to add custom code, where would I need to put it into the template?  Thanks in advance, 49grill")*

Perfect. Thanks so much. Greatly appreciated

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

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