Automattic / wp-calypso

The JavaScript and API powered WordPress.com
https://developer.wordpress.com
GNU General Public License v2.0
12.4k stars 1.98k forks source link

Checkout: improve messaging for coupons that don't apply to cart #41538

Closed michaeldcain closed 3 years ago

michaeldcain commented 4 years ago

When a user attempts to apply a valid coupon to a cart without valid items (i.e. a plan coupon to a cart with only domains), we show the following error:

Screen Shot 2020-04-28 at 10 18 51 AM

The error that returns from the server is slightly more applicable:

message: "Sorry, but we were not able to find that coupon. Please check that you typed the coupon code correctly and that this coupon is for the product you have selected."

We should either return a more accurate coupon error from the endpoint, or show the full error message to the user.

sirbrillig commented 4 years ago

Reported several more times in pNPgK-5bA-p2

sirbrillig commented 3 years ago

As of https://github.com/Automattic/wp-calypso/pull/47943 and D53596-code we are now displaying the full message from the server to the customer. The message could still be improved and made more specific, but at least this is better than before.

michaeldcain commented 3 years ago

Thanks @sirbrillig. I think I'll go ahead and close this issue, since we're now returning the server error and improving the coupon error messages on the server falls more under @Automattic/martech's work.