Hide "Enter coupon code" entry box when automatic Coupon is not applicable

  • Posts: 31
  • Thank you received: 1
  • Hikashop Business
3 years 10 months ago #328477

-- url of the page with the problem -- : www.mathost3.co.uk/lou4/index.php/order-labels/checkout
-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.1
-- PHP version -- : 7.3.23
-- Browser(s) name and version -- : Firefox Developer 82.0b7(64-bit)
-- Error-message(debug-mod must be tuned on) -- : No error

Hi

I am using coupons to price automatically based on order quantity. The issues is when no coupon is applicable the "Enter you coupon" entry box shows. I want to hide this. How do I do this?

Many thanks

Neville Matthews

Please Log in or Create an account to join the conversation.

  • Posts: 4747
  • Thank you received: 644
  • MODERATOR
3 years 10 months ago #328485

Hello,

It's possible with some custom Css command and override view.
To learn how to proceed for add some custom Css, have a look on this Documentation , and for see how HikaShop override system works, you have this documentation (html & php knowledge required).

Now, in details you have to add some custom code to add a class on your html element when your coupon is empty :

$extra_class = "";
if(empty($cart->coupon)) {$extra_class = "extra_class_empty_coupon";}

<?php if(empty($this->ajax)) { ?>
<div id="hikashop_checkout_coupon_<?php echo $this->step; ?>_<?php echo $this->module_position; ?>" data-checkout-step="<?php echo $this->step; ?>" data-checkout-pos="<?php echo $this->module_position; ?>" class="hikashop_checkout_coupon <?php echo $extra_class; ?>">
<?php } ?>
	<div class="hikashop_checkout_loading_elem"></div>
	<div class="hikashop_checkout_loading_spinner...
Then, add in your frontend file css, this kind of command :
.
extra_class_empty_coupon {display:none;}

Hope this will help to achieved what you requested.
Regards

Last edit: 3 years 10 months ago by Philip.

Please Log in or Create an account to join the conversation.

Time to create page: 0.055 seconds
Powered by Kunena Forum