fee

Add custom tax value at woocommerce checkout

情到浓时终转凉″ 提交于 2021-02-16 14:35:12
问题 I want to add custom % value at woocommerce checkout page, but I want to show it only for Swiss country and hide it for others. Now I have the right code working for that, but the problems is that Im not able to show it when user choose switzerland. Here is a code so please help me see what Im doing wrong here //Add tax for CH country add_action( 'woocommerce_cart_calculate_fees','woocommerce_custom_surcharge' ); function woocommerce_custom_surcharge() { global $woocommerce; if ( WC()-

Add a Woocommerce fee based on shipping class and item quantity

纵然是瞬间 提交于 2021-02-08 05:47:42
问题 In Woocommerce I am trying to add a shipping fee if a cart item has a specific shipping class assigned to the related product. I would like this shipping fee to be multiplied by the cart item quantity… I have this working when a product is added to the cart and the quantity is increased and the additional shipping fee is increased also. However if I add another product with the same shipping class and increase the quantity the additional fee does not increase. This is my code: // Add

Add a Woocommerce fee based on shipping class and item quantity

穿精又带淫゛_ 提交于 2021-02-08 05:47:00
问题 In Woocommerce I am trying to add a shipping fee if a cart item has a specific shipping class assigned to the related product. I would like this shipping fee to be multiplied by the cart item quantity… I have this working when a product is added to the cart and the quantity is increased and the additional shipping fee is increased also. However if I add another product with the same shipping class and increase the quantity the additional fee does not increase. This is my code: // Add

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] =>

Get the order fee item details in Woocommerce 3

自作多情 提交于 2021-02-07 03:26:31
问题 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] =>

Auto add or update a custom fee via admin edit orders in WooCommerce

梦想的初衷 提交于 2021-02-04 08:09:35
问题 We have a special case where we invoice our customers for payment after the order has been received instead of having them pay during checkout. Shipping charges are manually calculated and added to the order and then we add a 3% credit card fee on the grand total. To automate this process, I created a script that calculates the 3% charge once the shipping charge has been set through the backend and adds this fee item into the order automatically. This works when we add the shipping charge and

Auto add or update a custom fee via admin edit orders in WooCommerce

蓝咒 提交于 2021-02-04 08:09:18
问题 We have a special case where we invoice our customers for payment after the order has been received instead of having them pay during checkout. Shipping charges are manually calculated and added to the order and then we add a 3% credit card fee on the grand total. To automate this process, I created a script that calculates the 3% charge once the shipping charge has been set through the backend and adds this fee item into the order automatically. This works when we add the shipping charge and

Auto add or update a custom fee via admin edit orders in WooCommerce

烈酒焚心 提交于 2021-02-04 08:09:01
问题 We have a special case where we invoice our customers for payment after the order has been received instead of having them pay during checkout. Shipping charges are manually calculated and added to the order and then we add a 3% credit card fee on the grand total. To automate this process, I created a script that calculates the 3% charge once the shipping charge has been set through the backend and adds this fee item into the order automatically. This works when we add the shipping charge and