Pass a WooCommerce coupon code via URL and display the product prices as if the coupon has been applied to them. Coupon is automatically added to the …
With this plugin, you can pass a coupon code via an URL parameter (mcoupon
by default) and it will be stored in a cookie for a configurable amount of time.
While the cookie is valid:
Please note that the coupon can still be applied manually by the user at any time. This will not lock the coupon regular usage.
The support for variable products is experimental and may be moved to a premium add-on in the future.
Already know our other WooCommerce (premium) plugins?
Yes. Use the magic_coupon_url_parameter
filter.
Sure you can. Use the magic_coupon_html_message_action_hook
filter to change the hook and the magic_coupon_html_message_action_priority
filter to change the priority.
If you don’t know what we’re talking about, you should probably stop now and hire us to do it for you 🙂
You can also show it directly on the product description by using the [magic_coupon_html_message]
shortcode.
You bet! Use one of the following placeholders on your message:
{product_id}
will be replaced by the Product ID;{coupon}
will be replaced by the coupon code;{cookie_expire_timestamp}
will be replaced by the cookie expiration Unix timestamp;{cookie_validity_minutes}
will be replaced by the cookie validity in minutes;{cookie_validity_hours_minutes}
will be replaced by the cookie validity in hours or minutes (in the x hours
or x minutes
format), depending on the validity being more or less than one hour;You can also add you own placeholders with the magic_coupon_html_message_replace_tags
filter. See an example here.
And because you can also use shortcodes on the HTML message field, you can feed the product id, coupon, the cookie expire timestamp or validity, or any other variable you set via your own placeholders as a shortcode argument, you can do whatever you want with your custom message. Go crazy, or hire us to develop a custom solution for you.
Yes. The page output has to be changed to set the discounted product prices based on the user cookie. That’s incompatible with a server-side caching system.
We set the following constants to prevent caching by some plugins, on the moment the customer reaches the page with a coupon code:
DONOTCACHEPAGE
DONOTCACHEOBJECT
DONOTCACHEDB
This will ensure the page with the discounted price is not cached on that moment (and no other users will see a version of the page with the discount), but will not disable the cache that might already exist.
Anyway, we’ve experimented a bit with the WP-Optimize “Cookies which, if present, will prevent caching” setting, by entering the name of our cookie (mcoupon
by default), and we had good results. Regular users see the cached page and the ones with the coupon set on the cookie see non-cached pages.
Yes.
Yes.
This is a free plugin. It’s our way of giving back to the wonderful WordPress community.
There’s a support tab on the top of this page, where you can ask the community for help. We’ll try to keep an eye on the forums but we cannot promise to answer support tickets.
If you reach us by email or any other direct contact means, we’ll assume you are in need of urgent, premium, and of course, paid-for support.
You can report any security bugs found in the source code of this plugin through the Patchstack Vulnerability Disclosure Program. The Patchstack team will assist you with verification, CVE assignment and take care of notifying the developers of this plugin.
{cookie_validity_hours_minutes}
placeholder on the HTML message that will show the cookie validity time in hours or minutes; [magic_coupon_html_message]
shortcode to show the HTML message on the product description if the theme is custom and does not call the woocommerce_single_product_summary
action