PressTigers

Implementing Shipping Offers in WooCommerce

Shipping offers are being displayed on many e-commerce websites. For example, shipping will be free on purchasing products of worth $100. In this article, you will learn to implement shipping offers in the WooCommerce plug-in.

To add this functionality, woocommerce_package_rates filter is used to control the rates of shipping methods.

Let’s say, in pt_process_shipping_offer function, you have set all the shipping methods of WooCommerce as “free shipping”. You can have an option to set specific shipping methods as free by accessing the array of rates $rates and using shipping method ID.

You just need to add the following code in your Theme‘s functions.php file and you can also utilize it in your plug-in:

User Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Get in Touch