Post by TheIceMan » Tue Apr 01, 2008 6:19 pm

how can i make opencart give a 10% discount is the subtotal of a order is let say over 150 $ ? thx

Newbie

Posts

Joined
Sun Jan 20, 2008 1:57 am

Post by sakathecheetah » Fri Jul 04, 2008 1:39 pm

I'm not really sure exactly where to change, but I can tell you this would definitely require a decent amount of code changes to be properly displayed to the user, since the subtotal is used throughout the checkout process and you probably want a conditional strikeout or something. Since you probably don't want the 10% off to be permanent (reverse tax?  :D), I don't recommend changing lots of core files for a single promotion.

You can give 10% off a range of products using the coupon functionality, but not based on subtotal.

If I were to do this, I would probably modify the coupon code process to allow for a minimum effective value. I've seen a field for minimum subtotal in other carts for coupons, so maybe this could be in a future version of OC as well (hint: suggest it in feature requests!). To implement this option requires changing the admin template to add the form field, adding necessary code to admin controllers and template, making an entry for it manually in your mysql database, and adding an if statement to test that the subtotal is more than the value, processing checkout accordingly.... or something along those lines. Then just publicise the coupon somewhere in your template to make sure people use it (if they can't read, it's no loss to you, right?).

There might be an easier way to do this as a temporary mod without affecting lots of files; I've only been looking at the code for two days, so hopefully someone has a shorter suggestion?

New member

Posts

Joined
Wed Jul 02, 2008 8:50 am
Who is online

Users browsing this forum: No registered users and 1 guest