Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore Tweaks › Adding a less than condition
- This topic has 6 replies, 3 voices, and was last updated 14 years, 7 months ago by
amin007.
-
AuthorPosts
-
February 11, 2011 at 9:17 pm #2696
jetsetpeasant
MemberHi, 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!
February 12, 2011 at 5:27 am #28951amin007
ParticipantYeah 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
February 16, 2011 at 12:53 am #28952jetsetpeasant
MemberI’ve been using total amount, #1
February 16, 2011 at 4:12 am #28953amin007
ParticipantOpen 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.
February 21, 2011 at 3:42 am #28954jetsetpeasant
MemberThat worked great, thanks a lot for your help!
April 3, 2011 at 3:13 am #28955Ravensteed
MemberSo… 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?
April 4, 2011 at 12:23 am #28956amin007
ParticipantYes 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 IDThen you will have to modify the logic in the following function:
function eStore_handle_item_id_discount($ret_coupon) -
AuthorPosts
- You must be logged in to reply to this topic.