hook-woocommerce

Woocommerce Short_Description in Details Order

好久不见. 提交于 2020-08-23 07:56:19
问题 I'm creating my new website with Wordpress and Woocommerce. I would like to display the short description in the order detail. I found this code : add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_single_excerpt', 5); But that shows me the description in home. Is there a way to make it appear in the order detail? 回答1: It can be done with a custom unction hooked in woocommerce_order_item_name filter hook, this way: add_filter( 'woocommerce_order_item_name', 'add

Woocommerce Short_Description in Details Order

半城伤御伤魂 提交于 2020-08-23 07:56:10
问题 I'm creating my new website with Wordpress and Woocommerce. I would like to display the short description in the order detail. I found this code : add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_single_excerpt', 5); But that shows me the description in home. Is there a way to make it appear in the order detail? 回答1: It can be done with a custom unction hooked in woocommerce_order_item_name filter hook, this way: add_filter( 'woocommerce_order_item_name', 'add

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

How to add Custom Description field in Shipping methods (Backend)

南楼画角 提交于 2020-08-03 14:07:15
问题 I want to add a custom field in Shipping Zone page under shipping method, it will be a text input, the user will able to add a custom message and I'll show that message in the front end. I noticed it saves the data in wp_woocommerce_shipping_zone_methods table which doesn't have any extra column to save the data; so I think I have to use my custom logic, but I don't know the name of the hook(s). So my question is, is there is any hook which will help/allow me To add a custom field. To add a

How to add Custom Description field in Shipping methods (Backend)

允我心安 提交于 2020-08-03 14:05:15
问题 I want to add a custom field in Shipping Zone page under shipping method, it will be a text input, the user will able to add a custom message and I'll show that message in the front end. I noticed it saves the data in wp_woocommerce_shipping_zone_methods table which doesn't have any extra column to save the data; so I think I have to use my custom logic, but I don't know the name of the hook(s). So my question is, is there is any hook which will help/allow me To add a custom field. To add a

Custom meta data added to Woocommerce not displayed in order item meta

流过昼夜 提交于 2020-07-30 08:07:30
问题 I've a single piece of custom metadata to a WooCommerce order and now I want to display this on the thank you page after checkout, however, the data isn't available. The data is saved and available in the admin, I just can't seem to access it. function custom_order_item_meta( $item_id, $values ) { if ( ! empty( $values['custom_option'] ) ) { woocommerce_add_order_item_meta( $item_id, 'custom_option', $values['custom_option'] ); } } add_action( 'woocommerce_add_order_item_meta', 'custom_order

Custom meta data added to Woocommerce not displayed in order item meta

一笑奈何 提交于 2020-07-30 08:07:09
问题 I've a single piece of custom metadata to a WooCommerce order and now I want to display this on the thank you page after checkout, however, the data isn't available. The data is saved and available in the admin, I just can't seem to access it. function custom_order_item_meta( $item_id, $values ) { if ( ! empty( $values['custom_option'] ) ) { woocommerce_add_order_item_meta( $item_id, 'custom_option', $values['custom_option'] ); } } add_action( 'woocommerce_add_order_item_meta', 'custom_order

Additional action buttons to admin order list on Preview Lightbox in Woocommerce 3.3+

a 夏天 提交于 2020-07-30 03:43:06
问题 In Woocommerce Admin orders list, when clicking the icon "eye" , it opens a preview of the order in a Lightbox. At the bottom of that Lightbox (preview), there are some actions buttons that allow to change the order status. I have 5 more custom order statuses that I would like to add as action buttons too, but I don't know which hook I need to use. Does anyone know how to add more buttons to that area? Any help or advice is appreciated. 回答1: The correct hook to get this done is woocommerce