woocommerce

Sort Order Items by “menu order” in WooCommerce order edit pages

橙三吉。 提交于 2021-02-07 09:15:21
问题 I use this function to sort Woocommerce order admin items by menu order but But products with variables do not display properly. And if there are several product with variables in the order, only one of them will be displayed. edit: we have problem with multiple items of a product with different attributes: item1: product A,variable a,attribute: red color, qty 12 item2: Product A, variable a, attribute: green color, qty 18 after sort it only shows : item1: product A,variable a,attribute: red

Load specific element on Woocommerce product category archives

拥有回忆 提交于 2021-02-07 08:27:50
问题 is their a way via the functions.php or an other php method to don't load a specific div element on the shop / main page in woocommerce? <div id="nm-shop" class="nm-shop nm-shop-sidebar-header images-lazyload images-show" style="min-height: 288px;"> ... </div> This code includes a filter and the product archives of my shop page, but i only wanna display this at the category pages, where it already works, but not on the main page. How can i stop loading this div element on the shop / main page

Load specific element on Woocommerce product category archives

两盒软妹~` 提交于 2021-02-07 08:27:35
问题 is their a way via the functions.php or an other php method to don't load a specific div element on the shop / main page in woocommerce? <div id="nm-shop" class="nm-shop nm-shop-sidebar-header images-lazyload images-show" style="min-height: 288px;"> ... </div> This code includes a filter and the product archives of my shop page, but i only wanna display this at the category pages, where it already works, but not on the main page. How can i stop loading this div element on the shop / main page

Get the product ID in WooCommerce 3+ Order items

限于喜欢 提交于 2021-02-07 08:01:49
问题 I am trying to get woocommerce thank you page order_id. Using the code below. But unfortunately I can't get it. add_action( 'woocommerce_thankyou', 'bbloomer_check_order_product_id'); function bbloomer_check_order_product_id( $order_id ){ $order = new WC_Order( $order_id ); $items = $order->get_items(); foreach ( $items as $item ) { $product_id = $item['product_id']; if ( $product_id == XYZ ) { // do something } } } 回答1: This code is outdated for WooCommerce version 3+. You should use instead

Add an additional cost to flat rate shipping each 3 items in Woocommerce

百般思念 提交于 2021-02-07 06:38:28
问题 I'm running a woocommerce shop and using a Flat Rate shipping $15 . I have written a formula to add $1.25 for each additional item. 13.50 + ( 1.25 * [qty]) Sipping "flat rate settings | $1.25 for Additional Each Item: But I want to add this cost $1.25 for every 3 items. I mean 3, 6, 9, 12 and so on... Can anyone tell me how to do this? Any help is appreciated. 回答1: Updated (2021) The following code will add an additional cost to flat rate shipping method each 3 items (3, 6, 9 …) . You will

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

Get the order fee item details in Woocommerce 3

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-07 03:28:24
问题 I try to get the name of the fee attached to my order in Woocommerce, I get an array but I don't know how to get the name. I tried with function get_name () but it does not work. $the_order->get_items( array( 'line_item', 'fee', 'shipping' ) ); Raw data output: [137] => WC_Order_Item_Fee Object ( [extra_data:protected] => Array ( [tax_class] => [tax_status] => taxable [amount] => [total] => [total_tax] => [taxes] => Array ( [total] => Array ( ) ) ) [data:protected] => Array ( [order_id] =>

Get the order fee item details in Woocommerce 3

五迷三道 提交于 2021-02-07 03:27:38
问题 I try to get the name of the fee attached to my order in Woocommerce, I get an array but I don't know how to get the name. I tried with function get_name () but it does not work. $the_order->get_items( array( 'line_item', 'fee', 'shipping' ) ); Raw data output: [137] => WC_Order_Item_Fee Object ( [extra_data:protected] => Array ( [tax_class] => [tax_status] => taxable [amount] => [total] => [total_tax] => [taxes] => Array ( [total] => Array ( ) ) ) [data:protected] => Array ( [order_id] =>