Questions tagged [discount]

405 questions
1
vote
2 answers

Tax Brackets and Volume Discounts using Excel

It's the end of January and that magical feeling of "tax time" is starting up around the world. A common problem is to calculate tax owed based on a set of tax brackets and rates. This is also similar to calculating total order costs based on a…
mark fitzpatrick
  • 3,162
  • 2
  • 11
  • 23
1
vote
1 answer

Apply discount/coupon ONLY for backordered products

I'm trying to add a discount code just for backordered items, I found this one on here and it works for ALL items, not just backordered items, how can I fix this? Thanks in advance! add_filter( 'woocommerce_coupon_is_valid',…
Ale
  • 25
  • 5
1
vote
1 answer

Counting Transaction after initial discounted transaction

I'm stuck! The goal is to count the number of customer transactions after initially being drawn in by a discount to determine "X% of customers never return when the first visit is discounted" This was the best I could do: postpurchase =…
1
vote
2 answers

Discounting values based on previous appearance in r

I have the following (sample) dataset: df <- data.table( firm = rep(c("A","B"),each=20), year =…
lovestacksflow
  • 521
  • 3
  • 14
1
vote
1 answer

Display product sale price in WooCommerce checkout issues

I'm using this code snippet to display product sale prices at WooCommerce checkout: function show_sale_price_at_checkout( $subtotal, $cart_item, $cart_item_key ) { $product = $cart_item['data']; $quantity = $cart_item['quantity']; …
JOKKER
  • 502
  • 6
  • 21
1
vote
1 answer

Custom total savings amount display issue in WooCommerce Checkout

I'm using this code snippet to display the total order savings at WooCommerce checkout: add_action( 'woocommerce_review_order_after_order_total', 'show_total_discount_cart_checkout', 9999 ); function show_total_discount_cart_checkout() { …
JOKKER
  • 502
  • 6
  • 21
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
2 answers

Shipping discount based on chosen payment method in WooCommerce

I'm currently trying to apply a discount on shipping if a customer chooses a certain payment method. For some reason, this applies the discount regardless of which payment method is chosen. The code I'm using in functions.php is: function…
1
vote
1 answer

How to add Line Break for discount text on cart page of Woocommerce on Wordpress in function.php file

This is my code below and I've tried \n '\n' '' but nothing worked. I want to have two lines or paragraphs with First Line and Second Line in the discount line on the cart page function prefix_add_discount_line( $cart ) { $chosen_methods =…
Gokul
  • 11
  • 4
1
vote
1 answer

WooCommerce progressive quantity discount for specific product categories

I was researching a method to give a progressive discount if you have more than 1 product in the cart. I found this thread and actually using this code: //Discount by Qty Product add_action( 'woocommerce_before_calculate_totals',…
IamLearningPHP
  • 131
  • 1
  • 12
1
vote
1 answer

Show possible discount to unlogged users for WooCommerce discount based on user roles

I used the Apply a discount for a specific user role in Woocommerce solution to create two snippets that will give my customers and wholesalers a discount this Black Friday. However, the discount for customers only shows when they login. Is there a…
1
vote
1 answer

Apply a discount based on ACF field to cart total in WooCommerce

I'm trying to create a discount programmatically for orders on my store. My users have a variable discount rate e.g. 10%. I want to apply their discount to the order before checkout, however, some items in the store are not applicable for a…
archvist
  • 712
  • 2
  • 18
  • 41
1
vote
1 answer

Bulk Discount for specific product ID in WooCommerce

I want to discount a specific product during checkout based on quantity thresholds: When product >= 10 units ----- discount 2 dollars per unit When product >= 20 units ----- discount 3 dollars per unit Sample Desired Output example: Product × 10…
nichlor
  • 15
  • 4
1
vote
1 answer

How can I apply a fixed price to bundle products?

For a shopify store, I am trying to create a build-a-box bundle with a fixed price. Let say user can select any 3 products from a collection for $100. My planning is like this: Create an alternative page for user to select products When user has…
Benny Chan
  • 730
  • 1
  • 8
  • 24