Skip to content

Commit 363f670

Browse files
committed
Fix bug
1 parent eba7a80 commit 363f670

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

resolver/store/cart.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ public function add($args) {
1313
$options[ $option['id'] ] = $option['value'];
1414
}
1515
$variation_id = $this->find_matching_product_variation_id($args['id'], $options);
16-
16+
if(!$variation_id) {
17+
throw new \Exception('Please select an option.');
18+
}
1719
WC()->cart->add_to_cart($args['id'], $args['quantity'], $variation_id);
1820
} else {
1921
WC()->cart->add_to_cart($args['id'], $args['quantity']);

0 commit comments

Comments
 (0)