hook-woocommerce

Can't Change WooCommerce Coupon Label In Cart Totals

十年热恋 提交于 2021-02-08 07:59:24
问题 This has proven to be a challenge I can't figure out. I handled the renaming of "Coupon" to "Promo" pretty much everywhere else. However, the renaming of the WC LABEL that calls the name of the coupon and the LABEL is a lot harder. Here's a screenshot of what I'm talking about exactly: I've pretty much renamed all the uses of "coupon" to "promo" site-wide. This one is making my hair fall out. Has anyone ever successfully changed this? What am I missing? Rename "Coupon" to "Promo" code below /

Hiding order status in My Account recent orders list page

帅比萌擦擦* 提交于 2021-02-08 07:34:46
问题 In WooCommerce, I have a Woocommerce site and on the customer's recent orders page, there is a table with order details on this example link: https://example.com/my-account/view-order/ I would like to completely hide order status from the table if possible. How can I achieve this? Thanks 回答1: Updated: Just use this custom function hooked in woocommerce_my_account_my_orders_columns filter hook: add_filter('woocommerce_my_account_my_orders_columns', 'custom_removing_order_status', 10, 1);

Pre populate Woocommerce checkout fields

时间秒杀一切 提交于 2021-02-08 06:33:48
问题 I am trying to pre-populate additional fields in the woocommerce checkout page but I am struggling with it. add_filter('woocommerce_checkout_get_value', function($input, $key ) { global $current_user; switch ($key) : case 'billing_first_name': case 'shipping_first_name': return $current_user->first_name; break; case 'billing_last_name': case 'shipping_last_name': return $current_user->last_name; case 'billing_phone': return $current_user->phone; break; case 'billing_company': case 'shipping

Pre populate Woocommerce checkout fields

时间秒杀一切 提交于 2021-02-08 06:33:29
问题 I am trying to pre-populate additional fields in the woocommerce checkout page but I am struggling with it. add_filter('woocommerce_checkout_get_value', function($input, $key ) { global $current_user; switch ($key) : case 'billing_first_name': case 'shipping_first_name': return $current_user->first_name; break; case 'billing_last_name': case 'shipping_last_name': return $current_user->last_name; case 'billing_phone': return $current_user->phone; break; case 'billing_company': case 'shipping

Add a profile picture (file upload) on My account > edit account in WooCommerce

*爱你&永不变心* 提交于 2021-02-08 05:28:16
问题 I want to add a upload profile image field and save it on My account > edit account without any plugin in woocommerce. I added the below code in functions.php to add the profile picture on the my account page. add_action( 'woocommerce_edit_account_form', 'add_profile_imageto_edit_account_form' ); function add_profile_imageto_edit_account_form() { $user = wp_get_current_user(); ?> <p class="woocommerce-form-row woocommerce-form-row--wide form-row form-row-wide"> <label for="favorite_color"><

Display a custom div block for woocommerce out of stock product variations

旧时模样 提交于 2021-02-08 03:32:30
问题 In Woocommerce, I'm trying to make a custom div container visible when a variation of variable product is out of stock, but available on backorder. So by default it's hidden. But when a customer selects a variation that's out of stock, but available on backorder, it will show the div blocks I've written. I've placed this div block inside the short description of the product, since that is the place where I want to have it visible when it is out of stock. Or at least, I want to have it above

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

Display last WooCommerce admin order note in customers order history

拈花ヽ惹草 提交于 2021-02-07 19:57:35
问题 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

Change “add to cart” text if a user has bought specific products in WooCommerce

懵懂的女人 提交于 2021-02-05 12:13:37
问题 I wanted to know if there is a way to replace the woo-commerce "add to cart" button with custom text and url for a specific product if the user has bought that specific product. and I want it happens everywhere (on shop page,product page , ...) 回答1: Try the following that will change the product "add to cart" text if that product has already been bought by the customer on single product pages and archive pages add_filter( 'woocommerce_product_add_to_cart_text', 'custom_add_to_cart_text', 900,

Change “add to cart” text if a user has bought specific products in WooCommerce

点点圈 提交于 2021-02-05 12:13:34
问题 I wanted to know if there is a way to replace the woo-commerce "add to cart" button with custom text and url for a specific product if the user has bought that specific product. and I want it happens everywhere (on shop page,product page , ...) 回答1: Try the following that will change the product "add to cart" text if that product has already been bought by the customer on single product pages and archive pages add_filter( 'woocommerce_product_add_to_cart_text', 'custom_add_to_cart_text', 900,