Post by Qphoria » Thu Apr 14, 2011 4:27 am

Here's a quick vQmod script for preventing coupons from applying to products that are on special

If you have 2 products:
Hat - 20.00
Shirt - special for 15.00

Coupon for 50% off would normally give a total of:

20.00 * .50 = 10.00
15.00 * .50 = 7.50
Total: 17.50

This mod will ignore the products that are on special from getting the additional discount:
20.00 * .50 = 10.00
15.00 (special ignored) = 15.00
Total: 25.00

Attachments

for both 1.4.x and 1.5.x


Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by marvmen21 » Sat Apr 16, 2011 1:26 am

Great! I needed this badly! Thanks Q.

You want to thank me for my time! :) Click here to donate


Active Member

Posts

Joined
Tue Nov 09, 2010 4:54 am

Post by COMPACTER » Fri May 06, 2011 9:31 pm

Just curious where does this get applied to? where do i go to input this mod?

ImageCDM Sales & Services. "Get Connected to What Matters!"


Active Member

Posts

Joined
Sat Dec 05, 2009 1:02 am
Location - bolton, on

Post by COMPACTER » Fri May 06, 2011 9:57 pm

COMPACTER wrote:Just curious where does this get applied to? where do i go to input this mod?


Never mind i figured it out, works great thanks

ImageCDM Sales & Services. "Get Connected to What Matters!"


Active Member

Posts

Joined
Sat Dec 05, 2009 1:02 am
Location - bolton, on

Post by opencartisalright » Sat Jun 04, 2011 7:09 pm

Any chance this will be updated to work with OC 1.5?

Active Member

Posts

Joined
Mon Feb 21, 2011 4:09 am

Post by Qphoria » Wed Sep 14, 2011 2:16 am

Updated file in first post for 1.5.x support
Same file works on both 1.4.x and 1.5.x

User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Lao » Thu Sep 15, 2011 8:32 pm

Just tried this vQmod. It said "Coupon applied succesful", although its' shown value was zero at checkout. Any solution to display "Coupons are not eligible for special products"?

I'm using Open Cart 1.5.4.1 on http://www.importpieseauto.ro


User avatar
Lao
Active Member

Posts

Joined
Tue Nov 23, 2010 3:31 pm
Location - Craiova, Romania

Post by Qphoria » Thu Sep 15, 2011 8:51 pm

This is just how it works.. It prevents the coupon discount from applying to products on special. It doesn't prevent coupons from being entered tho. If you had 2 items in your cart, and one was on special, it would only apply the coupon to the non-special item.

Image
Donate!|OpenCart Basics|GeoZones
Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Lao » Thu Sep 15, 2011 9:02 pm

Oh, didn't try it with 2 products. That's good though.

Thank you!

I'm using Open Cart 1.5.4.1 on http://www.importpieseauto.ro


User avatar
Lao
Active Member

Posts

Joined
Tue Nov 23, 2010 3:31 pm
Location - Craiova, Romania

Post by terrier » Sun Sep 18, 2011 5:13 pm

This mod works great however I like to suggest a pop-up or remarks to inform customer that special items are not eligible for coupon discount.

Is that possible?

New member

Posts

Joined
Wed Aug 31, 2011 7:05 pm

Post by anti91 » Tue Jan 03, 2012 8:30 am

EXCELLENT !!!! THANKS

New member

Posts

Joined
Tue Aug 30, 2011 8:27 am

Post by jimaras » Wed Jan 04, 2012 3:35 am

Thank you!

http://e-kreopoleio.com/


Active Member

Posts

Joined
Thu Sep 15, 2011 1:45 am

Post by labeshops » Wed Jan 04, 2012 9:11 am

Thank you! Can check something else off my "need to fix" list!

Running Opencart v2.2 with multi-stores from http://www.labeshops.com which has links to all my stores.

Image


User avatar
Expert Member

Posts

Joined
Thu Aug 04, 2011 4:41 am
Location - Florida, USA

Post by Angelheart29 » Wed Jan 25, 2012 8:32 am

Thx for this Vqmod. Works likes a charm !

Is there a possibility to use or modify the file for Voucher ?

Newbie

Posts

Joined
Fri Jan 06, 2012 5:12 am

Post by Klimskady » Thu Jan 26, 2012 7:51 pm

Angelheart29 wrote:Is there a possibility to use or modify the file for Voucher ?
I know that if someone had bought me a gift voucher to a website and then when I went to use it on a product I couldn't as it was already on sale would disappoint me, stopping an already discounted item from being discounted further is one thing but this seems to be penalising your customers for buying and using a gift voucher from you instead of using cash...

Just my opinion from the side of a customer as well as a eCommerce website owner.

Active Member

Posts

Joined
Tue Jun 07, 2011 7:57 am

Post by 2schaa » Wed May 23, 2012 5:00 pm

I tried with $5.00 discount with one special product it shows coupon = $0.00

but

when I tried with 2 products 1 Special & 1 Regular the coupon set discount of $5.00 is showing less actually, it showed $4.38

Any idea why it is not showing the right amount as per coupon.


Thanks

Newbie

Posts

Joined
Mon Apr 30, 2012 4:08 pm

Post by markdyer » Tue Oct 02, 2012 12:38 pm

The product is that this mod is not taking into account fixed/percentage correctly. When using a fixed discount the sub total also needs to exclude items that are on special.. I played around with the coupon system today and got it working but it requires more then this mod details.. correct me if I'm wrong.

Newbie

Posts

Joined
Tue Jan 31, 2012 10:50 am

Post by innuoluke » Thu Oct 11, 2012 6:25 pm

The mod does account for fixed / percentage correctly, it just depends on your definition of correctly!

There are two ways this COULD work, but obviously only 1 of those options can actually be applied (without a lot of headache and extra options in admin pages etc etc etc)...

NB: In the following examples I will use Prod 1 = $20.00, Prod 2 = $10.00, Basket total = $30.00

Method 1: Fixed discounts could / should be deducted from the basket total, so a discount code for $10 is always $10
Method 2: Fixed discounts get deducted as a percentage per product

Example method 1: Basket total = $30 :: Discounted total = $20
Example method 2: Prod 1 discount = $6.6666, Prod 2 discount = $3.3333 :: Total discount = $9.9999 :: Discounted total = $30 - $9.9999 = $20.0001

I'm not quite sure why, but when the mod was written it was obviously decided that method 2 was the way to go.

As a result of this, when we apply the FREE vqmod above which skips products with special prices, the portion of discount that would have been applied to that product is no longer applied, so if Prod 1 was actually using a special price, the discount would get ignored and the basket total would become:

Prod 1 discount: *skipped*
Prod 2 discount: $3.3333
Total discount: $3.3333
Discounted total: $30 - $3.3333 = $26.6667

In order to get method 1 working, you would need to disable the "fixed rate" portion of the existing coupons code, then add some new code elsewhere which deducts the fixed rate discount from the final basket price (and adjusts taxes accordingly too).

[EDIT] As far as I can tell, it has been written this way so that a discount code cant cause a product to become a loss for the retailer, e.g. if I reduce the sale price of a product to my cost price (e.g. because I want to clear the stock) then I don't want someone to be able to get 10% off that price as this would mean they have bought the product from me for less than what I paid for it from my supplier!

Web developer for Cotswold Web Services / Innuo Ltd
Need help with your Opencart website? Give us a call to see how we can help.


Newbie

Posts

Joined
Sat Jun 18, 2011 4:36 pm

Post by adriannnn » Mon Dec 16, 2013 8:04 pm

OC 1.5.5.1

i have 2 products in cart
1. 189 (normal price)
2. 159 (special price from 189)

my coupon value is 100 (not percentage) . After applying the coupon it shows a discount of 54...
We don't have VAT or any kind of other taxes.

Why is the discount 54 and not 100?

Newbie

Posts

Joined
Wed Apr 10, 2013 11:30 pm

Post by adriannnn » Wed Jan 08, 2014 2:12 am

markdyer wrote:The product is that this mod is not taking into account fixed/percentage correctly. When using a fixed discount the sub total also needs to exclude items that are on special.. I played around with the coupon system today and got it working but it requires more then this mod details.. correct me if I'm wrong.
If you made it work, can you please help me, i can't do it myself.

Newbie

Posts

Joined
Wed Apr 10, 2013 11:30 pm
Who is online

Users browsing this forum: No registered users and 4 guests