Hi, i solved whit replacing add_error whit wc_add_notice
<?php
// check that cart items quantities totals are in multiples of 6
add_action( ‘woocommerce_check_cart_items’, ‘woocommerce_check_cart_quantities’ );
function woocommerce_check_cart_quantities() {
global $woocommerce;
$multiples = 6;
$total_products = 0;
foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) {
$total_products += $values[‘quantity’];
}
if ( ( $total_products % $multiples ) > 0 )
wc_add_notice( ‘<stron g>’ . $btn[‘label’] . ‘</stron g> ‘ . __( ‘You need to buy in quantities of %s products’, ‘woocommerce’ ), ‘error’ );
}