Products: Fix variable products add to cart (https://github.com/woocommerce/woocommerce-blocks/pull/8173)
Variable products would get added to cart via the button, even when the button said “Select options” and contained a link. This was because the button was automatically hydrated through a CSS class.
This commit is contained in:
parent
f438ea8ba2
commit
26ae17ffa0
|
@ -101,7 +101,7 @@ class ProductButton extends AbstractBlock {
|
|||
esc_url( $product->add_to_cart_url() ),
|
||||
esc_attr( $product->get_id() ),
|
||||
esc_attr( $product->get_sku() ),
|
||||
$product->is_purchasable() ? 'ajax_add_to_cart add_to_cart_button' : '',
|
||||
$product->is_purchasable() && ! $product->has_options() ? 'ajax_add_to_cart add_to_cart_button' : '',
|
||||
esc_attr( $product->get_type() ),
|
||||
esc_attr( $styles_and_classes['classes'] ),
|
||||
esc_attr( $styles_and_classes['styles'] ),
|
||||
|
|
Loading…
Reference in New Issue