function check_cart_weight(){
global $woocommerce;
$weight = $woocommerce->cart->cart_contents_weight;
if( $weight > 30 ){
wc_add_notice( sprintf( __( ‘You have %sKg weight and we allow only 30Kg of weight per order.’, ‘woocommerce’ ), $weight ), ‘error’ );
}
}
Is there also a code,
for this if you work with grams? But also till a maximum of order till 30 kg?
Because it shows only kilo error, while i have all my products in grams.
Greetings, Marika
Viewing 4 replies - 1 through 4 (of 4 total)
The topic ‘Set shipping max weight’ is closed to new replies.