- This topic has 6 replies, 3 voices, and was last updated 13 years, 7 months ago by .
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › Adding a less than condition
Hi, definitely liking the product a lot so far, but was having a little difficulty with the coupon conditions. On my site, my users receive a coupon after they buy a product through an affiliate link so I want to give a 100% discount on products from my store up to a certain value. Right now the user has to select exactly $250 dollars for example if they have a $250 coupon. I was wondering if there is a way that I could add some code to make the condition less than or equal to the coupon amount. Thanks in advance!
Yeah you should be able to tweak this. Which condition are you using 1 or 2?
1) Total amount -> is equal to -> some amount
2) SubTotal amount -> is equal to -> some amount
I’ve been using total amount, #1
Open the “eStore_discount_calc.php” file and search for the following:
if ($total == $ret_coupon->value)
Once you find it change it to the following:
if ($total <= $ret_coupon->value)
There will be two occurrences of the above so make sure to change them both.
That worked great, thanks a lot for your help!
So… This should work for my issue, to, I think…?
I’d like the ability to create a “not equal to” coupon… So, a discount would be good for everything except one product or category.
So, if could just change that condition to != right?
Now… Can I -add- standard conditions that will show on the pull down, so I can still use each?
Yes adding a “!=” will do what you are after but you need to read the code and find out which one is application to you. For example if you want to modify the following conditional coupons behavior:
Item ID => Is equal to => A product ID
Then you will have to modify the logic in the following function:
function eStore_handle_item_id_discount($ret_coupon)