Satu Batas Item pada Keranjang di WooCommerce
add_filter( 'woocommerce_add_to_cart_validation', 'only_one_item_in_cart', 9999, 2 );
function only_one_item_in_cart( $passed, $added_product_id ) {
wc_empty_cart();
return $passed;
}
Hamza Najam