Hello,
I am using OpenCart's PayPal Express Checkout module. When on the final confirmation page before submitting the order, there is a field to enter a coupon code. When you apply a coupon, the entire transaction is redirected to the shopping cart. You then have to login to PayPal again to get back to the confirmation page.
What edit can be made so that upon applying the coupon code, the user stays on the same page and doesn't have to repeat the checkout process?
Thank you!
The strange thing is, that there seems to be code to handle the coupon on the PayPal Express Checkout page.
https://github.com/opencart/opencart/bl ... #L358-L365
However, the coupon template has the POST URL hardcoded the the standard coupon controller.
https://github.com/opencart/opencart/bl ... n.twig#L16
You would have to change the POST URL to the PayPal Express Checkout page, but only for PayPal Express payment methods. Or add your own controller and template just for PayPal Express.
A different method may be to change the redirect in the coupon controller to redirect to the PayPal Express Checkout page, but again only for PayPal Express payment methods.
https://github.com/opencart/opencart/bl ... on.php#L41
https://github.com/opencart/opencart/bl ... #L358-L365
However, the coupon template has the POST URL hardcoded the the standard coupon controller.
https://github.com/opencart/opencart/bl ... n.twig#L16
You would have to change the POST URL to the PayPal Express Checkout page, but only for PayPal Express payment methods. Or add your own controller and template just for PayPal Express.
A different method may be to change the redirect in the coupon controller to redirect to the PayPal Express Checkout page, but again only for PayPal Express payment methods.
https://github.com/opencart/opencart/bl ... on.php#L41
Hello ADD Creative,ADD Creative wrote: ↑Wed Nov 14, 2018 7:54 pmThe strange thing is, that there seems to be code to handle the coupon on the PayPal Express Checkout page.
https://github.com/opencart/opencart/bl ... #L358-L365
However, the coupon template has the POST URL hardcoded the the standard coupon controller.
https://github.com/opencart/opencart/bl ... n.twig#L16
You would have to change the POST URL to the PayPal Express Checkout page, but only for PayPal Express payment methods. Or add your own controller and template just for PayPal Express.
A different method may be to change the redirect in the coupon controller to redirect to the PayPal Express Checkout page, but again only for PayPal Express payment methods.
https://github.com/opencart/opencart/bl ... on.php#L41
Thank you for this, it was very helpful and you identified the cause of this issue.
Which of the modifications you suggested do you think is the best option, and what is the exact modification should be performed? I appreciate it.
I think the best option would be to add a new controller and template, based on catalog/controller/extension/total/coupon.php and catalog/view/theme/default/template/extension/total/coupon.twig. Renaming the relevant parts such as the class name, redirect URL and POST URL.
Then changing the coupon controller in PayPal Express to your new one.
https://github.com/opencart/opencart/bl ... s.php#L721
Then changing the coupon controller in PayPal Express to your new one.
https://github.com/opencart/opencart/bl ... s.php#L721
I've made a extension with the changes, tested on 3.0.2.0. Undo any changes you have made and upload the file with the extension installer. Then refresh both the modifications cache (Extensions->Modifications->Refresh) and the template cache (blue button top right of dashboard).
Thank you for putting this together, that will really help users on 3.0.2.0. However, I should have mentioned before (my mistake!), the store in this case is on 2.3.0.2 and is using the Journal theme. The code is essentially the same and hasn't changed much, so I tried to do the few necessary changes to adapt your modification for this store. Unfortunately, I still can't seem to get it to work. Thank you again!ADD Creative wrote: ↑Fri Nov 16, 2018 11:53 pmI've made a extension with the changes, tested on 3.0.2.0. Undo any changes you have made and upload the file with the extension installer. Then refresh both the modifications cache (Extensions->Modifications->Refresh) and the template cache (blue button top right of dashboard).
You did post in the section of the forums for version 3. I've modified for version 2.3. Please fully test as I have only quickly tested.
Yes, I see that now, my mistake.ADD Creative wrote: ↑Sat Nov 17, 2018 6:52 amYou did post in the section of the forums for version 3. I've modified for version 2.3. Please fully test as I have only quickly tested.
The great news is that your extension is working great! Thank you for this, I really appreciate it.
Do you know how a coupon can be removed once it is applied, as I did not see how to do this?
Thank you.
I could be wrong, but I don't think you can, other than maybe removing cart contents or logging out.
Who is online
Users browsing this forum: No registered users and 23 guests