checkout

Show SKU on cart and checkout pages in Woocommerce 3

若如初见. 提交于 2020-08-22 06:38:32
问题 I would like to display SKU on cart (Under product column ) and checkout page. I searched SO, but all answers are for old versions of WooCommerce and non of them is for 3.x. How can I show SKU on cart and checkout pages in Woocommerce 3? 回答1: 2020 Update: How display product SKU directly under item name in WooCommerce? You can do it with a custom unction hooked in woocommerce_cart_item_name action hook, this way: add_filter( 'woocommerce_cart_item_name', 'showing_sku_in_cart_items', 99, 3 );

How to set a purchase limit at checkout with a minimum weight requirement for a certain category?

China☆狼群 提交于 2020-08-09 10:54:27
问题 I try to set a purchase limit before check out, namely: A minimum weight requirement for the category ' formaggi ' The shop has 8 categories of products, however, the intention is to only check on 1 category. I'm using this snippet but it doesn't work with the category, neither for the minimum weight requirement. /*PESO MINIMO CATEGORIA FORMAGGI 750GR - RAFFO 14mar2020*/ add_action( 'woocommerce_check_cart_items', 'cldws_set_weight_requirements' ); function cldws_set_weight_requirements() { /

How to set a purchase limit at checkout with a minimum weight requirement for a certain category?

醉酒当歌 提交于 2020-08-09 10:54:17
问题 I try to set a purchase limit before check out, namely: A minimum weight requirement for the category ' formaggi ' The shop has 8 categories of products, however, the intention is to only check on 1 category. I'm using this snippet but it doesn't work with the category, neither for the minimum weight requirement. /*PESO MINIMO CATEGORIA FORMAGGI 750GR - RAFFO 14mar2020*/ add_action( 'woocommerce_check_cart_items', 'cldws_set_weight_requirements' ); function cldws_set_weight_requirements() { /

Clear only some checkout fields values in Woocommerce

不打扰是莪最后的温柔 提交于 2020-08-07 09:42:09
问题 In Woocommerce i am trying to clear the checkout fields. so when a user that has ordered something before, and is now ordering something again, he/she will have to write in all his/her information again. i am using this code function clear_checkout_fields($input){ return ''; } add_filter( 'woocommerce_checkout_get_value' , 'clear_checkout_fields' , 1); Now this code is clearing all the fields, but it also changes my VAT to show as 0. does anyone know a solution to this? 回答1: There is some

Force to buy only predefined quantities at checkout in WooCommerce

与世无争的帅哥 提交于 2020-07-23 06:32:49
问题 My ecommerce made with WooCommerce sells 12 ready meals. The customer can also purchase only 1 meal per type. But it must necessarily reach the exact sum of: 5 or 12 or 24 or 36 products. Why? Ready meals are shipped in isothermal boxes that contain a precise number of ready meals. There are 4 types of isothermal boxes and they contain: 5 meals, 12 meals, 24 meals or 36 meals So I have to force to buy only 5, 12, 24, or 36 meals at checkout on the cart page. This figure can also be reached by

Force to buy only predefined quantities at checkout in WooCommerce

﹥>﹥吖頭↗ 提交于 2020-07-23 06:31:50
问题 My ecommerce made with WooCommerce sells 12 ready meals. The customer can also purchase only 1 meal per type. But it must necessarily reach the exact sum of: 5 or 12 or 24 or 36 products. Why? Ready meals are shipped in isothermal boxes that contain a precise number of ready meals. There are 4 types of isothermal boxes and they contain: 5 meals, 12 meals, 24 meals or 36 meals So I have to force to buy only 5, 12, 24, or 36 meals at checkout on the cart page. This figure can also be reached by

Check WooCommerce User Role and Payment Gateway and if they match - Apply fee

♀尐吖头ヾ 提交于 2020-07-21 06:37:15
问题 I'm struggling with applying a fee for an array of user roles if and when a specific payment gateway is selected. The code I've written works fine if I do not check the user role, but once I try and do that, it does not. I've removed (commented) the user role if statement in the code and I'm asking for help making it work. I need to check if the user role match my array and if it does, check the payment gateway. If the payment gateway match too, apply the fee. This is my code: add_action(

Change checkout submit button text for a specific payment method in WooCommerce

℡╲_俬逩灬. 提交于 2020-07-07 17:53:48
问题 I need to change the order_button_text for a specific payment gateway (COD in this case). I could only get it to change globally (for all payment gateways) using: add_action( 'woocommerce_after_add_to_cart_button', 'multiple_orders_text' ); function woo_custom_order_button_text() { return __( 'Request Shipping Quote', 'woocommerce' ); } But have found that if I add the line $this->order_button_text = __( 'Request a Quote', 'woocommerce' ); to the setup_properties() method in woocommerce

Add dropdown list of cities in Woocommerce checkout page

柔情痞子 提交于 2020-07-03 00:53:28
问题 I want to add specific cities list in dropdown in checkout page of Woocommerce. Any best solution to add a dropdown of specific cities. I want to add dropdown on this website http://www.pkbrand.com 回答1: It can be done using a custom function hooked in woocommerce_checkout_fields action hook, where you will define in an array your desired cities: // Change "city" checkout billing and shipping fields to a dropdown add_filter( 'woocommerce_checkout_fields' , 'override_checkout_city_fields' );

Add dropdown list of cities in Woocommerce checkout page

◇◆丶佛笑我妖孽 提交于 2020-07-03 00:50:33
问题 I want to add specific cities list in dropdown in checkout page of Woocommerce. Any best solution to add a dropdown of specific cities. I want to add dropdown on this website http://www.pkbrand.com 回答1: It can be done using a custom function hooked in woocommerce_checkout_fields action hook, where you will define in an array your desired cities: // Change "city" checkout billing and shipping fields to a dropdown add_filter( 'woocommerce_checkout_fields' , 'override_checkout_city_fields' );