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