orders

Save and display product custom meta on WooCommerce orders and emails

一曲冷凌霜 提交于 2020-08-26 06:51:13
问题 OK, so basically we created a custom field using ACF in our WooCommerce Store in order to add a "Shipping Delay" notice for specific products. Here is a demonstration of what we achieved: https://www.safe-company.com/shop/machines/uvc-disinfection-lamp/ Single Product Page Reference Image We managed then to put this notice in the single product page using Elementor (A page builder) and then add this information to the item data in the cart and checkout page with the following code added to

Change Order item prices in Woocommerce 3

拟墨画扇 提交于 2020-08-23 09:46:05
问题 I need to change the item price in a woocommerce order but everything I found is to changing the price in the cart but this is not what I need because I need to change after the checkout process. Does somebody can give me a clue on how to do that? 回答1: You need to use the new CRUD setters methods introduced with Woocommerce 3: For order object you will use WC_Order methods, For order "line item" you will use WC_Order_Item_Product methods, For both of them you could be also use some WC_Data

Woocommerce Short_Description in Details Order

 ̄綄美尐妖づ 提交于 2020-08-23 07:56:29
问题 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: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

Disable specific payment methods depending on Woocommerce order status

爱⌒轻易说出口 提交于 2020-08-20 03:56:42
问题 I made a two-step payment on the site. Payment occurs after confirmation of the order by the manager. First, the user selects the payment method "for confirmation"(renamed "cash on delivery") and pay only after receiving the invoice for payment. On the checkout page, I hide paypal via js. I would like paypal to be hidden when on-hold status. When the status of "Pending payment" is disabled "for confirmation"(renamed "cash on delivery") and payment via paypal is available. 回答1: Update July

Remove cancel button from WooCommerce My account Orders conditionally

不羁的心 提交于 2020-08-19 05:26:09
问题 I want to make sure the cancel button is not visible in my-account> my-order when 'Payment Method Title' is 'Npay'. The 'Npay' is an external payment gateway and does not work with the commerce. Therefore, payment cancellation must be done externally only. add_filter('woocommerce_my_account_my_orders_actions', 'remove_my_cancel_button', 10, 2); function remove_my_cancel_button($actions, $order){ if ( $payment_method->has_title( 'Npay' ) ) { unset($actions['cancel']); return $actions; } } 回答1:

Display ALL available shipping methods for each specific order on admin edit order pages in Woocommerce

感情迁移 提交于 2020-08-10 19:00:29
问题 On the checkout page of my WooCommerce based site, users will have a list of shipping methods to choose from depending on what they are purchasing This is the list I want to capture: Things like “Free Shipping” for orders over a certain price “Freight Shipping” for certain items, and so on. My goal, is to display ALL available methods for each specific order , and display it on the “Edit Order / Order Details” page in the Admin view. A small feature that would help us be able to quickly