Reputation: 41
I have the website from the client for his food services. well, I have used woo-commerce it works fine with no variations and with at least 3 variations but on 3 variations take 1 min to add items on the cart. but when I use 4 variations it keeps load too long and in the end after 10 to 15 minutes give error wp-DB time execute more than 240s. I even increased the time from phpmyadmin but nothing is resolved. I am quite sure something is wrong with woo-commerce but no idea what and how will it be resolved. Thanks
Upvotes: 0
Views: 76
Reputation: 19545
The ||
operator means that it is enough to have only one condition be true so the whole ... || ...
statement becomes true. If you want that all conditions have to be met you need to use the AND
operator.
$validName = preg_match('/^[a-zA-Z]*$/', $name);
$validPrice = preg_match('/^[0-9][1-3]*$/', $price);
$validWeight = preg_match('/^[0-9]*$/', $weight);
$validTemp = preg_match('/^[0-9]*$/', $temp);
if ($validName AND $validPrice AND $validWeight AND $validTemp) {
// ... do something
}
Upvotes: 1