Maximum Order Weight

//Max Weight Notice
add_action('woocommerce_check_cart_items', 'bena_check_cart_weight');
function bena_check_cart_weight()
{
    global $woocommerce;
    $weight = $woocommerce
        ->cart->cart_contents_weight;
    if ($weight > 30)
    {
        wc_add_notice(sprintf(__('Your order is %skg, we only allow <strong>30kg per order</strong>. <u>Click & Collect</u> has been selected instead.', 'woocommerce') , $weight) , 'notice');
    }
}
[instagram-feed feed=1]
© 2024 BenaDigital Limited | All Rights Reserved
magnifiercrosschevron-down