Questions tagged [discount]

405 questions
38
votes
3 answers

Apply a coupon programmatically in Woocommerce

In Woocommerce I'm trying to find a way to apply a 10% discount to an entire customer's order if the weight in the cart is over 100 lbs. I'm partway to achieving this. For the next step, I'm looking for a way to programmatically apply a coupon code…
msargenttrue
  • 425
  • 1
  • 5
  • 11
32
votes
12 answers

Get woocommerce carts total amount

I am trying to apply a discount to a carts total price, but I can only do it to the item base price and not the over all price. I Googled and came across this post in the wordpress stackoverflow: $amount = floatval( preg_replace( '#[^\d.]#', '', …
Howli
  • 12,291
  • 19
  • 47
  • 72
14
votes
2 answers

Add a discount programmatically to an Order in Woocommerce 3.2+

In woocommerce, we can add a discount to any order using Coupons feature (fixed amount, percent amount…). Is it possible to add discount amount to any order programmatically where the discount amount can be any amount? Any help will be…
Pankaj Verma
  • 415
  • 1
  • 4
  • 15
13
votes
4 answers

Product Final Price after Many Discount given

I have two tables. One table of Ids and their prices, and second table of discounts per Id. In the table of discounts an Id can has many Discounts, and I need to know the final price of an Id. What is the Best way to query it (in one query) ? The…
erezlale
  • 625
  • 2
  • 6
  • 17
13
votes
1 answer

Create a discount code for my own app in google play store

Is it possible with google play store having a non free app that can be downloaded for free (or with a certain discount) if the user provide a promotional code?
user2923045
  • 369
  • 2
  • 6
  • 16
12
votes
0 answers

How to discount auto-renewable subscription AFTER user has subscribed?

Our app that is in development will have the following 2 IAPs set up: $12.99/mo as an auto-renewable subscription. $9.99/mo as an auto-renewable subscription (if you've entered an invite code). Obviously if the user enters the invite code BEFORE…
Keitzer
  • 151
  • 6
12
votes
3 answers

Catalog Price Rules applied to special_price

First question on stackoverflow...i am excited :) Currently magento is using the special price if its lower than the applied catalog price rule. If the catalog price rule makes the product cheaper than the special price, then the catalog price rule…
Michael Leiss
  • 5,395
  • 3
  • 21
  • 27
9
votes
2 answers

How can get Final Price, with applied price rule in Magento

For example $_producte = Mage::getModel('catalog/product')->load(2974); echo $_producte->getFinalPrice(); I can get in frontend when insert to .phtml BUT I can not get final price (with discount) in admin section or in custom product export…
Alex
  • 769
  • 1
  • 11
  • 18
9
votes
1 answer

How do I discount the original sell price based on the quantity of either one OR all the products in the cart?

How do I discount ALL products in the cart based on the quantity of any and/or all products purchased? For example, when the user buys a totale of 10 products (any combination of products), the products are discounted of $5.00 each. I've looked at…
cfusch
  • 729
  • 4
  • 7
9
votes
2 answers

How to programmatically remove applied discount coupons in Woocommerce?

I've been searching for a while but I can't find how to remove woocommerce coupons programmatically. I'm trying to make discounts based on cart total. I need to apply remove coupons because If you have products worth 1000 € (15% discount coupon…
Waltone
  • 93
  • 1
  • 1
  • 6
8
votes
1 answer

Display the discounted percentage near sale price in Single product pages for WC 3.0+

I had this code in function.php of my theme to display the percentage after price and it was working fine in WooCommerce v2.6.14. But this snippet doesn't work anymore on WooCommerce version 3.0+. How can I fix that? Here is that code: // Add save…
tozbey
  • 115
  • 2
  • 9
7
votes
1 answer

WooCommerce Cart quantity based discount

In WooCommerce, how do I set a cart discount based on the total number of items in the cart? For example: 1 to 4 items - no discount 5 to 10 items - 5% 11 to 15 items - 10% 16 to 20 items - 15% 21 to 25 items - 20% 26 to 30 items - 25% I've…
Fiona Tan
  • 79
  • 2
6
votes
1 answer

What does /usr/sbin/install really do?

I'm trying to install discount on my VPS which is based on Solaris and compiling works great after setting some environment variables but the install fails. So I thought I'd do the install manually, but what does install really do? Is it simply a…
Robert Sköld
  • 752
  • 2
  • 9
  • 19
5
votes
2 answers

Set a percentage discount to Local pickup shipping method in Woocommerce

I have a WordPress site which uses WooCommerce plugin. I would like to offer buyer 5% reduction from cart total if they select local pickup as a shipping method. I already tried - 5 * [qty] and it doesn't seem to be working. I also tried -0.95 *…
Yama
  • 333
  • 1
  • 5
  • 20
5
votes
1 answer

Set a discount in WooCommerce without a coupon

I need set a discount manually without using coupons. I have checked the Woocommerce source in Github and I see that it uses "set_discount_total" functions, but it does not work. I have tried WC()->cart->set_discount_total(15) and…
Alexander
  • 149
  • 1
  • 3
  • 13
1
2 3
26 27