-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gift voucher mails not sent automatically!! #3093
Comments
This was reported many times before. Daniel will just close and not listen as usual |
This would be very bad... Another issue with vouchers is, that every voucher can be used multiple times even if it is set to once per customer because they get deactived only if the order is set to complete! |
@cutzenfriend Are you saying that, until the order where the Voucher is used gets a status of Complete, the "balance" is not deducted from the voucher and it can be - meanwhile - reused for payment on another order? If so, wouldnt the consequent orders fail to complete once the original order is processed and Complete? |
@StockMaster Are you saying that, until the order where the Voucher is used gets a status of Complete, the "balance" is not deducted from the voucher and it can be - meanwhile - reused for payment on another order? This is exactly what happens. The complete amount of the voucher is usable multiple times until at least one order where the voucher was used is set to complete.... |
@cutzenfriend I am unsure if Daniel will read this. However if he does maybe this needs addressing, as per IF voucher used -> lock value untill complete. Fingers crossed we dont get closed without comment ;) |
The vouchers/coupons will be confirmed (subtracted) when the order reaches one of the selected Processing or Complete order statuses in the store settings under The call for this is in the Edit: Joel. |
@OpenCartAddons Understood however doesnt address the problem presented by cutzenfriend. If the same voucher can be used to initiate multiple orders, in effect its duplicating "value" untill ONE is complete. The question is what happens when the other orders try to get complete status? |
@StockMaster I see your point. The system will check to see if the voucher is valid during the A warning should be applied to the order or the order is set to a predefined order status to alert the administrator that the order may be fraudulent. This should apply to invalid coupons as well. |
@OpenCartAddons Exactly. Or a Voucher should be assigned a "in use" budget if used in another order, even if not fully commited to it. But we have here 2 different problems. |
I think I've found the issue. Based on the code, the voucher is only confirmed on line There should be an additional call made in the |
@OpenCartAddons I see you digging deeper than my knowladge would allow me. you dont seem to be able to pinpoint why - when a voucher is bought and payment confirmed for IT - the recipient never recieves the Email? pretty please? :D |
@StockMaster Try replacing line Replace This: With This: I believe the wrong |
@OpenCartAddons Would you then agree with me and @cutzenfriend that Theres bugs in the Voucher engine? be it the emission of the email confirmation to the Voucher Recipient and the Voucher order processing? Because i been trying to point this to Daniel for months now and all i get is.. Nothing! |
@StockMaster Yes, there was a bug in the code. I've submitted a pull request #3095 I just tested v2.0.3.1 and the gift voucher confirmation email is only sent if the previous order status was complete, when it should send when the current order status is complete. The wrong variable was used in the code for the order_status_id. Cheers, |
Wonderful! So if i got you right, if customer X buys Voucher addressed to [email protected] -> and the store owner makes said order as Complete, then Recipient will recieve an email saying "You got an voucher to spend" of sorts correct? Now we just need to fix the other error that was reported on the voucher utilization! :) NICE Job! thank you |
@StockMaster Correct. This functionality is already in OpenCart, it's just the wrong order_status_id was being used to determine whether the email was sent or not. Instead of looking at the new order_status_id, it was looking at the old order_status_id. You can get the emails to send for the time being by setting the order status to complete twice, or if the order status is already set to complete, just add another order history and mark it as complete again. I would recommend that you do not check the box to notify the customer when doing this as it will spam the customer who purchased the voucher with order update notifications. |
@OpenCartAddons as i suspected. |
You guys are awesome! @OpenCartAddons I will try to implement your fix #3095 manually tomorrow. I will give you feedback about this. Could you also address the other issue with the voucher? |
@cutzenfriend @StockMaster While it is technically possible to complete two orders using the same voucher, it would happen under extremely rare circumstances. From what I can tell by the code and doing some of my own testing, I found two scenarios where someone could possibly abuse this: Multiple Tabs Using Offsite Payment Pages (i.e. PayPal Standard) If Your Order Status Settings Are Not Setup Correctly The only way around this that I can think of is to create a special order status, and have the voucher confirm function return an error message if the voucher has already been used in another order. If the error message is detected, then the order is flagged and the order status is changed. This would at least give the administrator a heads up that something fishy is going on with the order and to double check everything. Joel. |
@OpenCartAddons That is a great indepth analisys which puts technical skilled words in what both me and @cutzenfriend suspected. Maybe with your feedback @danielkerr or @jamesallsup could have a look into this situation and a) push your commit into master asap, and b) optimize the way the vouchers are manipulated as per your second scenario. Once again thank you very much for the time you dedicated into this issue. Might not seem very relevant but is never the less a set of bugs and concerns that would make opencart more robust if addressed! Regards |
The gift voucher must be set to disabled automaticaly once it's applied no matter the order completed or not, if the order not completed the admin can reactivate the voucher if customer not complete the order and complain occured, this is the straight forward solution for the gift voucher problem i am facing in my issue #3067 |
@AshrafSello That's exactly what I thought! It has to be done this way. |
@AshrafSello @cutzenfriend This would add a lot of headaches for the store administrator. Every time a customer gets to the last step of the checkout, an order is created within OpenCart. This means that if the customer realizes that they made a mistake in their order and go back to correct it, their gift voucher is no longer valid and they have to contact the store administrator to fix it. In addition to that there is currently no way for the store administrator to remove history from a gift voucher. This means the store administrator would have to change the order history of the "missing" order to completed, then back to an order status that is no selected in the Processing or Completed order status list. This is what currently triggers the function to remove transaction history from the voucher. Disabling the gift voucher for incomplete orders is not the way to deal with this. It adds too many problems for both customers and store administrators. Joel. |
we can add a order status for orders to be looked at. if the coupon has already been used. |
At least set the gift voucher to disabled if the checkout operation has been done completely even if the order status still pending or processing or.......... Till completed, no need to wait to completed status, i checked that in th COD order the gift voucher did not set to disabled when the checkout operation completed. |
@AshrafSello This is an issue with your order status setup. Make sure that all the correct order statuses are selected for both Processing and Completed within the store settings
When the status of the order reaches any of the selected order statuses in the Processing or Complete list, then the coupon / voucher will be deducted. Also, you will want to ensure that all your payment gateways are setup to set the order to one of the selected order statuses once payment has been completed or the order is confirmed. Regards, |
Thank you @OpenCartAddons for the writeup. |
sorry closed and reopened as this needs a better fix |
Even if the orders Status are set correctly, the email won't be sent automatically in OC 2.0.1.1. It's good to fix it. |
i can fix it. i know the issue. |
this commit fixes the issue but i'm still going to move vouchers being sent to the events system |
How can I apply this email fix to 2.0.3.1 without upgrading OC to 2.1 ? |
OC 2.0.3.1 with latest patches
When a customer buys a Gift Voucher, and this order becomes complete in the back end an confirmation email is sent to buyer.
Everyone receives an email. admin - customer (so mail is working!)
However the gift voucher recipient never receives the email for this gift voucher, not on purchase, not on any Order state.
The admin\controller\sale\voucher.php has the correct mail functions, i just think it is never triggered.
In other words.
Customer buys voucher > checks out -> order containing voucher is pending/processing status
At this point voucher is added but wont WORK on checkout yet. No email should be sent to voucher recipient at this point. That's good and expected.
However...
Customer order that contains voucher payment is confirmed -> order status becomes Complete
At this point voucher becomes usable and validated. However no notification email is sent to voucher recipient.
Cant seem to find in the code where the complete status of the order updates the voucher AND triggers the notification email for the voucher recipient.
I will try to investigate further why.
If anyone one knows please help?
This ticket is reopened!
The text was updated successfully, but these errors were encountered: