hook-woocommerce

Display custom stock message if “Manage Stock” is not enabled in WooCommerce

a 夏天 提交于 2020-07-28 00:17:47
问题 If Enable stock management at the product level is not checked I would like to show a message in product page for the stock status When the Stock status is instock - "Available" outofstock - "Out of stock" onbackorder - "Available after 4-7days" is it possible.? 回答1: With the following code you can check the stock status and adjust the message accordingly. function change_stock_message( $text, $product ) { // Managing stock NOT checked if ( !$product->managing_stock() ) { // Get stock status

Display custom stock message if “Manage Stock” is not enabled in WooCommerce

浪子不回头ぞ 提交于 2020-07-28 00:16:02
问题 If Enable stock management at the product level is not checked I would like to show a message in product page for the stock status When the Stock status is instock - "Available" outofstock - "Out of stock" onbackorder - "Available after 4-7days" is it possible.? 回答1: With the following code you can check the stock status and adjust the message accordingly. function change_stock_message( $text, $product ) { // Managing stock NOT checked if ( !$product->managing_stock() ) { // Get stock status

Display custom stock message if “Manage Stock” is not enabled in WooCommerce

我怕爱的太早我们不能终老 提交于 2020-07-28 00:14:24
问题 If Enable stock management at the product level is not checked I would like to show a message in product page for the stock status When the Stock status is instock - "Available" outofstock - "Out of stock" onbackorder - "Available after 4-7days" is it possible.? 回答1: With the following code you can check the stock status and adjust the message accordingly. function change_stock_message( $text, $product ) { // Managing stock NOT checked if ( !$product->managing_stock() ) { // Get stock status

Sort order items by SKU in Woocommerce admin order pages [duplicate]

落爺英雄遲暮 提交于 2020-07-23 07:39:29
问题 This question already has answers here : Sorting order items by SKU in Woocommerce (2 answers) Closed 4 days ago . I'm stumped if it's possible. I have scouted to only seeing results to sort by SKU on the front end. not the backend. When you edit an order, I want there to be an SKU column that I can sort by ASC/DESC . Is there a plugin out there that achieves this, or a snippet of code that can add in an additional column? Any help would be greatly appreciated. Below is an image illustrating

Sort order items by SKU in Woocommerce admin order pages [duplicate]

孤人 提交于 2020-07-23 07:38:19
问题 This question already has answers here : Sorting order items by SKU in Woocommerce (2 answers) Closed 4 days ago . I'm stumped if it's possible. I have scouted to only seeing results to sort by SKU on the front end. not the backend. When you edit an order, I want there to be an SKU column that I can sort by ASC/DESC . Is there a plugin out there that achieves this, or a snippet of code that can add in an additional column? Any help would be greatly appreciated. Below is an image illustrating

Sort order items by SKU in Woocommerce admin order pages [duplicate]

假如想象 提交于 2020-07-23 07:37:09
问题 This question already has answers here : Sorting order items by SKU in Woocommerce (2 answers) Closed 4 days ago . I'm stumped if it's possible. I have scouted to only seeing results to sort by SKU on the front end. not the backend. When you edit an order, I want there to be an SKU column that I can sort by ASC/DESC . Is there a plugin out there that achieves this, or a snippet of code that can add in an additional column? Any help would be greatly appreciated. Below is an image illustrating

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

woocommerce_email_attachments hook with empty $order argument in Woocommerce

谁说我不能喝 提交于 2020-07-21 07:31:26
问题 The person building a WP site for me is stuck for some time now with this problem. He needs to attach some custom PDF files into the order confirmation mail. He uses woocommerce_emails_attach_downloadables function to do that. For some reason that function is getting called with the $order parameter being empty. Here is the code he uses : add_filter( 'woocommerce_email_attachments', 'attach_order_notice', 10, 3 ); function attach_order_notice ( $attachments, $email_id, $order ) { // // Only

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(