checkout

How to blank all WooCommerce checkout fields by default except country?

本小妞迷上赌 提交于 2021-02-08 02:30:16
问题 On my WooCommerce checkout page, I want the billing fields to be blank except for the billing country. I'm using this to make sure the checkout form is blank when it gets filled out: add_filter('woocommerce_checkout_get_value','__return_empty_string',10); However, I do want the billing country field to be filled out, and default to the US. So I've got this: add_filter( 'default_checkout_billing_country', 'change_default_checkout_country' ); function change_default_checkout_country() { return

Add product description to cart items in Woocommerce

 ̄綄美尐妖づ 提交于 2021-02-07 19:42:07
问题 I'm struggling to find a simple solution to this problem I'm having with One-page-checkout plugin for Woocommerce. My client would like to add the product description next to the product title in cart items. Any thoughts on how I can manipulate the code to show the description? This is what I have actually: I would think that this plugin would just be hiding the description somewhere but I can't locate it anywhere in the code. 回答1: There is 2 ways to do it (making work for products and

Custom WooCommerce datepicker checkout field saved and displayed on orders and emails

扶醉桌前 提交于 2021-02-07 10:43:10
问题 I have added a new custom datepicker field on the WooCommerce checkout page. I am using Enabling a date-picker in Woocommerce checkout fields . All it's OK On checkout page. But now I really don't know how can I save and add this new field on the order notes. Any help is appreciated. 回答1: Section 1 The following will display a custom datepicker field on checkout, it will validate the field and save It. The chosen date will be displayed on admin order, customer order and emails To include this

Save and display order item custom meta data in Woocommerce

倾然丶 夕夏残阳落幕 提交于 2021-02-07 09:52:36
问题 I have some custom code was working perfectly and since I have updated Woocommerce to version 3.5.2 it is not working anymore, not sure if it is because I changed the wordpress theme or because because plugin updates. My problem is that the value of the custom fields doesn't appear on the order page from woocommerce or even on the order email. Here is the related code: // Display Fields using WooCommerce Action Hook add_action('woocommerce_product_options_general_product_data', 'woocom

Save and display order item custom meta data in Woocommerce

别说谁变了你拦得住时间么 提交于 2021-02-07 09:51:47
问题 I have some custom code was working perfectly and since I have updated Woocommerce to version 3.5.2 it is not working anymore, not sure if it is because I changed the wordpress theme or because because plugin updates. My problem is that the value of the custom fields doesn't appear on the order page from woocommerce or even on the order email. Here is the related code: // Display Fields using WooCommerce Action Hook add_action('woocommerce_product_options_general_product_data', 'woocom

Save and display order item custom meta data in Woocommerce

我是研究僧i 提交于 2021-02-07 09:51:30
问题 I have some custom code was working perfectly and since I have updated Woocommerce to version 3.5.2 it is not working anymore, not sure if it is because I changed the wordpress theme or because because plugin updates. My problem is that the value of the custom fields doesn't appear on the order page from woocommerce or even on the order email. Here is the related code: // Display Fields using WooCommerce Action Hook add_action('woocommerce_product_options_general_product_data', 'woocom

Add a discount for specific selected payment method in WooCommerce

 ̄綄美尐妖づ 提交于 2021-02-07 04:19:47
问题 Without a using coupon functionality I would like to apply a 15% discount for a specific payment method ID like 'xyz'. I would like help identifying which hooks to use. The general idea of what I would like to achieve is: if payment_method_hook == 'xyz'{ cart_subtotal = cart_subtotal - 15% } The customer does not need to see the discount on this page. I would like the discount to be submitted properly, only for the specific payment method. 回答1: You can use this custom function hooked in

WooCommerce check and redirect to login before checkout

我们两清 提交于 2021-02-07 04:17:07
问题 The default Woocommerce checkout behavior breaks a lot of web conventions by showing the "Create Account" boxes on the checkout page if it detects the user is not logged in. New users may not know what to do without any added instructions. My desired sequence would be: User Checkout > Check login > Proceed to checkout if logged in. Redirect to login/register page if not logged in > proceed to the checkout page. This is EXACTLY the case in WooCommerce login redirect based on cart However, what

WooCommerce check and redirect to login before checkout

て烟熏妆下的殇ゞ 提交于 2021-02-07 04:17:06
问题 The default Woocommerce checkout behavior breaks a lot of web conventions by showing the "Create Account" boxes on the checkout page if it detects the user is not logged in. New users may not know what to do without any added instructions. My desired sequence would be: User Checkout > Check login > Proceed to checkout if logged in. Redirect to login/register page if not logged in > proceed to the checkout page. This is EXACTLY the case in WooCommerce login redirect based on cart However, what

Conditionally customizing WooCommerce checkout fields

孤者浪人 提交于 2021-02-06 14:17:31
问题 I am trying to modify WooCommerce check out fields. There are two points I want to reach. Conditional fields I want to make conditional fields for different shipping type in shipping section. To reach this point, Javascript is used. Administrator can edit the custom fields in the order on back-end As a result, I write the code as below. However, I met a problem. My javascript cannot work on the front-end. Does anybody can help me? //修改check out shipping field add_action( 'woocommerce_before