[vc_cta h2=”The Below Code Works for the Following Plugins:”]
- WooCommerce UPS Shipping plugin
- ELEX WooCommerce DHL Express / Paket Shipping plugin
- WooCommerce FedEx Shipping plugin
- ELEX WooCommerce USPS Shipping plugin
- WooCommerce Canada Post Shipping plugin
- ELEX WooCommerce Stamps.com USPS Shipping plugin
- ELEX WooCommerce Australia Post Shipping plugin
- WooCommerce Multi-Carrier Shipping plugin
- WooCommerce Table Rate Shipping Pro plugin
- ELEX EasyPost (UPS, USPS & FedEx) Shipping plugin
- ELEXtensions.com Shipping Plugins
[/vc_cta]
Below snippet will hide shipping methods if none of the items in the cart belongs to the specific Shipping Class.
Use the array variable $shipping_classes
to define the shipping classes.
Define the services to_hide.
If you are looking for a plugin do this job, visit ELEX Hide Shipping Methods Plugin. Using this plugin, You can easily hide shipping methods based on various conditions.
If you want to hide all the shipping methods, you can refer this snippet article for reference code.
hi Harish,
Please refer the below article. There is the right snippet for you,
https://www.xadapter.com/showhide-free-shipping-based-item-count-domestic-shipment/
how to add or remove shipping class based on the quantity of product added to cart. like if 3 or > 3 of a product added, then apply a shipping class “free” otherwise apply normal shipping.