Questions tagged [coupon]

For questions related to performing discounts on eCommerce transactions. (Please do not use this tag for questions regarding financial calculations regarding bond coupons and interest rates.)

This tag refers to performing discounts on eCommerce transactions (i.e. taking coupons in the applications OpenCart, Magneto, or WooCommerce applications.) Besides the logic to implement the discounts, this tag could also refer to generation of unique or batch coupon codes.

For financial calculations regarding bond coupons and interest rates, please use a different suitable tag, such as:

499 questions
1
vote
1 answer

Stripe: send commission to "friend" when new customer subscribes using specific coupon code

I have a SaaS website, where people can buy a subscription for my product. Payment is handled via Stripe. Now I want to give a "friend" (partner/affiliate) the possibility to promote my product to THEIR audience with a stripe coupon code. If a new…
Herbi
  • 103
  • 8
1
vote
1 answer

Allow specific products to be purchased only if some coupons are applied in Woocommerce

I am trying to have mandatory Coupons when checking out for specific products in WooCommerce. I tried Allow specific products to be purchased only if a coupon is applied in Woocommerce answer code, which works perfectly. However it allows to define…
1
vote
1 answer

Changing form layout with CSS

I need some help with CSS. I have a coupon form on my website and I would like to change the layout. I would like the field and button of the coupon form to be in 1 line and the coupon form to take 100% of the width. How can I do that?
JOKKER
  • 502
  • 6
  • 21
1
vote
1 answer

Check programmatically if a coupon is valid for a user in WooCommerce

I'm programmatically applying a coupon to a subscription via a custom dashboard form so the user doesn't go through the standard cart to apply it. All it's doing is taking the code they've entered into an input then applying it to the sub. Is there…
Rob
  • 6,304
  • 24
  • 83
  • 189
1
vote
1 answer

Allow some WooCommerce coupons set to "individual use" to be applied together

We have "individual use" ticked for all our coupons to stop multiple coupons being used. There is an exception where we need these "individual use" coupons to be usable for another specific coupon. For example: 3 coupons in total: Welcome 10 -…
1
vote
1 answer

Fire function on order creation to remove coupons from parent subscription

I have the following function, I want it fire every time an order for a subscription is created. I then want it to remove the store credit coupons from the parent subscription (as renewal orders will contain the coupon). I'm getting the error: "PHP…
Rob
  • 6,304
  • 24
  • 83
  • 189
1
vote
1 answer

Auto apply a coupon discount for specific countries only in WooCommerce

In WooCommerce I use this code to apply coupon if customer for specific country (Palestine): add_action( 'woocommerce_cart_calculate_fees','woocommerce_custom_surcharge' ); function woocommerce_custom_surcharge() { global $woocommerce; …
1
vote
0 answers

WooCommerce: How do I show a notice on product page if a WC session coupon exists?

Bit of a newbie... I have a survey and on submission, I am generating a dynamic coupon code to incentivize purchase of a product. When user adds a product to the cart, the discount code is applied successfully, however I would like to display a…
1
vote
1 answer

Update totals after applying or removing a coupon programmatically In WooCommerce

I have created a checkbox (It does not look like a checkbox anymore) that apply/remove a coupong on change. This works good. But the total does not update on the apply, the page has to be refreshed. I have build this function with some cut and paste…
Fredrik
  • 357
  • 3
  • 13
1
vote
0 answers

Option to remove coupon in php

My company's site adds coupons with this updatecart function (below), but there is no way to remove a coupon without going into the backend to delete it. I want to add that option, but I'm not sure where to start. I'm hoping it might be something…
1
vote
1 answer

Send an email notification to customer when a specific coupon code is applied in WooCommerce

I am trying to send an email to the customer after he has used a specific promo code 'FREECLASS' while checking out. What I do is send the customer a code 'FREECLASS' after signing up. I want the customer to get an additional custom message after he…
lukaxzy
  • 21
  • 2
1
vote
1 answer

WooCommerce error: Coupon properties should not be accessed directly

1° For necessity, i created this condition inside the template order-details.php file and i know that, this is not recommended. 2° Now i must put this script inside a filter to run in the order-details.php (checkout page). 3° Problem: Always when i…
Paulo do Porto
  • 606
  • 1
  • 9
  • 24
1
vote
1 answer

Mandatory redemption coupon for gifted items in WooCommerce

I'm using the below function which currently accepts a single (or array of) static coupon codes. How can I change this to work with any valid (i.e. not already used the maximum times etc.) coupon code that exists in the site? add_action(…
Lyall
  • 1,367
  • 3
  • 17
  • 42
1
vote
1 answer

Prevent checkout if no coupon has been applied when certain products in cart

I am working on a WooCommerce website and I am trying to restrict a product to be purchased only if a coupon is applied for it, so it should not be processed without adding a coupon code. User must enter a coupon code to be able to order this…
Maged Mohamed
  • 511
  • 5
  • 27
1
vote
1 answer

Apply specific coupon based on customer shipping zone in WooCommerce

i have two coupons and multiple shipping zones (shipping zone A, shipping zone B, shipping zone C) (coupon 1) and (coupon 2). what i want is that if a user choose a specific shipping zone lets say (shipping zone C) i want to apply (coupon 2) for…
Ali
  • 33
  • 1
  • 5