Questions tagged [discount]

405 questions
1
vote
1 answer

How to create edd disocunt-code with programming?

I am working in wordpress edd plugin, in which i have requirement of create edd coupon code dynamically with specific amount, start date, end date and assign user to that code. I have not found any filter/action hook that will accomplish this task.…
Abhee
  • 425
  • 1
  • 5
  • 17
1
vote
0 answers

Maximum coupon Discount in WooCommerce

Based on "Fix maximum coupon Discount On Cart percentage in WooCommerce" answer thread, I use the following code in my active theme's function.php file: add_action('woocommerce_coupon_options_usage_limit', 'woocommerce_coupon_options_usage_limit',…
arsalan
  • 11
  • 2
1
vote
2 answers

Shopify - Display all discount code in a page

I have this code in my Shopify page. {% for discount in discounts %} {{ discount.title }}
{% endfor %} But this is not showing any lists of discount I created. Any help will be appreciated :)
Anthony Carbon
  • 608
  • 1
  • 5
  • 18
1
vote
1 answer

Auto apply a coupon for a specific product based on Woocommerce cart subtotal

Referring to this question: Apply a coupon programmatically in Woocommerce and then this one:How to apply an automatic discount in WooCommerce based on cart total? Complete rookie here. I need to auto-apply an already existing coupon to one…
1
vote
2 answers

Woocommerce cart items discount gets reset in checkout

I've been trying to implement a discount in my store with the following code: add_action('woocommerce_before_calculate_totals', 'set_discount', 10 ); function set_discount( $cart ) { if ( is_admin() && ! defined( 'DOING_AJAX' ) ) …
erki
  • 25
  • 7
1
vote
2 answers

How to access to the discount price in Magento?

I'm trying to rewrite a template for the cart. I need to retrieve the discount amount but I was not able to find where. Ie If my coupon code gives me $10 discount I want to retrieve 10, if I have a discount of 5% I want to retrieve 5 if the total…
JohnT
  • 967
  • 2
  • 16
  • 30
1
vote
3 answers

Quantity discount on 2nd item only in Woocommerce

I want to achieve a global discount for all products but only for the 2nd product item. What do I mean? If the customer buys "Jacket" no discount is given. Customer buys two of the "Jacket" product. 20% discount is given on the second…
user10913018
1
vote
1 answer

Woocommerce discount on second item when not on sale items are in cart

Now I have the following Woocommerce discount: 1) at one item --> 10% only for not in sale items 2) at two items 20% for the cheapest item including on sale items I tried use Cart discount based on cart item count and only for items that are not in…
Arie B
  • 71
  • 1
  • 1
  • 7
1
vote
1 answer

Get and display products On Sale count in WooCommerce

By doing an SQL query (does not seem to work properly) which counts how many products that are on sale (it counts how many products that have discounted prices), my goal is to display a message on the main archive (shop) using a hook. The message…
user10830190
1
vote
1 answer

Shipping discount based on user roles in Woocommerce

I tried to implement a code snippet for functions.php that will apply a 50% discount to the delivery charge when the "admin" role and want to hide it goes in free delivery mode. It does not work as I would like. What I am doing…
Lê Nghĩa
  • 255
  • 4
  • 15
1
vote
1 answer

Disable tax calculation on a discount using the Fee Api in Woocommerce

I am using a custom fee to calculate a discount based on amount of items in cart. Discount becomes more if there are more products in the cart. Discount should be €5 for 2 products, but is €6,05 because 21% tax gets calculated over the discount…
norderp
  • 11
  • 2
1
vote
1 answer

Display variable product discounted percentage only on Woocommerce archive pages

I'd like to display the percentage variable products are discounted in the archive pages. With the code below, I was able to get both the discounts % on variable products but also for simple products. Can I do this ONLY for variable products and not…
John Holliday
  • 311
  • 4
  • 16
1
vote
1 answer

Percentage Discount limited to a date range and Orders count in Woocommerce

I'm trying to make a function that sets a cart discount of 10% no matter what product or how many that are in the cart. This code works fine: function site_wide_shop_discount_with_custom_title( $cart ) { $discount = $cart->subtotal * 0.1; …
user10403192
1
vote
1 answer

Local pickup shipping option custom percentage discount in Woocommerce

My WooCommerce checkout page gives some shipping options: Flat Rate (costs money) Local Pickup (free). How can I give a 5% discount on total order cost if a customer chooses Local Pickup shipping method?
1
vote
1 answer

Two different set of discounts that should be applied with respect to 2 different categories in woocommerce

This is WordPress website integrated with woocommerce. In this store, they are two main categories Category1 and Category2. I want to make two different set of discounts that should be applied with respect to 2 different categories. For…
Vinayagam
  • 944
  • 1
  • 9
  • 29