List shipping classes and their IDs for use in custom code.
Similar to my post to show shipping method IDs, showing the shipping class IDs is needed for some BusinessBloomer.com posts e.g. Hide Shipping By Shipping Class. Finding the shipping class is messy so, like for shipping method IDs, the code below reveals shipping class IDs for easy reference.
Retrieving all shipping classes
Shipping classes are stored as a taxonomy called ‘product_shipping_class‘ so retrieving information about them is via a call to get_terms().
The rest of the code is almost identical to the show shipping method IDs code.
Leave a Reply