Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Latest commit

 

History

History
45 lines (31 loc) · 2.56 KB

File metadata and controls

45 lines (31 loc) · 2.56 KB

📣 Announcement: New documentation location

The documentation for WooCommerce Blocks has moved to the WooCommerce monorepo.

Please refer to the documentation in the new location as the files in this repository will no longer be updated and the repository will be archived.


Coupons

Setup

To conduct these tests, please set up the following coupons:

  • generalCoupon: A general-purpose coupon
  • expiredCoupon: An expired coupon
  • emailRestrictedCoupon: An email-limited coupon, applicable to *@automattic.com emails
  • thresholdCoupon: A cart condition coupon, applicable to carts above a certain threshold (e.g., $200)
  • individualCoupon: An individually used coupon
  • freeShippingCoupon: A free shipping coupon

Test cases

To execute the following test cases, you will need to toggle the coupon functionality. You can enable or disable coupons via WP Admin » WooCommerce » Settings » General » Enable coupons:

Screenshot 2023-09-27 at 21 26 30

With coupons disabled

  • Verify that the 'Add Coupon' section is not visible in your cart, checkout, and in the editor.

With coupons enabled

  • Ensure the ability to apply coupons in both Cart and Checkout blocks.
  • A valid coupon, generalCoupon, should accurately reduce your totals.
  • An expired coupon, expiredCoupon, should generate an error upon application.
  • Attempting to apply an invalid coupon should generate an error message.
  • An email-limited coupon, emailRestrictedCoupon, should be applicable to your cart.
    • If the email is correct, checkout should proceed without errors.
    • If the email is incorrect, an error message should appear, and the coupon should be removed from your cart.
  • A condition coupon, thresholdCoupon, should only be applicable once the stipulated condition is met.
    • If a condition coupon is added and subsequently the condition is unmet, it should be removed from your cart with a corresponding error message.
  • A valid coupon, generalCoupon, when followed by an individually used coupon, individualCoupon, should override the first one.
  • An individually used coupon, individualCoupon, when followed by an attempt to add another coupon, should generate an error message.
  • A free shipping coupon, freeShippingCoupon, should display the free shipping method you previously configured.