wp-graphql / wp-graphql-woocommerce

Add WooCommerce support and functionality to your WPGraphQL server
https://woographql.com
GNU General Public License v3.0
645 stars 131 forks source link

APPLY_COUPON coupon mutation returns different error message when the valid coupon code case changes #600

Open brianpereradap opened 2 years ago

brianpereradap commented 2 years ago

APPLY_COUPON coupon mutation returns different error message when the valid coupon code case changes.

To Reproduce Steps to reproduce the behavior:

  1. Use the APPLY_COUPON to submit an invalid coupon code that contains all lower case letters
  2. Check the response error message
  3. Use the APPLY_COUPON to submit an invalid coupon code that contains one or more capital letters
  4. Check the response error message

Expected behavior Regardless of the case, the same error message would be returned

Screenshots image image

Desktop (please complete the following information):

Plugin Versions

kidunot89 commented 2 years ago

@brianpereradap I'm not seeing the problem. The error messages returned are mostly just forward from WooCommerce.

Are you saying the error message should be identical?

Kosyarik commented 2 years ago

Can someone show an example of the implementation of coupons (applyCoupon) on js. Thanks

brianpereradap commented 2 years ago

@kidunot89 check the following screenshot. The wp-graphql-woocommerce plugin is sending back a hard coded error message as opposed to sending the standard error sent back from woocommerce. image

kidunot89 commented 2 years ago

@brianpereradap Oh I see. We can make this consistent with WooCommerce somehow 🤔

brianpereradap commented 2 years ago

Can someone show an example of the implementation of coupons (applyCoupon) on js. Thanks

Use the ApplyCoupon mutation to add coupons to the cart session. You just need to pass in a client mutation id and a valid coupon code as inputs for the mutation. image image image

kidunot89 commented 2 years ago

@brianpereradap You actually don't need to pass in the clientMutationId at all anymore.