shipcloud / shipcloud-for-woocommerce

shipcloud for WooCommerce
GNU General Public License v3.0
6 stars 0 forks source link

Shipping class dimensions are not determined correctly #198

Open luzat opened 3 years ago

luzat commented 3 years ago

In WC_Shipcloud_Shipping::get_shipping_class_dimensions the following line fails to find the requested taxonomy:

$taxonomy = get_term_by( 'name', $shipping_class, 'product_shipping_class' );

The issue is, that $shipping_class is a slug, not the readable name. The line should be changed to:

$taxonomy = get_term_by( 'slug', $shipping_class, 'product_shipping_class' );

Otherwise no shipping class dimensions will be read.