cedaro / woocommerce-coupon-links

A WordPress plugin to automatically apply WooCommerce coupon codes to the cart via a URL.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sorry, this coupon is not applicable to selected products.

metlock opened this issue · comments

Nice plugin, problem I cant get past is the error: Sorry, this coupon is not applicable to selected products.

applicable Products have been included in the coupon and I'm using the right ID for the product. Have tried adding first Variant and all variants still wont detect correctly.
It works fine with no products set as a global discount code
Any ideas?

Hi @metlock, I don't have any ideas at the moment, but it seems like something may have changed in a recent WooCommerce release, so this is something I'll have to dig into when I get a little time.

I spent a little time today tracking down an unrelated issue that was causing some problems with this plugin, so I looked into what could cause the error you're seeing. It looks like that particular error is returned in three cases:

  1. When the coupon is limited to specified products (WC_Discounts::validate_coupon_product_ids())
  2. When the coupon is limited to products in specified categories (WC_Discount::validate_product_coupon_categories())
  3. When the coupon excludes specific products (WC_Discount::validate_coupon_excluded_items()

You might make sure the product/variation that you're using doesn't match any of those criteria.