coupon

Add Applied Coupon Code in Admin New Order Email Template - WooCommerce

╄→尐↘猪︶ㄣ 提交于 2020-07-15 03:52:33
问题 Let me clear my question: I have downloaded & activated WooCommerce Plugin for E-Commerce Functionality. I want to add "Applied coupon code" in Admin New Order Email Template using my custom plugin. Now: Can you tell me that exact Hook or Function which is actually setting up that New Order Email Template so that i will override it? Can you tell me how to call applied coupon code, so that i will display this in email template? It would be great, if you help me please. 回答1: This can be done

Remove some payment gateways if any coupon code is applied in Woocommerce

╄→尐↘猪︶ㄣ 提交于 2020-05-28 04:33:06
问题 I started to work on small Woocommerce project. I have 3 payment gateways into this store: Paypal, Credit Card and Direct bank Transfer. What I would like is: If coupon code is used, I would like to disable (or remove) Paypal and Credit Card from available payment gateways, and just keep "Direct bank Transfer" as available payment gateway choice. To show how is look current state from checkout page: I found a similar solution, but this is for removing gateway based on product category. add

Remove some payment gateways if any coupon code is applied in Woocommerce

时间秒杀一切 提交于 2020-05-28 04:32:37
问题 I started to work on small Woocommerce project. I have 3 payment gateways into this store: Paypal, Credit Card and Direct bank Transfer. What I would like is: If coupon code is used, I would like to disable (or remove) Paypal and Credit Card from available payment gateways, and just keep "Direct bank Transfer" as available payment gateway choice. To show how is look current state from checkout page: I found a similar solution, but this is for removing gateway based on product category. add

How to check which coupon is applied to which product in WooCommerce?

爱⌒轻易说出口 提交于 2020-01-23 13:23:10
问题 Since we can apply different coupons to each product in an order, Is there any method to know which coupon is applied to which product? I've used $order->get_used_coupons() function but it just returns the used coupon codes only. Please help with a solution. Thanks. 回答1: Example made for Woocommerce 2.5.x on June 2016 (Will not work in Woocommerce 3+) This example is based on compiled searches: function wc_my_order_coupons( $order_id ) { $order = new WC_Order( $order_id ); // checking if

Get woocommerce carts total amount

独自空忆成欢 提交于 2020-01-10 17:27:11
问题 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.]#', '', $woocommerce->cart->get_cart_total() ) ); The preg_replace eliminates everything but decimal characters and colons. Should you care to do math with it, the floatval converts the value from a string to a numeric one. I tried adding: $amount2 = floatval

Applied coupons disable Free shipping conditionally in Woocommerce

僤鯓⒐⒋嵵緔 提交于 2020-01-04 05:37:20
问题 I am trying to get it so that if a customer were to add a coupon code (Any of them) the Free Shipping option would go away and the flat rate fee would be implemented. - You would think this would be an easy thing to implement, there would be 100's of plugins and ways described to do this, but I have not found any. I do not want to pay $89 for the plugin to do this one thing A side bonus would be if they are using a coupon but are spending over $249 they can still qualify for Free shipping. I

Applied coupons disable Free shipping conditionally in Woocommerce

天涯浪子 提交于 2020-01-04 05:37:01
问题 I am trying to get it so that if a customer were to add a coupon code (Any of them) the Free Shipping option would go away and the flat rate fee would be implemented. - You would think this would be an easy thing to implement, there would be 100's of plugins and ways described to do this, but I have not found any. I do not want to pay $89 for the plugin to do this one thing A side bonus would be if they are using a coupon but are spending over $249 they can still qualify for Free shipping. I

Magento get coupon description

让人想犯罪 __ 提交于 2020-01-03 19:18:10
问题 I am trying to retrive the text set in the Magento Coupon Description field to use as part of a validation rule. Does anyone know how to load a coupon price rule using the coupon code and retrieve the associated coupon description text? 回答1: Under Magento 1.3, you can use this code (not tested as I have no 1.3 within easy reach) : $rule = Mage::getModel('salesrule/rule')->load($code, 'coupon_code'); if ($rule->getId()) { $description = $rule->getDescription(); } 回答2: I have used in magento 1

Making the coupon field mandatory on WooCommerce

微笑、不失礼 提交于 2020-01-03 03:45:30
问题 I was wondering if it was possible to make the coupon field mandatory on Woocommerce. I know that this is possible using functions, however this is slightly above my current skill level so I was wondering if you could give me a dumbed-down/step-by-step version of how to accomplish this. Any answer would be much appreciated. or is there perhaps a plugin that can help me accomplish this? 回答1: I don't know about the function but you can modify the plugin to achieve this in following manner :

Fix maximum coupon Discount On Cart percentage in WooCommerce

风流意气都作罢 提交于 2020-01-01 05:53:30
问题 I have a coupon code (XYZ25) in woocommerce which include 25% off and maximum discount is Rs.250. How can i restrict user's to not get more than Rs.250 Discount if they apply coupon code XYZ25 for 25% discount. 回答1: Since Woocommerce 3.2 or 3.3, this code doesn't work anymore You could set an additional coupon FIX250 code based on a fixed cart discount of ** RS.250 (without tax) and with a Minimun spend of (4 x 250) = RS.1000 . Then with the help of the script below, if customer apply your