shipping-method

Woocommerce Change shipping method title on checkout based on shipping class selected

懵懂的女人 提交于 2021-02-19 06:52:04
问题 I want to change the shipping method title displayed in the checkout of my store based on the shipping class the product has. e.g. Shipping method title is currently Flat Rate and I have 2 products: If product A is being purchased I need it to have "Fragile shipping" If product B is being purchased I need it to have "Standard shipping" Sadly I have to do my shipping using classes so alternative methods won't work. Any help would be appreciated. 回答1: The following code will rename your

Change specific shipping method title on WooCommerce orders after checkout

不羁岁月 提交于 2021-02-10 14:35:27
问题 I have some custom fields in my shipping information that is not being displayed "properly" in the shipping information of orders under woocommerce -> orders -> order#. The cart and checkout pages are different via php code that changes a label. The cart image1 is the original\core label that is defined in shipping methods image2, this is being sent to the order information page. I would like the checkout information to show instead which is shown in image3. Image4 is how it currently looks

Set specific taxable shipping rate cost to 0 based on cart subtotal in WooCommerce

喜夏-厌秋 提交于 2021-02-10 12:49:28
问题 With following code I'm able for specific shipping rate method (here 'easypack_parcel_machines') to set the cost to 0, when cart subtotal is up to a specific amount (here 150 PLN) : function override_inpost_cost( $rates, $package ) { // Make sure paczkomaty is available if ( isset( $rates['easypack_parcel_machines'] ) ) { // Current value of the shopping cart $cart_subtotal = WC()->cart->subtotal; // Check if the subtotal is greater than 150pln if ( $cart_subtotal >= 150 ) { // Set the cost

Set specific taxable shipping rate cost to 0 based on cart subtotal in WooCommerce

守給你的承諾、 提交于 2021-02-10 12:47:57
问题 With following code I'm able for specific shipping rate method (here 'easypack_parcel_machines') to set the cost to 0, when cart subtotal is up to a specific amount (here 150 PLN) : function override_inpost_cost( $rates, $package ) { // Make sure paczkomaty is available if ( isset( $rates['easypack_parcel_machines'] ) ) { // Current value of the shopping cart $cart_subtotal = WC()->cart->subtotal; // Check if the subtotal is greater than 150pln if ( $cart_subtotal >= 150 ) { // Set the cost

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

How to get WooCommerce shipping methods cost and settings?

烈酒焚心 提交于 2021-02-05 07:35:43
问题 I'm trying to get all shipping methods, with their rates and title. But when i use WC()->shipping->get_shipping_methods() it will only return empty rates array, and empty title string. Here is a dump: array (size=3) 'flat_rate' => object(WC_Shipping_Flat_Rate)[1861] protected 'fee_cost' => string '' (length=0) public 'supports' => array (size=3) 0 => string 'shipping-zones' (length=14) 1 => string 'instance-settings' (length=17) 2 => string 'instance-settings-modal' (length=23) public 'id' =>

Add radio buttons to specific shipping method on WooCommerce checkout

旧巷老猫 提交于 2021-02-04 08:10:28
问题 I added a new shipping method "pickup from store" with free shipping to WooCommerce. I have 2 stores, "Barsha" and "Deira". I would like when customer choose pickup from a store to be able to select which store he will visit. Here is what I added to cart-shipping.php template file: <?php <hr><p>Please choose the pickup store:</p> <input type="radio" id="barsha" sname="store" value="barsha"> <label for="barsha">Barsha<a href=""> Check Location</a></label><br> <input type="radio" id="deira"

Show or hide shipping methods based on number of cart items for specific shipping class

南楼画角 提交于 2021-01-29 20:51:48
问题 I’m trying to unset two shipping methods only if cart has 4 or less products from a specific shipping class. Shipping Methods: flat_rate:20 and flat_rate:21 Shipping Class: 182 This is what I have: add_filter( 'woocommerce_package_rates', 'hide_shipping_method_based_on_shipping_class', 10, 2 ); function hide_shipping_method_based_on_shipping_class( $rates, $package ) { if ( is_admin() && ! defined( 'DOING_AJAX' ) ) return; // Shipping Class To Find $class = 182; // Number Of Shipping Class

Change the default Shipping method in Woocommerce

安稳与你 提交于 2021-01-29 14:26:50
问题 I have two shipping methods. First is Free Shipping and second is Flat Rate Shipping for Express shipping for which i charge extra fee. By default Express Shipping is selected in the cart which lead to confusion among some buyers that I do not offer free shipping. Is it possible to change default selected method to free shipping? 回答1: I think that you just need to reorder your shipping methods for each shipping zone, moving "free shipping" on first line. If it doesn't work, you can add the

WooCommerce account side package rates null

梦想的初衷 提交于 2021-01-29 14:18:28
问题 I have been trying to alter shipping rates to a flat fee for a language. This seems fine by simply adding a hook to the woocommerce_package_rates. However I am now getting multiple fatal errors when trying to access the account area and the basket. They start with the error below and all seem to be triggered from the $package['rates'] array which it doesn't seem to like. Warning: array_keys() expects parameter 1 to be array, null given in /home/..../....../wp-content/plugins/woocommerce