Showing a required Shipping ServiceBesty2016-12-20T12:59:00+00:00
Code Snippet 01 – To show Shipping Pro methods when shipping class exist
With the below given piece of code, you can show the Shipping Pro Methods(Services) if the product of the particular shipping class is in cart.
Steps to add Code Snippet
- Add the following code to your functions.php or any where relevant.
- You need to find out the service code for the service which you want to hide. To Find out Service code, navigate to Cart/Checkout page. Right click on the unwanted service and select inspect. Check ‘value’ of shipping service to get the code for the service.
- Shipping Pro methods will be shown in the cart/checkout page, if the product belongs to the $shipping_class_ids array. There will be no service available in the cart/checkout page if the product does not belong to the $shipping_class_ids array.
The code is as given below: