coupon

Create multiple coupons programmatically in WooCommerce 3+

天大地大妈咪最大 提交于 2020-08-26 04:23:52
问题 In wooCommerce, I am using the following code to create programmatically a single coupon: $coupon_amount = '20'; $code_value = wp_generate_password( 15, false ); $coupon_code = $code_value; $expiry_date = date('Y-m-d', strtotime('+140 days')); function create_coupon_codes($coupon_amount, $coupon_code, $expiry_date, $email_address) { global $wpdb; $sql = $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type = 'shop_coupon' AND post_status = 'publish' ORDER BY post

Add the Coupon Code names to Woocommerce View Order details and email notifications

|▌冷眼眸甩不掉的悲伤 提交于 2020-07-29 07:04:47
问题 I noticed that in the View Order Details and email confirmations, it reflects a discount line, but doesn't state the actual Discount Code used. Furthermore, if the discount code is $0.00 (we sometimes have a $0 code for special tracking purposes), it won't even show the code at all. I spent all day trying to find a solution -- can someone give some guidance on this? Thanks. I got this working so far to get the actual coupon code: add_action( 'woocommerce_order_details_after_order_table',

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

左心房为你撑大大i 提交于 2020-07-15 03:54:09
问题 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

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

假装没事ソ 提交于 2020-07-15 03:53:44
问题 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