woocommerce

How to display user's WooCommerce subscription details?

对着背影说爱祢 提交于 2021-02-08 03:32:26
问题 I have created a custom page template and I want to display specific details of user's subscription (e.g. subscription starting date). The available hook on 'my account' page displays this but I don't know how to dismantle the output of the hook or even merely displaying it on a page template. Any help would be appreciated! 回答1: Add the following code in functions.php of the active theme. add_shortcode('wdm_my_subscription', 'wmd_my_custom_function'); function wmd_my_custom_function(){ WC

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

How to show individual error on woocommerce checkout page

南笙酒味 提交于 2021-02-08 02:20:17
问题 Woocommerce checkout page error messages image Currently woocommerce showing error as above shown in image. I want individual error message below each input box as shown in below image. Please help. Expected output image 回答1: You need to add PHP snippet and css. add_filter( 'woocommerce_form_field', 'checkout_fields_in_label_error', 10, 4 ); function checkout_fields_in_label_error( $field, $key, $args, $value ) { if ( strpos( $field, '</span>' ) !== false && $args['required'] ) { $error = '

Show custom fields in WooCommerce quick order preview

末鹿安然 提交于 2021-02-08 02:13:42
问题 In WooCommerce admin orders list, clicking on the "eye icon" gives a quick preview for the order info. I've added custom billing checkout fields, but they are not shown in this quick preview and instead under billing details it displays "N/A": However when choose the edit order page, I can see them. How to display that billing custom fields in order quick preview? 回答1: In the code below, for each of your billing custom fields, you will have to set the correct meta key . It will display your

How to show individual error on woocommerce checkout page

ぐ巨炮叔叔 提交于 2021-02-08 02:06:14
问题 Woocommerce checkout page error messages image Currently woocommerce showing error as above shown in image. I want individual error message below each input box as shown in below image. Please help. Expected output image 回答1: You need to add PHP snippet and css. add_filter( 'woocommerce_form_field', 'checkout_fields_in_label_error', 10, 4 ); function checkout_fields_in_label_error( $field, $key, $args, $value ) { if ( strpos( $field, '</span>' ) !== false && $args['required'] ) { $error = '

Show custom fields in WooCommerce quick order preview

a 夏天 提交于 2021-02-08 02:05:08
问题 In WooCommerce admin orders list, clicking on the "eye icon" gives a quick preview for the order info. I've added custom billing checkout fields, but they are not shown in this quick preview and instead under billing details it displays "N/A": However when choose the edit order page, I can see them. How to display that billing custom fields in order quick preview? 回答1: In the code below, for each of your billing custom fields, you will have to set the correct meta key . It will display your

how to remove woocommerce container div '<div class=“woocommerce”>'

心不动则不痛 提交于 2021-02-07 21:15:56
问题 I have created a custom theme for woocommerce an copied templates folder to my theme root woocommerce . now I figured that all pages in woocommerce has a div container with class woocommerce . I want to change the class of it or remove that from my theme. I searched in my theme files <div class="woocommerce"> and I found nothing. ! is there any way to change or delete that? 回答1: No, you can't change or delete, which could break everything, read more here - https://github.com/woocommerce

how to remove woocommerce container div '<div class=“woocommerce”>'

て烟熏妆下的殇ゞ 提交于 2021-02-07 21:14:09
问题 I have created a custom theme for woocommerce an copied templates folder to my theme root woocommerce . now I figured that all pages in woocommerce has a div container with class woocommerce . I want to change the class of it or remove that from my theme. I searched in my theme files <div class="woocommerce"> and I found nothing. ! is there any way to change or delete that? 回答1: No, you can't change or delete, which could break everything, read more here - https://github.com/woocommerce

how to remove woocommerce container div '<div class=“woocommerce”>'

。_饼干妹妹 提交于 2021-02-07 21:12:10
问题 I have created a custom theme for woocommerce an copied templates folder to my theme root woocommerce . now I figured that all pages in woocommerce has a div container with class woocommerce . I want to change the class of it or remove that from my theme. I searched in my theme files <div class="woocommerce"> and I found nothing. ! is there any way to change or delete that? 回答1: No, you can't change or delete, which could break everything, read more here - https://github.com/woocommerce

Display last WooCommerce admin order note in customers order history

故事扮演 提交于 2021-02-07 20:00:14
问题 I am looking to display the last Order Note, currently only viewable via Admin in Woocommerce, on the customer side in their Order History. So they can view the tracking number we add in after the order is set as complete. https://example.com/my-account/view-order/135/ We add a customer note by first setting the order as COMPLETE via the Woocommerce API then adding an order note with the tracking link. So the tracking ref will always be the last item. How can I show the last Order Note on the