coupon

Deleting a large number of Magento coupons (shopping cart price rules) programatically

风格不统一 提交于 2019-12-07 04:54:27
问题 I've been on here before asking about writing code to get Magento to generate a random coupon code for a new e-mail subscriber - Creating a single random Magento coupon This code worked perfectly and to those who helped I am eternally grateful. I am now looking for a way to delete these coupons as they expire in a bulk fashion because deleting them individually through the Magento admin is a huge pain. As you can see from the picture below, in the span of a couple of days we generated over

How do I get an external page coupon/voucher form to work in OpenCart?

最后都变了- 提交于 2019-12-06 23:39:59
问题 I have another page in my OpenCart environment, let say the about us page, which has these forms below, assuming the user has items in their cart, these forms should work but they do not: Enter your coupon code here: <form action="index.php?route=checkout/cart" method="post" enctype="multipart/form-data" id="basket"> <input type="text" value="" id="coupon" name="coupon"/> <input type="hidden" value="coupon" name="next"/> <input type="submit" class="button" value="Apply Coupon"/> </form> Enter

Progressive fixed Coupon Discount based on specific product quantity in Woocommerce

帅比萌擦擦* 提交于 2019-12-06 20:38:46
I have one little problem that dont know how to fix myself. I want to use this logic into my Woocommerce store just for one product. I have use link like this to autmatically apply coupon code and add to cart: https://testsite.com/checkout/?add-to-cart=Product_ID&quantity=1&coupon=Coupon_Code and this seems to work, when quantity is 1. But i want discount (30%) that is automatically placed when click on direct link from before, to make dynamic, for ex: Increase quantity to 2 in cart page, and coupon automatically to calculate 2 x 30$ = 60$ discount, buy 3 from same product, and calculate 3 X

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

試著忘記壹切 提交于 2019-12-06 13:33:50
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. 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 order has some used coupons if( sizeof($order->get_used_coupons()) > 0 ) { foreach( $order->get_used_coupons()

Add WooCommerce coupon code automatically based on product categories

北战南征 提交于 2019-12-06 10:09:07
I am trying to add a coupon code automatically if the cart has products from specific categories. The price must be updated in the Total after showing the discount amount. But I cant see any changes in the total, kindly help me. My code: add_action('wc_cart_product_subtotal' , 'getsubtotalc'); function getsubtotalc ($product_subtotal, $_product, $quantity, $object) { if( is_cart() || is_checkout() ) { global $woocommerce, $product; global $total_qty; /*$coupon_code = 'drawer'; if ( $woocommerce->cart->has_discount( $coupon_code ) ) return;*/ foreach ( $woocommerce->cart->cart_contents as

Deleting a large number of Magento coupons (shopping cart price rules) programatically

≯℡__Kan透↙ 提交于 2019-12-05 09:59:31
I've been on here before asking about writing code to get Magento to generate a random coupon code for a new e-mail subscriber - Creating a single random Magento coupon This code worked perfectly and to those who helped I am eternally grateful. I am now looking for a way to delete these coupons as they expire in a bulk fashion because deleting them individually through the Magento admin is a huge pain. As you can see from the picture below, in the span of a couple of days we generated over 300 coupons (all now expired). Would modifying the create coupon code detailed in the link (from my

magento: URL querystring for adding product and applying discount coupon to cart

吃可爱长大的小学妹 提交于 2019-12-05 01:45:24
问题 I am a newbie, after extensive research and exploration I am able to figure out the following: To add a product to cart I can use /checkout/cart/add?product= 76 &qty= 1 to apply discount code I can use /checkout/cart/couponPost?coupon_code= WQ9D-XXXX The code for it resides in file: /public_html/app/code/local/Mage/Checkout/controllers/ - I would like to add product and apply discount code in one link such as: /checkout/cart/couponPost?product= 76 &qty= 1 &coupon_code= WQ9D-XXXX OR /checkout

Fix maximum coupon Discount On Cart percentage in WooCommerce

我的未来我决定 提交于 2019-12-03 20:21:31
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. 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 XYZ25 coupon code and if the cart total is up to Rs.1000, it will replace XYZ25 coupon by FIX250 displaying at

magento: URL querystring for adding product and applying discount coupon to cart

二次信任 提交于 2019-12-03 17:36:52
I am a newbie, after extensive research and exploration I am able to figure out the following: To add a product to cart I can use /checkout/cart/add?product= 76 &qty= 1 to apply discount code I can use /checkout/cart/couponPost?coupon_code= WQ9D-XXXX The code for it resides in file: /public_html/app/code/local/Mage/Checkout/controllers/ - I would like to add product and apply discount code in one link such as: /checkout/cart/couponPost?product= 76 &qty= 1 &coupon_code= WQ9D-XXXX OR /checkout/cart/add?product= 76 &qty= 1 &coupon_code= WQ9D-XXXX OR Any other means? Is there a way to get this

Unlink coupon form on Woocommerce checkout page

早过忘川 提交于 2019-12-02 01:11:30
Which file do I need to edit if I don’t want user to click the link to apply the coupon code? In simple, I want no LINK to be clicked on. I want the apply coupon appear below the text "Have a coupon?" so that user can ALWAYS see the section. Updated This can be done very easily using dedicated woocommerce_checkout_coupon_message filter hook: add_filter( 'woocommerce_checkout_coupon_message', 'custom_checkout_coupon_message', 20, 1 ); function custom_checkout_coupon_message( $message ) { ?> <script type='text/javascript'> jQuery(document).ready( function($){ setTimeout(function(){ $('form