add more validation
This commit is contained in:
@@ -248,6 +248,10 @@ class Wiaas_Cart {
|
|||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function update_package_quantity($package_cart_item_key, $new_quantity) {
|
public static function update_package_quantity($package_cart_item_key, $new_quantity) {
|
||||||
|
if ($new_quantity > 65000){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$cart_item = WC()->cart->get_cart_item($package_cart_item_key);
|
$cart_item = WC()->cart->get_cart_item($package_cart_item_key);
|
||||||
|
|
||||||
if (!$cart_item) {
|
if (!$cart_item) {
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ class CartItem extends Component {
|
|||||||
|
|
||||||
updateQuantity(cartItem, quantity) {
|
updateQuantity(cartItem, quantity) {
|
||||||
if(quantity) {
|
if(quantity) {
|
||||||
this.setState({itemQuantity: quantity});
|
|
||||||
if(this.isQuantityValid(quantity)) {
|
if(this.isQuantityValid(quantity)) {
|
||||||
|
this.setState({itemQuantity: quantity});
|
||||||
this.sumPrices(cartItem, quantity);
|
this.sumPrices(cartItem, quantity);
|
||||||
this.props.dispatch(updateQuantity(cartItem, quantity));
|
this.props.dispatch(updateQuantity(cartItem, quantity));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user