Post by kanchan1995 » Thu Oct 21, 2021 6:16 pm

Based on this topic: viewtopic.php?f=20&t=28728#p141711

I am using opencart 3.0.3.3 and journal 3.1.8
and facing the same issue, I want to Remove the coupon that has been applied to the cart.

Please help with this, what changes need to do in the code?

Newbie

Posts

Joined
Tue Oct 19, 2021 2:57 pm

Post by Gergely » Thu Oct 21, 2021 7:50 pm

Hi kanchan1995,

This extension from the Marketplace, while not compatible with your version, could give you some ideas on how to implement such functionality. But you might find that your choice of theme makes this a lot more difficult...

But if you can't find an extension, can't implement this feature yourself, and don't want to commission a developer to do this for you, here's a workaround that should work with your theme as well:
  1. Create a new coupon called "Remove Coupons", and code "NOCOUPON" (or whatever you prefer that carries a similar semantic load...)
  2. Set it up as such (as on the picture):
    Type: Percentage
    Discount: 0
    Total Amount: 0
    Customer Login: No
    Free Shipping: No
    Products: N/A
    Category: N/A
    Date Start: Today
    Date End: N/A (or far in the future if for some reason your setup couldn'tvalidate the date)
    Uses Per Coupon: N/A
    Uses Per Customer: N/A
    Status: Enabled
  3. Modify your Success, coupon applied! message by adding: "Use coupon code: NOCOUPON to remove applied coupons!" in the Language Editor (api/coupon -> text_success)
I hope this helps!
Gergely

Attachments

Remove_Coupons.PNG

Remove_Coupons.PNG (53.34 KiB) Viewed 895 times


Active Member

Posts

Joined
Wed Sep 30, 2020 7:58 pm

Post by Johnathan » Thu Oct 21, 2021 9:21 pm

You can actually remove a coupon by just submitting a blank coupon value. It will give an error message, but the coupon in the session data *will* be removed. This works in all OpenCart 2.x and 3.0 versions that I know of.

My Super Coupons and Ultimate Coupons extensions also fix this and allow you to set a custom message when they are removed, if you need that feature. They might be overkill if you don't need the rest of their functionality, though.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by paulfeakins » Fri Oct 22, 2021 5:45 pm

Johnathan wrote:
Thu Oct 21, 2021 9:21 pm
You can actually remove a coupon by just submitting a blank coupon value. It will give an error message, but the coupon in the session data *will* be removed. This works in all OpenCart 2.x and 3.0 versions that I know of.
Good little tip here!

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom
Who is online

Users browsing this forum: No registered users and 268 guests