wp-e-commerce / WP-e-Commerce

WP eCommerce - The most popular independent eCommerce platform for WordPress
https://wpecommerce.org
GNU General Public License v2.0
215 stars 216 forks source link

Coupon code not working for a particular product with variations #2034

Open ablears opened 8 years ago

ablears commented 8 years ago

WordPress 4.3.1, WP e-Commerce 3.11.1.

I have a product "Costa Rica San Miguel (Filter roast)". I create a coupon called "subscriber" with a 10% discount, within date range, active, applied on all products.

For the following conditions, the coupon will not be triggered at checkout.

Item name is equal to Costa Rica San Miguel (Filter roast) Item name contains Rica Item name contains San Miguel

This condition does trigger the coupon: Item name contains San

Whuh?

This product had 18 variations. I removed the variations, saved variations, updated the product, and now all the above conditions trigger the coupon as expected.

benhuson commented 8 years ago

It 'feels' like the variations could have somehow ended up with different titles to their parent product and that the coupon is trying to match against the variation title instead of the main product title.

I'm not sure under what circumstance variation titles would be different. Maybe if you created the main product and variation and then rename the main product, I'm not sure it would also update the variation automatically.

I guess the question is, should the coupon be matching against the variation title or the main product title?

JustinSainton commented 8 years ago

@benhuson I'm not sure there is a reproducible bug here. If I had "Random T-Shirt" as a product and variations that included "Size: Small", for example - I think as a normal condition, I'd expect to match "Random T-Shirt" and not "Size: Small".

As such...I think we can give some more thought overall here to how coupons work (see #1541 as well) and punt this for 4.0