wordpress

Woocommerce custom coupon type with custom discount always return 0;

拟墨画扇 提交于 2021-02-18 18:12:58
问题 what I am trying to do is creating custom coupon type with custom programmatically discount in woocommerce using hooks. This what my code looks like //add new coupon type called "custom_discount" function custom_discount_type( $discount_types ) { $discount_types['custom_discount'] =__( 'custom discount', 'woocommerce' ); return $discount_types; } // add the hooks add_filter( 'woocommerce_coupon_discount_types', 'custom_discount_type',10, 1); //function to get coupon amount for "custom

Woocommerce custom coupon type with custom discount always return 0;

a 夏天 提交于 2021-02-18 18:12:35
问题 what I am trying to do is creating custom coupon type with custom programmatically discount in woocommerce using hooks. This what my code looks like //add new coupon type called "custom_discount" function custom_discount_type( $discount_types ) { $discount_types['custom_discount'] =__( 'custom discount', 'woocommerce' ); return $discount_types; } // add the hooks add_filter( 'woocommerce_coupon_discount_types', 'custom_discount_type',10, 1); //function to get coupon amount for "custom

Format billing phone number on WooCommerce checkout

南楼画角 提交于 2021-02-18 18:12:01
问题 For the WooCommerce checkout billing field, how can I make this field require 9 numbers and insert dashes for proper phone formatting? For example, instead of typing out 3053453212 in the phone number field, it displays: (305-345-3212) 回答1: Based on "Formatting a phone number in a form using jquery" answer code, here is the way to format the Woocommerce billing phone: add_action('wp_footer', 'format_checkout_billing_phone'); function format_checkout_billing_phone() { if ( is_checkout() && !

Format billing phone number on WooCommerce checkout

若如初见. 提交于 2021-02-18 18:11:12
问题 For the WooCommerce checkout billing field, how can I make this field require 9 numbers and insert dashes for proper phone formatting? For example, instead of typing out 3053453212 in the phone number field, it displays: (305-345-3212) 回答1: Based on "Formatting a phone number in a form using jquery" answer code, here is the way to format the Woocommerce billing phone: add_action('wp_footer', 'format_checkout_billing_phone'); function format_checkout_billing_phone() { if ( is_checkout() && !

Format billing phone number on WooCommerce checkout

笑着哭i 提交于 2021-02-18 18:09:21
问题 For the WooCommerce checkout billing field, how can I make this field require 9 numbers and insert dashes for proper phone formatting? For example, instead of typing out 3053453212 in the phone number field, it displays: (305-345-3212) 回答1: Based on "Formatting a phone number in a form using jquery" answer code, here is the way to format the Woocommerce billing phone: add_action('wp_footer', 'format_checkout_billing_phone'); function format_checkout_billing_phone() { if ( is_checkout() && !

Format billing phone number on WooCommerce checkout

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-18 18:08:59
问题 For the WooCommerce checkout billing field, how can I make this field require 9 numbers and insert dashes for proper phone formatting? For example, instead of typing out 3053453212 in the phone number field, it displays: (305-345-3212) 回答1: Based on "Formatting a phone number in a form using jquery" answer code, here is the way to format the Woocommerce billing phone: add_action('wp_footer', 'format_checkout_billing_phone'); function format_checkout_billing_phone() { if ( is_checkout() && !

MySQL keeps crashing

寵の児 提交于 2021-02-18 11:19:30
问题 I Have a server in the cloud running Ubuntu 12.10, with 512Mb of RAM just to run a wordpress website (with approx 1000 visits/day). MySQL was always crashing then I enabled a 4Gb swap to see if can works... but still crashing... and I need to restart the service every time... Checking the error log from mysql I noticed that InnoDB appears to be in a loop trying to recover something but I think it can't... can anyone help me? 131009 17:56:57 InnoDB: 5.5.32 started; log sequence number

MySQL keeps crashing

非 Y 不嫁゛ 提交于 2021-02-18 11:17:18
问题 I Have a server in the cloud running Ubuntu 12.10, with 512Mb of RAM just to run a wordpress website (with approx 1000 visits/day). MySQL was always crashing then I enabled a 4Gb swap to see if can works... but still crashing... and I need to restart the service every time... Checking the error log from mysql I noticed that InnoDB appears to be in a loop trying to recover something but I think it can't... can anyone help me? 131009 17:56:57 InnoDB: 5.5.32 started; log sequence number

Woocommerce sort cart products by product category

▼魔方 西西 提交于 2021-02-18 08:46:40
问题 The Problem I would like to make it so my Woocommerce cart shows products in order of product category. (My products are assigned to a brand, and i want the products to appear in the cart area under their assigned brands.) What I have tried At the moment i've been able to get it to sort alphabetical by key however this is as far as my knowledge with arrays goes. Example Code add_action( 'woocommerce_cart_loaded_from_session', function() { global $woocommerce; $products_in_cart = array();

Additional columns and item values in Woocommerce email order details

假如想象 提交于 2021-02-18 08:03:24
问题 I am editing a Woocommerce email template but am a little stuck - I need to add a few columns to the order summary table so that it contains: Quantity Product Product code Price VAT I have added the table headers that I need into 'email-order-details.php' (copied to my theme's email folder) to but not sure how to get the actual content into the table. The code from the file is below: <?php /** * Order details table shown in emails. * * This template can be overridden by copying it to