WooCommerce: Ship to Predefined “Local Pickup” Addresses

WooCommerce Shipping Zones are quite easy to override / customize. With a simple PHP (and jQuery, sometimes) snippet we can accomplish many advanced shipping rules, such as the one we’ll study today.

This time, I’ve tested a snippet to add a dropdown to the billing section where users go choose the pickup destination. As a result, the shipping address is automatically populated, and so is the shipping method. What do you think?

Continue reading WooCommerce: Ship to Predefined “Local Pickup” Addresses

WooCommerce: Weight-Based Shipping Methods

With WooCommerce you get 3 default shipping methods: Flat Rate, Free Shipping, Local Pickup. For each one you can define a cost, however there is no way to set up some “weight” restrictions.

So, what if you want to display a rate for orders below 10 kg, and another shipping rate for orders above that weight?

Well, you can use simple PHP to accomplish lots of “advanced” shipping rules, such as shipping by weight.

As long as all your products have their weight information filled in, you can create some simple rules to conditionally hide/show certain shipping methods based on cart weight. Enjoy!

Continue reading WooCommerce: Weight-Based Shipping Methods

WooCommerce: Shipping Rates by Order Amount

The new shipping zone management that was introduced with Woo 2.6 gives us the chance to add flat rate, free shipping and local pick-up methods by default.

But what if a client requires 3 different rates depending on the order amount (tiered shipping)? For example: “For orders up to $100, shipping = $5; for orders up to $250, shipping = $2; for orders above $500, shipping = free”.

Is this possible without using a plugin? Well, the answer, as usual, is absolutely yes! Enjoy!

Continue reading WooCommerce: Shipping Rates by Order Amount

WooCommerce: Add House Number Field @ Checkout

A North European client told me they’re really strict about billing and shipping addresses over there. Couriers usually require a separate “House Number” in order to dispatch packages within those countries.

This must be therefore placed on the checkout, BESIDE the “Address_1” field and made required. Also, it’s a good idea to make this show in the Admin Order, thank you page and notification Emails.

Continue reading WooCommerce: Add House Number Field @ Checkout

WooCommerce: Limit Shipping to Only One State

Today’s snippet has been widely requested by many readers, clients and WooCommerce fans. We already saw in the past how to Limit State Dropdowns to One State Only (for both Shipping & Billing) and How to Sell to one State only (Billing).

However, we never covered a much more common setting: what happens when Billing is allowed to every state but Shipping is limited?

In order to get a little help, I’ve reached out to Diego Zanella, a WooCommerce genius who is also the author of the Aelia Currency Switcher plugin for WooCommerce.

Continue reading WooCommerce: Limit Shipping to Only One State

WooCommerce: Disable Payment Gateway For Specific Shipping Method

Today we take a look at the WooCommerce Checkout Page and specifically at how to disable a payment gateway (for example PayPal) when a specific shipping method is selected (e.g. “local_pickup”).

Specifically, you will learn how to “get” the selected shipping method on the go (thanks to “sessions”), and also how to “unset” a payment gateway. Enjoy!

Continue reading WooCommerce: Disable Payment Gateway For Specific Shipping Method

WooCommerce: Sort Shipping Costs from Low to High

A client had several shipping rates on the cart page automatically generated by FedEx, USPS, UPS and similar plugins via their API. Problem was, they wanted to sort them by price as opposed to grouping them by provider.

Thankfully, with a simple “uasort” PHP function, it’s possible to take the shipping rates array and sort it by amount before returning it back to the screen. If you don’t know PHP, simply copy/paste!

Continue reading WooCommerce: Sort Shipping Costs from Low to High

WooCommerce: Remove Shipping Labels @ Cart (e.g. “Flat Rate”)

WooCommerce functions add the shipping method label on the Cart totals, on the left hand side of the price. This ruins the price amounts alignment (subtotal, shipping, taxes, total) and many clients have asked me to remove it completely. Also, it could be that sometimes you don’t want to show the name of a shipping rate on the front-end. So, here’s how you do it!

Continue reading WooCommerce: Remove Shipping Labels @ Cart (e.g. “Flat Rate”)

WooCommerce: Hide Shipping Rates if Free Shipping Available

If Free Shipping is available, you possibly don’t want to show the other premium shipping options. WooCommerce shows by default all shipping rates that match a given shipping zone, so it’s not possible to achieve this from the settings alone.

Thankfully, the “woocommerce_package_rates” filter allows us to manipulate the shipping rates before they are returned to the frontend. In this example, we will disable all shipping methods but “Free Shipping” so that free shipping remains the only possible choice.

Here’s the code to add to your functions.php. Enjoy!

Continue reading WooCommerce: Hide Shipping Rates if Free Shipping Available