Discount Codes
how to limit discount code only to 1 order - Discount Codes
how to limit discount code only to 1 order
Hi All
i installed the discount coupon addon and i made a new coupong:
discount: 50
minium order sub: empty
expire: empty
number of use: 1
number of products to apply (it's gray anyway) but empty
applies only to order N: 0 (standard)
applies to "order Sub total"
and i thought, if used 1 time from a customer, the coupon is not valid anymore, but i can made as many orders i want and use the coupon on every order. what i do wrong?
in the admin interface i see "total orders: 4" so it counts the orders made with the coupon, but don't stop from using it...
thank you in advance for the help
i installed the discount coupon addon and i made a new coupong:
discount: 50
minium order sub: empty
expire: empty
number of use: 1
number of products to apply (it's gray anyway) but empty
applies only to order N: 0 (standard)
applies to "order Sub total"
and i thought, if used 1 time from a customer, the coupon is not valid anymore, but i can made as many orders i want and use the coupon on every order. what i do wrong?
in the admin interface i see "total orders: 4" so it counts the orders made with the coupon, but don't stop from using it...
thank you in advance for the help
-
loop
- Contributor
- Posts: 253
- Joined: Thu Mar 25, 2021 12:26 pm
- Phoenix Version:
- Contact:
Re: how to limit discount code only to 1 order
i found out the number_of_use check (in ot_discount.php) is together with the customers_id:
SELECT count(*) AS total, number_of_use
FROM discount_codes
WHERE discount_codes = '%s'
AND customers_id = '%s'
LIMIT 1
that means, if i have a coupon with number of use 1 and NO customers_id selected, everybody can user the discount_code so many times they want. is that the idea?
SELECT count(*) AS total, number_of_use
FROM discount_codes
WHERE discount_codes = '%s'
AND customers_id = '%s'
LIMIT 1
that means, if i have a coupon with number of use 1 and NO customers_id selected, everybody can user the discount_code so many times they want. is that the idea?
-
loop
- Contributor
- Posts: 253
- Joined: Thu Mar 25, 2021 12:26 pm
- Phoenix Version:
- Contact:
Re: how to limit discount code only to 1 order
In Admin: Discount codes:
Number of Use:
For one customer, empty is unlimited
In Admin: Modules: Content: Discount Codes[shopping_cart]:
Show discount input to guests
Do you want to let enter discount codes to guests? False
Number of Use:
For one customer, empty is unlimited
In Admin: Modules: Content: Discount Codes[shopping_cart]:
Show discount input to guests
Do you want to let enter discount codes to guests? False
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
-
raiwa
- Certified Developer
- Posts: 1640
- Joined: Sat Dec 21, 2019 8:08 am
- Phoenix Version: 1.1.0.6
- : Buy Me A Beverage
- Contact:
Re: how to limit discount code only to 1 order
May i ask again, because i'm not sure:
if i want that 1 coupon code is only used once (doesn't matther which customer for me, and doesn't matther if it's guestaccount or not) only important that it can only used once.
the setting is "number of use : 1" and disable guest = false?
i'm not sure about this setting, as i want that guest account can use it....thank you for clarifying...
and one thing: i rewrote the view.php to use jquery to fillout the select boxes, as i have so many products / manufacturers, the page was loading linke 10 seconds until i saw it. now it's very fast. If you are interested in my modification, i can share it with you, maybe you can use it, or take the idea out of it....let me know
Philipp
if i want that 1 coupon code is only used once (doesn't matther which customer for me, and doesn't matther if it's guestaccount or not) only important that it can only used once.
the setting is "number of use : 1" and disable guest = false?
i'm not sure about this setting, as i want that guest account can use it....thank you for clarifying...
and one thing: i rewrote the view.php to use jquery to fillout the select boxes, as i have so many products / manufacturers, the page was loading linke 10 seconds until i saw it. now it's very fast. If you are interested in my modification, i can share it with you, maybe you can use it, or take the idea out of it....let me know
Philipp
-
loop
- Contributor
- Posts: 253
- Joined: Thu Mar 25, 2021 12:26 pm
- Phoenix Version:
- Contact:
Re: how to limit discount code only to 1 order
This is not implemented and I can't imagine the case where it is useful. But if you need it, you can modify the code and remove the customer_id check.loop wrote:May i ask again, because i'm not sure:
if i want that 1 coupon code is only used once (doesn't matther which customer for me, and doesn't matther if it's guestaccount or not) only important that it can only used once.
the setting is "number of use : 1" and disable guest = false?
Thank you, but I'm not interested to add jquery scripts. You can post your solution here for other users.and one thing: i rewrote the view.php to use jquery to fillout the select boxes, as i have so many products / manufacturers, the page was loading linke 10 seconds until i saw it. now it's very fast. If you are interested in my modification, i can share it with you, maybe you can use it, or take the idea out of it....let me know
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
-
raiwa
- Certified Developer
- Posts: 1640
- Joined: Sat Dec 21, 2019 8:08 am
- Phoenix Version: 1.1.0.6
- : Buy Me A Beverage
- Contact:
Re: how to limit discount code only to 1 order
hi raiwa, thank you. maybe i don't get the idea of discount coupon. I use it also for a return product or giftcard, so i give a customer a discount coupon with worth 100 CHF which he can spend, but i don't want that he can spend the voucher 10 times.
is that not the normal use case? or at least a common usecase?
is that not the normal use case? or at least a common usecase?
-
loop
- Contributor
- Posts: 253
- Joined: Thu Mar 25, 2021 12:26 pm
- Phoenix Version:
- Contact:
Re: how to limit discount code only to 1 order
For this case your customer must login so the customer id can be checked. I don't see the sense to allow using the discount for a guest/not logged in customer.
Or you can manually disable the discount code once it has been used.
Or you can manually disable the discount code once it has been used.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
-
raiwa
- Certified Developer
- Posts: 1640
- Joined: Sat Dec 21, 2019 8:08 am
- Phoenix Version: 1.1.0.6
- : Buy Me A Beverage
- Contact:
Re: how to limit discount code only to 1 order
Maybe i really don't get the point. I don't want that a "not logged in" customer can use the discount coupon. You are right, that does not make sense.
What i want is, that wenn i write "number of use = 1" that the coupon code can only used once. and at this point i think the only solution is to make numbe of use = 1 and limit to a specific customers_id in the discount coupon admin. But if you forget to limit this ot a specific customers_id, every customer can use the code as many times they want. and i think that's not the idea
so if you forget to limit to customers_id the "number of use" has no meaning to the script
What i want is, that wenn i write "number of use = 1" that the coupon code can only used once. and at this point i think the only solution is to make numbe of use = 1 and limit to a specific customers_id in the discount coupon admin. But if you forget to limit this ot a specific customers_id, every customer can use the code as many times they want. and i think that's not the idea
so if you forget to limit to customers_id the "number of use" has no meaning to the script
-
loop
- Contributor
- Posts: 253
- Joined: Thu Mar 25, 2021 12:26 pm
- Phoenix Version:
- Contact:
Re: how to limit discount code only to 1 order
It has, because one and the same customer can only use it once.
Public Phoenix Change Log Cheat Set on Google Sheets
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
https://docs.google.com/spreadsheets/d/ ... sp=sharing
Need Help?viewtopic.php?f=10&t=27
-
raiwa
- Certified Developer
- Posts: 1640
- Joined: Sat Dec 21, 2019 8:08 am
- Phoenix Version: 1.1.0.6
- : Buy Me A Beverage
- Contact:
Re: how to limit discount code only to 1 order
I think I have a similar question as asked above, but I was hoping for some clarification. In the previous versions of Discount Code (5.6.2), it seemed to be able to allow every customer (new or existing) to use a single discount code (ex. NEWCUST) once. This single use code was handy as a "new" customer code that would encourage them to purchase more items during this specific order since they wouldn't be able to use the code again. With the current version (5.8.3) it appears the "Number of Use" limits the total amount of times the code can be used, unless the customers are selected. The problem with that is I can't limit the discount code to Number of Uses when a new customer signs up. I can only limit the code count to selected existing customer. Reading above it appears the answer is to remove the customer_id check. Can you be a little more specific as the check customer_id seems to run from line 66 through 99. I appreciate the amount of time that's been spent coding this module and please understand I'm a small business manager, not professional coder.
- Cary
- Cary
- Member
- Posts: 34
- Joined: Fri Mar 12, 2021 9:36 pm
- Phoenix Version: v1.0.9.1
- Contact: