Showing a delivery estimate for WooCommerce shipping methods can help your customers determine which method is best for the order. For example, while free shipping may be available, what if this takes longer and the customer needs the package by a certain date?
To avoid situations like this which may result in an abandoned cart, you can communicate the estimated shipping time up front during the cart / checkout process instead.
While you can show the estimated delivery with the WooCommerce Order Delivery plugin, it may be overkill for stores that don’t need customers to select their own delivery dates as well.
woocommerce_cart_shipping_method_full_label filter can be used instead for WooCommerce delivery estimates. We’ll use this filter to append a delivery estimate after the shipping method’s label (i.e., “Flat Rate: $3.99”).
This will let us display the estimate in the cart page’s shipping display and on checkout page.
Creating WooCommerce Delivery Estimates
The first thing we’ll need is the shipping method’s ID so we can identify it in our code and add the appropriate estimate to its label. You can get this under WooCommerce > Settings > Shipping in the “Shipping Methods” table.
We’ll do a
switch on the method’s ID so we can change the estimate for each rate; you can add an estimate for any or all rates in your shop, and these rates can be different for each method.
Setting a default is optional here. If you don’t want to show the estimate by default for all rates, you can leave this out. Here’s the code you’ll need (can be modified as desired).
Feel free to change the label’s text — you could do something like “up to 7 days” instead of a date range if you prefer.
Once you’ve added the estimates for each shipping method, these will now be displayed with the method’s label on the cart page:
As well as on the checkout page:
Adding WooCommerce delivery estimates is a simple way to keep customers informed as to how long shipping for each method will take so they can ensure their orders arrive when they need them.
Footnote: After I’d written this, I realized it might make for an interesting project — we built this into a plugin, and you can download the WooCommerce Shipping Estimate plugin to do this.