shipping-method

Hide shipping methods for specific shipping classes in WooCommerce

帅比萌擦擦* 提交于 2019-12-08 12:23:17
问题 In WooCommerce, I am hiding shipping methods based on different shipping classes in cart using "Hide shipping methods for specific shipping class in WooCommerce" answer code (the 2nd way) , but the problem is that I use WPML plugin which manage 2 languages site, so looking for just one class won't do it. So I need to handle 2 shipping classes instead of one. I tried addind 2 shipping classes this way: // HERE define your shipping classes to find $class = 3031, 3032; But it breaks the website.

Change wc_cart_totals_shipping_method_label function in Woocommerce

青春壹個敷衍的年華 提交于 2019-12-08 09:08:44
Inside Woocommerce plugin on the includes subfolder, there's a file wc-cart-functions.php . I would like to change the function wc_cart_totals_shipping_method_label() , but I am not allowed to copy the function to my theme's functions.php. I believe I have to use a custom action/filter to change this core function, but no idea how to do that. Original function: function wc_cart_totals_shipping_method_label( $method ) { $label = $method->get_label(); $has_cost = 0 < $method->cost; $hide_cost = ! $has_cost && in_array( $method->get_method_id(), array( 'free_shipping', 'local_pickup' ), true );

Shipping cost based on cart total weight in Woocommerce 3

强颜欢笑 提交于 2019-12-08 07:00:05
问题 In my Woocommerce Webshop I do have different Products. I would like to have shipping cost calculated on total cart items weight: from 0 to 6 Kilos the cost is 5 € , from 6 to 12 Kilos the cost is 9 € Actually if I have a Product which is 1 Kilo the shipping cost is 5 € , but if I have 10 items of this product in my basket, the shipping fee is still 5 € (and it should be 9 € instead) . How can I have a progressive shipping cost based on cart total weight? 回答1: Try the following function which

Remove duplicated shipping packages using a shipping class in Woocommerce

岁酱吖の 提交于 2019-12-08 06:18:47
问题 The products in my website are handled by one of that 2 shipping plugins: Printful Integration for WooCommerce and Printify for WooCommerce Shipping. when there is mixed items from each shipping plugin. Those plugins split each one the shipping package in two when there is mixed items (which is a a conflict and a problem) . So I have added a shipping class 'printful' (which id is 548 ) to the products that are handled by the Printful plugin, and tried to adjust Hide shipping method for

Change wc_cart_totals_shipping_method_label function in Woocommerce

心不动则不痛 提交于 2019-12-08 05:02:50
问题 Inside Woocommerce plugin on the includes subfolder, there's a file wc-cart-functions.php . I would like to change the function wc_cart_totals_shipping_method_label() , but I am not allowed to copy the function to my theme's functions.php. I believe I have to use a custom action/filter to change this core function, but no idea how to do that. Original function: function wc_cart_totals_shipping_method_label( $method ) { $label = $method->get_label(); $has_cost = 0 < $method->cost; $hide_cost =

Adding custom message on Thank You page by shipping method

限于喜欢 提交于 2019-12-08 04:09:19
问题 I'm trying to add a message to the order-received (Thank You) page, only if the order is using Free Shipping. The message can either replace the standard "Thank you..." message, or can be in addition to. Here is the code I'm working with. It's based off of the answer here: Customize Order received page based on shipping method in WooCommerce //add message to order received if outside delivery area add_filter( 'woocommerce_thankyou_order_received_text', 'woo_change_order_received_text', 20, 2

Remove duplicated shipping packages using a shipping class in Woocommerce

五迷三道 提交于 2019-12-06 14:39:59
The products in my website are handled by one of that 2 shipping plugins: Printful Integration for WooCommerce and Printify for WooCommerce Shipping . when there is mixed items from each shipping plugin. Those plugins split each one the shipping package in two when there is mixed items (which is a a conflict and a problem) . So I have added a shipping class 'printful' (which id is 548 ) to the products that are handled by the Printful plugin , and tried to adjust Hide shipping method for specific shipping classes in woocommerce answer code by @LoicTheAzec (cheers), to only remove the shipping

Show hide payment methods based on selected shipping method in Woocommerce

白昼怎懂夜的黑 提交于 2019-12-02 13:21:19
问题 I would like to hide some payment method and enable another one when I select a specified “Shipping Method" in flexible Shipping plugin form wpdesk. I have already tried that code: add_filter( 'woocommerce_available_payment_gateways', 'gateway_disable_shipping_326' ); function gateway_disable_shipping_326( $available_gateways ) { global $woocommerce; if ( !is_admin() ) { $chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); $chosen_shipping = $chosen_methods[0]; if ( isset(

Shipping cost discount based on a shipping classes in Woocommerce

一曲冷凌霜 提交于 2019-12-02 09:15:49
I'm trying to apply a discount to one shipping class for products currently in a cart. This is applied on the checkout view. In Woocommerce backend, the option is set to charge each shipping class individually. Also, I use only one shipping method named "flat rate". Based on Override all shipping costs for a specific shipping class in Woocommerce , the following code that should apply the discount: add_filter('woocommerce_package_rates', 'shipping_class_null_shipping_costs', 10, 2); function shipping_class_null_shipping_costs( $rates, $package ){ if ( is_admin() && ! defined( 'DOING_AJAX' ) )

Show hide payment methods based on selected shipping method in Woocommerce

烂漫一生 提交于 2019-12-02 04:34:05
I would like to hide some payment method and enable another one when I select a specified “Shipping Method" in flexible Shipping plugin form wpdesk. I have already tried that code: add_filter( 'woocommerce_available_payment_gateways', 'gateway_disable_shipping_326' ); function gateway_disable_shipping_326( $available_gateways ) { global $woocommerce; if ( !is_admin() ) { $chosen_methods = WC()->session->get( 'chosen_shipping_methods' ); $chosen_shipping = $chosen_methods[0]; if ( isset( $available_gateways['payment_method_cod'] ) && 0 === strpos( $chosen_shipping, 'flat_rate:6' ) ) { unset(