Magic URL Coupon for WooCommerce

Opis

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:

  • All the eligible products will have their display price reflect the coupon discount;
  • A personalized HTML message can be shown on the product page, under the product price (or anywhere else, if you know your way around hooks);
  • When the client adds the product to the cart, the coupon is automatically applied also;

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.

Snimke zaslona

  • Magic coupon settings

Instalacija

  • Use the included automatic install feature on your WordPress admin panel and search for “Magic URL Coupon WooCommerce”;
  • On each coupon you want to activate this plugin features, you must go to the “Magic coupon” tab and check “Enable”;

ČPP

I need help, can I get technical support?

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.

Can I change the URL parameter name from `mcoupon` to something else?

Yes. Use the magic_coupon_url_parameter filter.

Can I show the HTML message somewhere else on the product page?

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.

Is it possible to add dynamic information to the HTML message?

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.

Can this plugin have issues with caching plugins?

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.

Recenzije

23. rujna 2020.
Tried quite a few coupon plugins to get URLs to work, this one was the only one that works consistently. Great job.
10. svibnja 2020.
Simple solution for creating links for WooCommerce with coupons automatically applied. We working and very fast support from the developer. Thank you for that. Cheers.
Pročitajte sve 2 recenzije

Suradnici i Programeri

“Magic URL Coupon for WooCommerce” is open source software. The following people have contributed to this plugin.

Suradnici

“Magic URL Coupon for WooCommerce” je prijeveden na 1 dijalekt. Zahvala prevodiocima za njihov doprinos.

Prevedite “Magic URL Coupon for WooCommerce” na svoj jezik.

Zainteresirani ste za razvoj?

Pregledajte kôd, pogledajte SVN spremišteili se pretplatite na dnevnik razvoja od RSS.

Dnevnik promjena

1.6

1.5

  • Compatibility with our upcoming plugin “Percentage Coupon per Product for WooCommerce” plugin
  • Tested with WordPress 5.5-RC1-48708 and WooCommerce 4.4.0-rc.1

1.4

1.3.1

  • Bugfix on categories inclusion/exclusion for variable products
  • Fix PHP notice when product has no price

1.3

  • Experimental support for variable products (may be moved to a premium add-on in the future)
  • Check if coupon needs to be applied when cart quantities are updated (thanks UsoMascara.pt)
  • Code refactor for flexibility

1.2.3.1

  • Plugin name changed from “Magic Coupon for WooCommerce” to “Magic URL Coupon for WooCommerce”

1.2.3

  • Better UX on the “Magic coupon” tab, including a button to copy the shop URL with the coupon parameter on it
  • Technical support clarification

1.2.2

  • Fix small bug displaying the sale price when the discount value was below 1 (thanks ProdutosLimpeza.pt)

1.2.1

  • Fix PHP notice when the discount is neither “Percentage discount” or “Fixed product discount” (thanks @alordiel)

1.2

  • New {cookie_validity_hours_minutes} placeholder on the HTML message that will show the cookie validity time in hours or minutes;
  • Some fixes on the way the coupon is added to the cart to ensure it only happens after the product is already there
  • Avoid duplicating the discount on the cart and checkout pages (Oops…)

1.1.1

  • Small bugfix

1.1

  • New [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
  • Bugfix on the moment the coupon is checked from the cookie to avoid errors on some configurations
  • Clarification of operation in conjunction with cache plugins
  • Tested with WordPress 5.5-alpha-47748 and WooCommerce 4.1.0-rc.2

1.0.2

  • Tested with WordPress 5.2.5-alpha and WooCommerce 3.8.0

1.0.1

  • Small readme.txt fixes

1.0