mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-30 11:42:22 +08:00
6 lines
264 B
Text
6 lines
264 B
Text
add_filter( 'woocommerce_product_get_shipping_class_id', 'wc_default_product_shipping_class', 9999, 2 );
|
|
|
|
function wc_default_product_shipping_class( $value, $product ) {
|
|
$value = $value ? $value : 44; // default to shipping class ID = 44
|
|
return $value;
|
|
}
|