Skip to content

Coupons

The Coupons module allows you to display information about available coupons directly on the product page with the option of automatic application when adding to cart.

The module is optional and must be activated in the main plugin settings under the Additional Modules section.


  1. Create a standard WooCommerce coupon
  2. Enable display on the product page in the coupon settings
  3. A CTA block appears on products the coupon applies to
  4. The customer can add the product to the cart with the coupon automatically applied

Marketing → Coupons → Add coupon

Set the standard coupon parameters:

  • Coupon code
  • Discount type (percentage, fixed amount)
  • Usage restrictions
  • Validity

In the coupon settings, find the “Add to Cart with Coupon” tab:

FieldDescription
Show on Product Detail PageEnables the CTA block display on products
Apply coupon automaticallyThe coupon is applied automatically when adding to cart
TitleCTA block heading
Button TextButton text (supports placeholders)
PlaceholderDescription
{coupon_code}Coupon code
{discounted_price}Price after discount

Example:

Buy for {discounted_price} with coupon {coupon_code}

Field: Coupon info block position

Determines where the CTA block is displayed on the product page.

PositionDescription
Before add to cart formBefore the add to cart form
After add to cart formAfter the form
Before product summaryBefore the product summary
After product summaryAfter the summary

Field: Coupon box style

StyleDescription
Custom / no styleNo default styles — use your own CSS
MinimalSimple white box with a border
Bordered CTADashed border, warm colors
Shined CTABold red block with animation

When “Apply coupon automatically” is enabled:

  1. The customer clicks the standard “Add to cart” button
  2. The product is added to the cart
  3. The coupon is automatically applied

Advantage: Simpler UX, the customer does not need to enter a code.

When “Apply coupon automatically” is disabled:

  1. A CTA block is displayed on the product page
  2. The customer clicks the button in the block
  3. They are redirected to the cart with the product and applied coupon

Advantage: The customer sees that they are taking advantage of a special offer.


The CTA block is displayed only if:

  1. The coupon is valid (date, usage limit)
  2. The coupon applies to the given product
  3. The product is in stock and can be purchased
  4. The product has a price (is not free)
  5. The discount actually reduces the price

For custom styling, use these CSS classes:

.wpify-woo-discount-coupon-block {
/* Wrapper for the entire block */
}
.wpify-woo-discount-coupon-block__title {
/* Heading */
}
.wpify-woo-discount-coupon-block__button {
/* CTA button */
}

Tip: Select the “Custom / no style” style and use your own CSS for full control over the appearance.


apply_filters( 'wpify_woo_coupons_block_args', $args, $product );
ParameterTypeDescription
$argsarrayData for the template (coupon, title, url, product)
$productWC_ProductCurrent product
/**
* Add custom data to the CTA block
*/
function customize_coupon_block( $args, $product ) {
$args['custom_message'] = 'Limited offer!';
return $args;
}
add_filter( 'wpify_woo_coupons_block_args', 'customize_coupon_block', 10, 2 );

Can I display multiple coupons on one product?

No. Only the first valid coupon is displayed. If you have multiple coupons for the same product, the one with the lowest order (by name) is shown.

Does it work with both percentage and fixed discounts?

Yes. The module supports both WooCommerce coupon types:

  • percent - percentage discount
  • fixed_product - fixed product discount
Is the block shown even if the customer has already used the coupon?

Yes. Usage limit validation occurs only when adding to cart. The block is displayed, but when attempting to use it, a WooCommerce error message is shown.

How does it work with variable products?

The coupon is validated against the parent product. If the coupon applies to the product, the CTA block is displayed. When selecting a specific variation, the variation is added to the cart with the applied coupon.