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

#   Display Coupon/Discount Value in Showcart

##

- **[Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")**
- [![Ed&#95;Hika's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile") Topic Author
- [ Offline](/forum/user/33922-ed-hika)

Less More

- Posts: 109
- Thank you received: 5
-
-

11 years 11 months ago [\#184029](#184029) by [Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")  *[Display Coupon/Discount Value in Showcart](/forum/35-orders-management/873780-display-coupon-discount-value-in-showcart#184029 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Hello, there.  Good afternoon!  The cart/showcart view does not display discount value (although the cart modules and checkout/cart have the ability to do so).  In trying to display the coupon value in the cart/showcart.php view, I am trying to do the following:  1) have the ability to add/delete a coupon in this view 2) display a discount/coupon line total in footer  Regarding:  Point 1 - ability to add/delete a coupon in the cart/showcart view, I have included the following code:  However, this above code doesn't add/delete the coupon. Please could you let me know:  a) how to get the add functionality to work? Or at least let me know where I can find/call the hikashopCheckCoupon function?  b) how to get the delete functionality to work? I have copied the above code from checkout/coupon.php and noticed that the delete functionality calls a previous link using hikashop&#95;completeLink. Please let me know what the link is to delete the coupon when called from the cart/showcart.php code.  Point 2 - display a discount/coupon line total in footer This is simple enough if the value of the coupon is in the $this structure. I noticed that the coupon code is in the structure (under $this-&gt;cartVal-&gt;cart&#95;coupon) but the value is not there. I am not sure I understand why Hikashop retrieves the coupon code and included it in the structure but not the value.  Please could you let me know how to add the value of the coupon in the $this structure or obtain the value from the cart/showcart.php view?  Thanks very much for your help.  Take care!")* was created by *[Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")*

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.6

Hello, there.

Good afternoon!

The cart/showcart view does not display discount value (although the cart modules and checkout/cart have the ability to do so).

In trying to display the coupon value in the cart/showcart.php view, I am trying to do the following:

1) have the ability to add/delete a coupon in this view
2) display a discount/coupon line total in footer

Regarding:

Point 1 - ability to add/delete a coupon in the cart/showcart view, I have included the following code:
Code:

&lt;span class="hikashop_checkout_coupon" id="hikashop_checkout_coupon"&gt; &lt;?php if(empty($this-&gt;cartVal-&gt;cart_coupon)){ echo JText::_('HIKASHOP_ENTER_COUPON'); ?&gt; &lt;input id="hikashop_checkout_coupon_input" type="text" name="coupon" value="" /&gt; &lt;?php echo $this-&gt;cart-&gt;displayButton(JText::_('ADD'),'refresh',$this-&gt;params,hikashop_completeLink(''),'',' onclick="return hikashopCheckCoupon(\'hikashop_checkout_coupon_input\');"'); }else{ echo JText::sprintf('HIKASHOP_COUPON_LABEL',@$this-&gt;cartVal-&gt;cart_coupon); global $Itemid; $url_itemid=''; if(!empty($Itemid)){ $url_itemid='&amp;Itemid='.$Itemid; } ?&gt; &lt;a href="&lt;?php echo hikashop_completeLink(''); ?&gt;" title="&lt;?php echo JText::_('REMOVE_COUPON'); ?&gt;" &gt; &lt;img src="&lt;?php echo HIKASHOP_IMAGES . 'delete2.png';?&gt;" alt="&lt;?php echo JText::_('REMOVE_COUPON'); ?&gt;" /&gt; &lt;/a&gt; &lt;?php }?&gt; &lt;/span&gt;

However, this above code doesn't add/delete the coupon. Please could you let me know:

a) how to get the add functionality to work? Or at least let me know where I can find/call the hikashopCheckCoupon function?

b) how to get the delete functionality to work? I have copied the above code from checkout/coupon.php and noticed that the delete functionality calls a previous link using hikashop_completeLink. Please let me know what the link is to delete the coupon when called from the cart/showcart.php code.

Point 2 - display a discount/coupon line total in footer
This is simple enough if the value of the coupon is in the $this structure. I noticed that the coupon code is in the structure (under $this-&gt;cartVal-&gt;cart_coupon) but the value is not there. I am not sure I understand why Hikashop retrieves the coupon code and included it in the structure but not the value.

Please could you let me know how to add the value of the coupon in the $this structure or obtain the value from the cart/showcart.php view?

Thanks very much for your help.

Take care!

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

11 years 11 months ago [\#184097](#184097) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Display Coupon/Discount Value in Showcart](/forum/35-orders-management/873780-display-coupon-discount-value-in-showcart#184097 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Hello, there.  Good afternoon!  The cart/showcart view does not display discount value (although the cart modules and checkout/cart have the ability to do so).  In trying to display the coupon value in the cart/showcart.php view, I am trying to do the following:  1) have the ability to add/delete a coupon in this view 2) display a discount/coupon line total in footer  Regarding:  Point 1 - ability to add/delete a coupon in the cart/showcart view, I have included the following code:  However, this above code doesn't add/delete the coupon. Please could you let me know:  a) how to get the add functionality to work? Or at least let me know where I can find/call the hikashopCheckCoupon function?  b) how to get the delete functionality to work? I have copied the above code from checkout/coupon.php and noticed that the delete functionality calls a previous link using hikashop&#95;completeLink. Please let me know what the link is to delete the coupon when called from the cart/showcart.php code.  Point 2 - display a discount/coupon line total in footer This is simple enough if the value of the coupon is in the $this structure. I noticed that the coupon code is in the structure (under $this-&gt;cartVal-&gt;cart&#95;coupon) but the value is not there. I am not sure I understand why Hikashop retrieves the coupon code and included it in the structure but not the value.  Please could you let me know how to add the value of the coupon in the $this structure or obtain the value from the cart/showcart.php view?  Thanks very much for your help.  Take care!")*

Hi,

To have this working, you have to edit the cart controller in order to add functions to manage the coupons.
View editions will not be enough.

You can see how it's working in the checkout controller, there is many calls to the cart class etc to update coupons.

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

- **[Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")**
- [![Ed&#95;Hika's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile") Topic Author
- [ Offline](/forum/user/33922-ed-hika)

Less More

- Posts: 109
- Thank you received: 5
-
-

11 years 11 months ago [\#184115](#184115) by [Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")  Replied by *[Ed\_Hika](/forum/user/33922-ed-hika "View Ed&#95;Hika's Profile")* on topic *[Display Coupon/Discount Value in Showcart](/forum/35-orders-management/873780-display-coupon-discount-value-in-showcart#184115 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Hello, there.  Good afternoon!  The cart/showcart view does not display discount value (although the cart modules and checkout/cart have the ability to do so).  In trying to display the coupon value in the cart/showcart.php view, I am trying to do the following:  1) have the ability to add/delete a coupon in this view 2) display a discount/coupon line total in footer  Regarding:  Point 1 - ability to add/delete a coupon in the cart/showcart view, I have included the following code:  However, this above code doesn't add/delete the coupon. Please could you let me know:  a) how to get the add functionality to work? Or at least let me know where I can find/call the hikashopCheckCoupon function?  b) how to get the delete functionality to work? I have copied the above code from checkout/coupon.php and noticed that the delete functionality calls a previous link using hikashop&#95;completeLink. Please let me know what the link is to delete the coupon when called from the cart/showcart.php code.  Point 2 - display a discount/coupon line total in footer This is simple enough if the value of the coupon is in the $this structure. I noticed that the coupon code is in the structure (under $this-&gt;cartVal-&gt;cart&#95;coupon) but the value is not there. I am not sure I understand why Hikashop retrieves the coupon code and included it in the structure but not the value.  Please could you let me know how to add the value of the coupon in the $this structure or obtain the value from the cart/showcart.php view?  Thanks very much for your help.  Take care!")*

Thanks, Xavier.

At the very least, relating to point 2 which I raised, would you be able to have Hikashop expose the total prices in a consistent manner between the cart/showcart view and the product/cart view? Here is what I mean.

In the view:
a) cart/showcart view:
i) $this-&gt;total-&gt;prices[0]-&gt;price_value shows the total without taking into consideration the discount; and
ii) $this-&gt;cartVal-&gt;cart_coupon already shows the coupon voucher name (which begs the question why doesn't Hikashop also expose the coupon value either in for example, $this-&gt;cartVal-&gt;cart_coupon_value or in the $this-total-&gt;prices[0] structure (see point b) below)?

b) product/cart view:
i) $this-&gt;total-&gt;prices[0]-&gt;price_value shows the total after the discount and shipping and has $this-&gt;total-&gt;prices[0]-&gt;price_value_without_discount to display the value before the discount is applied.

I am not sure I understand why Hikashop exposes the complete set of values in the product/cart view module but not in the cart/showcart view. Granted, you will say that shipping may not be known until checkout. However, once it is calculated, then cart/showcart view should have information as well.

Thanks.

Take care!

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

11 years 11 months ago [\#184127](#184127) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Display Coupon/Discount Value in Showcart](/forum/35-orders-management/873780-display-coupon-discount-value-in-showcart#184127 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3.3.6  Hello, there.  Good afternoon!  The cart/showcart view does not display discount value (although the cart modules and checkout/cart have the ability to do so).  In trying to display the coupon value in the cart/showcart.php view, I am trying to do the following:  1) have the ability to add/delete a coupon in this view 2) display a discount/coupon line total in footer  Regarding:  Point 1 - ability to add/delete a coupon in the cart/showcart view, I have included the following code:  However, this above code doesn't add/delete the coupon. Please could you let me know:  a) how to get the add functionality to work? Or at least let me know where I can find/call the hikashopCheckCoupon function?  b) how to get the delete functionality to work? I have copied the above code from checkout/coupon.php and noticed that the delete functionality calls a previous link using hikashop&#95;completeLink. Please let me know what the link is to delete the coupon when called from the cart/showcart.php code.  Point 2 - display a discount/coupon line total in footer This is simple enough if the value of the coupon is in the $this structure. I noticed that the coupon code is in the structure (under $this-&gt;cartVal-&gt;cart&#95;coupon) but the value is not there. I am not sure I understand why Hikashop retrieves the coupon code and included it in the structure but not the value.  Please could you let me know how to add the value of the coupon in the $this structure or obtain the value from the cart/showcart.php view?  Thanks very much for your help.  Take care!")*

Hi,

We will see to improve that part. I just added it on my todo list.

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

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