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

#   Discount being applied to individual products

##

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

Less More

- Posts: 122
- Thank you received: 0
-
-

12 years 6 months ago [\#156246](#156246) by [optimized](/forum/user/31311-optimized "View optimized's Profile")  *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#156246 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")* was created by *[optimized](/forum/user/31311-optimized "View optimized's Profile")*

-- url of the page with the problem -- : starsupplyalliance.com
-- HikaShop version -- : 2.3.1
-- Joomla version -- : 3.2
-- PHP version -- : 5.4
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : Error_message

I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.

How do I get the coupon to reflect the total amount in the cart?

Many thanks,

Mike

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

- **[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")**
- [![lousyfool's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar28604.jpg)](/forum/user/28604-lousyfool "View lousyfool's Profile")
- [ Offline](/forum/user/28604-lousyfool)

Less More

- Posts: 2143
- Thank you received: 746
-
- [](http://www.inphase.one)
-

12 years 6 months ago [\#156286](#156286) by [lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")  Replied by *[lousyfool](/forum/user/28604-lousyfool "View lousyfool's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#156286 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

Reads like you haven't configured the coupon properly.

Go into the discount/coupon and check the settings. There's one where the on-board help says, "Coupon percentage applies to product only : When a percentage is entered for the coupon and that a product or a category is selected for the coupon, if you activate that option, the coupon value will be based on the price of that product in the cart or on the sum of prices of all the products of the cart which are in that category."

If it's all set okay, the coupon will apply not to a single product, but to the (sub)total of the cart, means all items in the cart, before shipping.

Still unsure? Then click on "Help" in the toolbar while there...

---

Need help with customisations of layouts, style or other site development? [ PM me!](/component/uddeim/?task=new)
(Don't forget to turn on [ "E-mail notification of new messages"](/component/uddeim/?task=settings))

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg2ODI2NC1kaXNjb3VudC1iZWluZy1hcHBsaWVkLXRvLWluZGl2aWR1YWwtcHJvZHVjdHM/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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

12 years 6 months ago [\#156261](#156261) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#156261 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

Hi,

We didn't get any screenshot in your message. Could you try again to attach it please ?
Without knowing how the coupon is setup it's hard to say what could be wrong.

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

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

Less More

- Posts: 122
- Thank you received: 0
-
-

12 years 6 months ago [\#156407](#156407) by [optimized](/forum/user/31311-optimized "View optimized's Profile")  Replied by *[optimized](/forum/user/31311-optimized "View optimized's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#156407 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

Hi guys,

I attach the screenshot of the coupon set up and the complete coupon list.

I have the Category set to 2 product category

Whether I set Coupon percentage applies to product only to Yes or No the discount applies 10% which is the $1000 bracket coupon rather than the 15%

How do I get the 15% discount on the total?

Thanks,

Mike

- [ ![hd8e06e3.png](/forum/attachment/17338) ](/forum/attachment/17338 "hd8e06e3.png") [ ](/forum/attachment/17338?download=1 "hd8e06e3.png")
- [ ![ha827e2e.png](/forum/attachment/17339) ](/forum/attachment/17339 "ha827e2e.png") [ ](/forum/attachment/17339?download=1 "ha827e2e.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg2ODI2NC1kaXNjb3VudC1iZWluZy1hcHBsaWVkLXRvLWluZGl2aWR1YWwtcHJvZHVjdHM/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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

12 years 6 months ago [\#156449](#156449) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#156449 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

Hi,

I would recommend to remove the category selection and turn off the option " Coupon percentage applies to product only" so that it applies to the total purchased order. Make sure that you do that for all the coupons.

It should work fine then.

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

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

Less More

- Posts: 122
- Thank you received: 0
-
-

12 years 6 months ago [\#156567](#156567) by [optimized](/forum/user/31311-optimized "View optimized's Profile")  Replied by *[optimized](/forum/user/31311-optimized "View optimized's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#156567 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

Hi Nicolas,

I followed your instructions and now the cart seems to me calculating the discount across the whole cart correctly but it seems to be only using the lowest rate of 5% to make the discount even when the order is above $1000 which should give a rate of 10% - see screenshots.

What could be causing this issue?

Thanks,

Mike

- [ ![h8d67c26.png](/forum/attachment/17352) ](/forum/attachment/17352 "h8d67c26.png") [ ](/forum/attachment/17352?download=1 "h8d67c26.png")
- [ ![h4548e14.png](/forum/attachment/17353) ](/forum/attachment/17353 "h4548e14.png") [ ](/forum/attachment/17353?download=1 "h4548e14.png")

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

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

12 years 6 months ago [\#156573](#156573) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#156573 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

Hello Mike,
I think that you should also set a "Maximum order value" for your coupons like 599.99 for your 5% coupon.

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

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

Less More

- Posts: 122
- Thank you received: 0
-
-

12 years 6 months ago [\#156739](#156739) by [optimized](/forum/user/31311-optimized "View optimized's Profile")  Replied by *[optimized](/forum/user/31311-optimized "View optimized's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#156739 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

Hello Mohamed,

Your suggestion makes sense to me but I cannot see this option - see attached screenshot.

Please advise.

Thanks,

Mike

- [ ![h30e122a.png](/forum/attachment/17392) ](/forum/attachment/17392 "h30e122a.png") [ ](/forum/attachment/17392?download=1 "h30e122a.png")

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

12 years 6 months ago [\#156877](#156877) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#156877 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

Hi,

There is indeed not this option for the coupons.

I have reproduced the issue on my local. I add in the todo list to debug that as soon as possible.
We will keep you informed. Thanks for the report.

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

12 years 5 months ago [\#158353](#158353) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#158353 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

Hi,

We have solved this problem, it will be available in the next release.
To correct it now, thanks to edit the file "administrator/components/com_hikashop/classes/cart" and replace the function "loadFullCart()" by the following code: Code:

function &amp;loadFullCart($additionalInfos=false,$keepEmptyCart=false,$skipChecks=false){ $app = JFactory::getApplication(); $database = JFactory::getDBO(); $config =&amp; hikashop_config(); $currencyClass = hikashop_get('class.currency'); $productClass = hikashop_get('class.product'); $main_currency = (int)$config-&gt;get('main_currency',1); $currency_id = hikashop_getCurrency(); if(!in_array($currency_id,$currencyClass-&gt;publishedCurrencies())){ //if the selected currency can't be used for checkout use the main currency $currency_id = $main_currency; } $zone_id = hikashop_getZone('shipping'); if($config-&gt;get('tax_zone_type','shipping')=='billing'){ $tax_zone_id=hikashop_getZone('billing'); }else{ $tax_zone_id=$zone_id; } $discount_before_tax = (int)$config-&gt;get('discount_before_tax',0); $cart = new stdClass(); $cart-&gt;products = $this-&gt;get(@$this-&gt;cart-&gt;cart_id, $keepEmptyCart); $cart-&gt;cart_id = (int)@$this-&gt;cart-&gt;cart_id; $cart-&gt;cart_type = @$this-&gt;cart-&gt;cart_type; $cart-&gt;cart_params = @$this-&gt;cart-&gt;cart_params; $cart-&gt;coupon = null; $cart-&gt;shipping = null; $cart-&gt;total = null; $cart-&gt;additional = array(); if(!empty($cart-&gt;products)){ $ids = array(); foreach($cart-&gt;products as $product){ $ids[]=$product-&gt;product_id; } JArrayHelper::toInteger($ids); $query = 'SELECT * FROM '.hikashop_table('file').' WHERE file_ref_id IN ('.implode(',',$ids).') AND file_type IN( \'product\',\'file\') ORDER BY file_ref_id ASC, file_ordering ASC'; $database-&gt;setQuery($query); $images = $database-&gt;loadObjectList(); if(!empty($images)){ foreach($cart-&gt;products as $k =&gt; $row){ $productClass-&gt;addFiles($cart-&gt;products[$k],$images); } } //add variants inside main products as reference for tax calculus foreach($cart-&gt;products as $k =&gt; $row){ if($row-&gt;product_type=='variant'){ foreach($cart-&gt;products as $k2 =&gt; $row2){ if($row-&gt;product_parent_id==$row2-&gt;product_id){ $cart-&gt;products[$k2]-&gt;variants[]=&amp;$cart-&gt;products[$k]; break; } } } } //add the characteristics infos $query = 'SELECT a.*,b.* FROM '.hikashop_table('variant').' AS a LEFT JOIN '.hikashop_table('characteristic').' AS b ON a.variant_characteristic_id=b.characteristic_id WHERE a.variant_product_id IN ('.implode(',',$ids).') ORDER BY a.ordering,b.characteristic_value'; $database-&gt;setQuery($query); $characteristics = $database-&gt;loadObjectList(); if(!empty($characteristics)){ foreach($cart-&gt;products as $key =&gt; $product){ if($product-&gt;product_type!='variant'){ $element =&amp; $cart-&gt;products[$key]; $product_id=$product-&gt;product_id; $mainCharacteristics = array(); foreach($characteristics as $characteristic){ if($product_id==$characteristic-&gt;variant_product_id){ $mainCharacteristics[$product_id][$characteristic-&gt;characteristic_parent_id][$characteristic-&gt;characteristic_id]=$characteristic; } if(!empty($element-&gt;options)){ foreach($element-&gt;options as $k =&gt; $optionElement){ if($optionElement-&gt;product_id==$characteristic-&gt;variant_product_id){ $mainCharacteristics[$optionElement-&gt;product_id][$characteristic-&gt;characteristic_parent_id][$characteristic-&gt;characteristic_id]=$characteristic; } } } } if(!empty($element-&gt;variants)){ $this-&gt;addCharacteristics($element,$mainCharacteristics,$characteristics); } if(!empty($element-&gt;options)){ foreach($element-&gt;options as $k =&gt; $optionElement){ if(!empty($optionElement-&gt;variants)){ $this-&gt;addCharacteristics($element-&gt;options[$k],$mainCharacteristics,$characteristics); } } } } } } //calculate prices $product_quantities = array(); foreach($cart-&gt;products as $row){ if(empty($product_quantities[$row-&gt;product_id])){ $product_quantities[$row-&gt;product_id] = (int)@$row-&gt;cart_product_quantity; }else{ $product_quantities[$row-&gt;product_id]+=(int)@$row-&gt;cart_product_quantity; } if(empty($product_quantities[$row-&gt;product_parent_id])){ $product_quantities[$row-&gt;product_parent_id] = (int)@$row-&gt;cart_product_quantity; }else{ $product_quantities[$row-&gt;product_parent_id] += (int)@$row-&gt;cart_product_quantity; } } foreach($cart-&gt;products as $k =&gt; $row){ $cart-&gt;products[$k]-&gt;cart_product_total_quantity = $product_quantities[$row-&gt;product_id]; if($row-&gt;product_parent_id){ $cart-&gt;products[$k]-&gt;cart_product_total_variants_quantity = $product_quantities[$row-&gt;product_parent_id]; }else{ $cart-&gt;products[$k]-&gt;cart_product_total_variants_quantity = $cart-&gt;products[$k]-&gt;cart_product_total_quantity; } } $currencyClass-&gt;getPrices($cart-&gt;products,$ids,$currency_id,$main_currency,$tax_zone_id,$discount_before_tax); if($additionalInfos){ $queryImage = 'SELECT * FROM '.hikashop_table('file').' WHERE file_ref_id IN ('.implode(',',$ids).') AND file_type=\'product\' ORDER BY file_ref_id ASC, file_ordering ASC, file_id ASC'; $database-&gt;setQuery($queryImage); $images = $database-&gt;loadObjectList(); foreach($cart-&gt;products as $k=&gt;$row){ if(!empty($images)){ foreach($images as $image){ if($row-&gt;product_id==$image-&gt;file_ref_id){ if(!isset($row-&gt;file_ref_id)){ foreach(get_object_vars($image) as $key =&gt; $name){ $cart-&gt;products[$k]-&gt;$key = $name; } } break; } } } if(!isset($cart-&gt;products[$k]-&gt;file_name)){ $cart-&gt;products[$k]-&gt;file_name = $row-&gt;product_name; } } } foreach($cart-&gt;products as $k =&gt; $row){ if(!empty($row-&gt;variants)){ foreach($row-&gt;variants as $k2 =&gt; $variant){ $productClass-&gt;checkVariant($cart-&gt;products[$k]-&gt;variants[$k2],$row); } } } //check that products are still published etc $notUsable = array(); $cartData = $this-&gt;loadCart($cart-&gt;cart_id); if(!$skipChecks){ $cart-&gt;products = array_reverse($cart-&gt;products); foreach($cart-&gt;products as $k =&gt; $product){ if(empty($product-&gt;product_id)){ continue; } if(!empty($product-&gt;cart_product_quantity)){ $oldQty = $product-&gt;cart_product_quantity; if(@$cartData-&gt;cart_type != 'wishlist') $this-&gt;_checkQuantity($product,$product-&gt;cart_product_quantity,$cart-&gt;products,$product-&gt;cart_product_id); if($oldQty!=$product-&gt;cart_product_quantity){ $notUsable[$product-&gt;cart_product_id]=0; break; } if(!$config-&gt;get('display_add_to_cart_for_free_products',0) &amp;&amp; empty($product-&gt;prices)){ $notUsable[$product-&gt;cart_product_id]=0; $app-&gt;enqueueMessage(JText::sprintf('PRODUCT_NOT_AVAILABLE',$product-&gt;product_name),'notice'); continue; } if(empty($product-&gt;product_published)){ $notUsable[$product-&gt;cart_product_id]=0; $app-&gt;enqueueMessage(JText::sprintf('PRODUCT_NOT_AVAILABLE',$product-&gt;product_name),'notice'); continue; } if($product-&gt;product_quantity!=-1 &amp;&amp; $product-&gt;product_quantity &lt; $product-&gt;cart_product_quantity){ $notUsable[$product-&gt;cart_product_id]=0; $app-&gt;enqueueMessage(JText::sprintf('NOT_ENOUGH_STOCK_FOR_PRODUCT',$product-&gt;product_name),'notice'); continue; } if($product-&gt;product_sale_start&gt;time()){ $notUsable[$product-&gt;cart_product_id]=0; $app-&gt;enqueueMessage(JText::sprintf('PRODUCT_NOT_YET_ON_SALE',$product-&gt;product_name),'notice'); continue; } if(!empty($product-&gt;product_sale_end) &amp;&amp; $product-&gt;product_sale_end&lt;time()){ $notUsable[$product-&gt;cart_product_id]=0; $app-&gt;enqueueMessage(JText::sprintf('PRODUCT_NOT_SOLD_ANYMORE',$product-&gt;product_name),'notice'); continue; } } } $cart-&gt;products = array_reverse($cart-&gt;products); } if(!empty($notUsable)){ //if we need to remove products from the cart do so and then reload the cart $this-&gt;update($notUsable,1,0,'item'); return $this-&gt;loadFullCart($additionalInfos); } foreach($cart-&gt;products as $k =&gt; $row){ //we unset the cart coupon and modified date in order to avoid the auto load hash on the products to be different if only the coupon of the cart changed unset($cart-&gt;products[$k]-&gt;cart_modified); unset($cart-&gt;products[$k]-&gt;cart_coupon); $currencyClass-&gt;calculateProductPriceForQuantity($cart-&gt;products[$k]); } $currencyClass-&gt;calculateTotal($cart-&gt;products,$cart-&gt;total,$currency_id); $cart-&gt;full_total=&amp;$cart-&gt;total; JPluginHelper::importPlugin('hikashop'); JPluginHelper::importPlugin('hikashoppayment'); JPluginHelper::importPlugin('hikashopshipping'); $dispatcher = JDispatcher::getInstance(); $dispatcher-&gt;trigger('onAfterCartProductsLoad', array( &amp;$cart ) ); if(!empty($cart-&gt;additional)) { $currencyClass-&gt;addAdditionals($cart-&gt;additional, $cart-&gt;additional_total, $cart-&gt;full_total, $currency_id); $cart-&gt;full_total =&amp; $cart-&gt;additional_total; } if(!empty($this-&gt;cart-&gt;cart_coupon) &amp;&amp; $cart-&gt;cart_type != 'wishlist'){ $discount=hikashop_get('class.discount'); $discountData = $discount-&gt;load($this-&gt;cart-&gt;cart_coupon); if(@$discountData-&gt;discount_auto_load){ $current_auto_coupon_key = sha1($zone_id.'_'.serialize($cart-&gt;products).'_'.hikashop_loadUser()); $previous_auto_coupon_key = $app-&gt;getUserState( HIKASHOP_COMPONENT.'.auto_coupon_key'); if($current_auto_coupon_key!=$previous_auto_coupon_key){ $this-&gt;cart-&gt;cart_coupon=''; } } } if(hikashop_level(1) &amp;&amp; empty($this-&gt;cart-&gt;cart_coupon) &amp;&amp; $cart-&gt;cart_type != 'wishlist'){ $filters = array('discount_type=\'coupon\'','discount_published=1','discount_auto_load=1'); hikashop_addACLFilters($filters,'discount_access'); $query = 'SELECT * FROM '.hikashop_table('discount').' WHERE '.implode(' AND ',$filters).' ORDER BY discount_minimum_order DESC, discount_minimum_products DESC'; $this-&gt;database-&gt;setQuery($query); $coupons = $this-&gt;database-&gt;loadObjectList(); if(!empty($coupons)){ $discount = hikashop_get('class.discount'); $zoneClass = hikashop_get('class.zone'); $zones = $zoneClass-&gt;getZoneParents($zone_id); foreach($coupons as $coupon){ $result = $discount-&gt;check($coupon,$cart-&gt;total,$zones,$cart-&gt;products,false); if($result){ //if we found a coupon to auto load add the coupon to the cart and reload the cart $auto_coupon_key = sha1($zone_id.'_'.serialize($cart-&gt;products).'_'.hikashop_loadUser()); $app-&gt;setUserState( HIKASHOP_COMPONENT.'.auto_coupon_key',$auto_coupon_key); $app-&gt;setUserState( HIKASHOP_COMPONENT.'.coupon_code',''); $this-&gt;update($coupon-&gt;discount_code,1,0,'coupon',true); if(empty($this-&gt;cart)) $this-&gt;cart= new stdClass(); $this-&gt;cart-&gt;cart_coupon = $coupon-&gt;discount_code; static $done = false; if($done == false){ $done = true; return $this-&gt;loadFullCart($additionalInfos); } } } } } if(!empty($this-&gt;cart-&gt;cart_coupon) &amp;&amp; $cart-&gt;cart_type != 'wishlist') { $zoneClass = hikashop_get('class.zone'); $zones = $zoneClass-&gt;getZoneParents($zone_id); $cart-&gt;coupon = $discount-&gt;loadAndCheck($this-&gt;cart-&gt;cart_coupon, $cart-&gt;full_total, $zones, $cart-&gt;products, true); if(empty($cart-&gt;coupon)) { if(!empty($this-&gt;cart)) $this-&gt;cart-&gt;cart_coupon = ''; } else { $cart-&gt;full_total = &amp;$cart-&gt;coupon-&gt;total; } } if(bccomp($cart-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax, 0, 5) &lt;= 0) { $cart-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax = 0; $cart-&gt;full_total-&gt;prices[0]-&gt;price_value = 0; if(isset($cart-&gt;full_total-&gt;prices[0]-&gt;taxes)) unset($cart-&gt;full_total-&gt;prices[0]-&gt;taxes); } $shipping_id = $app-&gt;getUserState(HIKASHOP_COMPONENT.'.shipping_id'); if(!empty($shipping_id)) { $cart-&gt;shipping = $app-&gt;getUserState(HIKASHOP_COMPONENT.'.shipping_data'); if(!empty($cart-&gt;shipping)) { if(!is_array($cart-&gt;shipping)){ $cart-&gt;shipping = array($cart-&gt;shipping); }else{ //make sure that there are no shipping methods entered twice in the selected shipping data. $shippings = array(); foreach($cart-&gt;shipping as $method){ $group_key = $method-&gt;shipping_id; if(!empty($method-&gt;shipping_warehouse_id)){ $group_key .= '_'; if(is_array($method-&gt;shipping_warehouse_id)){ foreach($method-&gt;shipping_warehouse_id as $key =&gt; $val){ $group_key .= $key.$val; } }else{ $group_key .= $method-&gt;shipping_warehouse_id; } } $shippings[$group_key]=$method; } $cart-&gt;shipping = array_values($shippings); } $currencyClass = hikashop_get('class.currency'); $shipping =&amp; $cart-&gt;shipping; $currencyClass-&gt;processShippings($shipping,$cart); //calculate total price with shipping $cart-&gt;full_total =&amp; $currencyClass-&gt;addShipping($cart-&gt;shipping, $cart-&gt;full_total); } } $before_additional = !empty($cart-&gt;additional); $dispatcher-&gt;trigger('onAfterCartShippingLoad', array( &amp;$cart ) ); if(!$before_additional &amp;&amp; !empty($cart-&gt;additional)) { $currencyClass-&gt;addAdditionals($cart-&gt;additional, $cart-&gt;additional_total, $cart-&gt;full_total, $currency_id); $cart-&gt;full_total =&amp; $cart-&gt;additional_total; } if(bccomp($cart-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax,0,5)&lt;=0){ $cart-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax = 0; $cart-&gt;full_total-&gt;prices[0]-&gt;price_value = 0; if(isset($cart-&gt;full_total-&gt;prices[0]-&gt;taxes)) unset($cart-&gt;full_total-&gt;prices[0]-&gt;taxes); } $payment_id = $app-&gt;getUserState( HIKASHOP_COMPONENT.'.payment_id'); if(!empty($payment_id)){ $cart-&gt;payment = $app-&gt;getUserState( HIKASHOP_COMPONENT.'.payment_data'); if(!empty($cart-&gt;payment)){ $currencyClass = hikashop_get('class.currency'); $payment =&amp; $cart-&gt;payment; $payments = array(&amp;$payment); $currencyClass-&gt;processPayments($payments); //calculate total price with payment $currencyClass-&gt;addPayment($cart-&gt;payment,$cart-&gt;full_total); $cart-&gt;full_total=&amp;$cart-&gt;payment-&gt;total; } } } if($additionalInfos){ $app = JFactory::getApplication(); $shipping_address=$app-&gt;getUserState( HIKASHOP_COMPONENT.'.shipping_address',0); if(!empty($shipping_address)){ $this-&gt;loadAddress($cart,$shipping_address); } $billing_address=$app-&gt;getUserState( HIKASHOP_COMPONENT.'.billing_address',0); if($billing_address==$shipping_address){ $cart-&gt;billing_address =&amp; $cart-&gt;shipping_address; }else{ if(!empty($billing_address)){ $this-&gt;loadAddress($cart,$billing_address,'parent','billing'); } } $this-&gt;calculateWeightAndVolume($cart); } return $cart; }

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

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

Less More

- Posts: 122
- Thank you received: 0
-
-

12 years 5 months ago [\#158461](#158461) by [optimized](/forum/user/31311-optimized "View optimized's Profile")  Replied by *[optimized](/forum/user/31311-optimized "View optimized's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#158461 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

Hi Xavier,

Thanks very much for this.

However, I cannot find the string loadFullCart() to replace it in cart.php.

Please advise.

Regards,

Mike

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg2ODI2NC1kaXNjb3VudC1iZWluZy1hcHBsaWVkLXRvLWluZGl2aWR1YWwtcHJvZHVjdHM/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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

12 years 5 months ago [\#158898](#158898) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#158898 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

Please do that modification and it should fix the problem:
[ www.hikashop.com/forum/product-category-...orrectly.html#158811](http://www.hikashop.com/forum/product-category-display/868651-discounts-not-calculating-correctly.html#158811)

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

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

Less More

- Posts: 122
- Thank you received: 0
-
-

12 years 5 months ago [\#158977](#158977) by [optimized](/forum/user/31311-optimized "View optimized's Profile")  Replied by *[optimized](/forum/user/31311-optimized "View optimized's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#158977 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

Hello Nicolas,

I installed the fix but the discounts re still not working properly at [ starsupplyalliance.com/](http://starsupplyalliance.com/) (see attached screenshot for coupon levels.

For example,

- there is no discount applied for sales between $300 and $600
- an incorrect discount of 10% is applied between sales of $600- $1000

Mohamed Thelji has staed in this thread that
'I think that you should also set a "Maximum order value" for your coupons like 599.99 for your 5% coupon. ' which is still not possible after the patch.

Please advise on how to make these calculations work.

Regards,

Mike

- [ ![hbafeb38.png](/forum/attachment/17681) ](/forum/attachment/17681 "hbafeb38.png") [ ](/forum/attachment/17681?download=1 "hbafeb38.png")

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

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

Less More

- Posts: 122
- Thank you received: 0
-
-

12 years 5 months ago [\#159704](#159704) by [optimized](/forum/user/31311-optimized "View optimized's Profile")  Replied by *[optimized](/forum/user/31311-optimized "View optimized's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#159704 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

Hi guys,

Is there any movement on this issue?

Thanks,

Mike

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg2ODI2NC1kaXNjb3VudC1iZWluZy1hcHBsaWVkLXRvLWluZGl2aWR1YWwtcHJvZHVjdHM/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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

12 years 5 months ago [\#159759](#159759) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#159759 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

Hi,

Sorry for the delay.
We've add to apply multiple patches to fix that.
Replace the files discount.php and cart.php in the folder administrator/components/com_hikashop/classes with the ones in this archive and that should solve definitely the issue:
*This attachment is hidden for guests.
Please log in or register to see it.*

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

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

Less More

- Posts: 122
- Thank you received: 0
-
-

12 years 5 months ago [\#159833](#159833) by [optimized](/forum/user/31311-optimized "View optimized's Profile")  Replied by *[optimized](/forum/user/31311-optimized "View optimized's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#159833 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

Hi Nicolas,

Thanks for this - it is looking much better.

The only problem we have now is that the doscount is being applied to the post tax price rather than the pre-tax which is what we need - how do we use the pre-tax value?

Regards,

Mike

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg2ODI2NC1kaXNjb3VudC1iZWluZy1hcHBsaWVkLXRvLWluZGl2aWR1YWwtcHJvZHVjdHM/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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

12 years 5 months ago [\#159881](#159881) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#159881 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

You have the option "Apply discounts" of the configuration if you want to change that.

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

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

Less More

- Posts: 122
- Thank you received: 0
-
-

12 years 5 months ago [\#159992](#159992) by [optimized](/forum/user/31311-optimized "View optimized's Profile")  Replied by *[optimized](/forum/user/31311-optimized "View optimized's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#159992 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

Hi Nicolas,

Your responses are normally very clear but I don't understand this one.

I want to change the calculation so that the discount is applied to the pre-tax amount.

Where in the configuration do I set this up?

Thanks,

Mike

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2NoZWNrb3V0Lzg2ODI2NC1kaXNjb3VudC1iZWluZy1hcHBsaWVkLXRvLWluZGl2aWR1YWwtcHJvZHVjdHM/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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

12 years 5 months ago [\#159997](#159997) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#159997 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

Hi,

I don't see where my answer was not clear ?
Toggle the "Apply discounts" option of the configuration and that will do it:
[ take.ms/bwuZU](http://take.ms/bwuZU)

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

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

Less More

- Posts: 122
- Thank you received: 0
-
-

12 years 5 months ago [\#160126](#160126) by [optimized](/forum/user/31311-optimized "View optimized's Profile")  Replied by *[optimized](/forum/user/31311-optimized "View optimized's Profile")* on topic *[Discount being applied to individual products](/forum/27-checkout/868264-discount-being-applied-to-individual-products#160126 "-- url of the page with the problem -- : starsupplyalliance.com -- HikaShop version -- : 2.3.1 -- Joomla version -- : 3.2 -- PHP version -- : 5.4 -- Browser(s) name and version -- : XXXXX x.x.x -- Error-message(debug-mod must be tuned on) -- : Error&#95;message  I need the discount to be applied to the total purchase amount not the individual products purchased. I have used the Orders / Discounts /Coupons set up as advised and I attach a screen shot of one of the coupons.  How do I get the coupon to reflect the total amount in the cart?  Many thanks,  Mike")*

Hi Nicolas,

I was looking everywhere bar the obvious place!

As you can see from the first attachment, the tax/discount is set up as you recommended but as you can see from screenshot 2 the discount is being applied on the post tax amount.

Regards,

Mike

- [ ![h9bfeeb1.png](/forum/attachment/17877) ](/forum/attachment/17877 "h9bfeeb1.png") [ ](/forum/attachment/17877?download=1 "h9bfeeb1.png")
- [ ![hdcd0e10&#95;2014-06-13.png](/forum/attachment/17878) ](/forum/attachment/17878 "...2014-06-13.png") [ ](/forum/attachment/17878?download=1 "...2014-06-13.png")

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

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