Prevent JS Issue if `woocommerce_available_variation` return false for a variation.

After checking some condition if `woocommerce_available_variation` filter return false. Then Option list don't show because of JS issue.
This commit is contained in:
Emran Ahmed 2018-07-20 01:33:25 +06:00 committed by GitHub
parent b9cdc760ac
commit 33949f3c25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -300,7 +300,9 @@ class WC_Product_Variable extends WC_Product {
continue;
}
$available_variations[] = $this->get_available_variation( $variation );
if( $this->get_available_variation( $variation ) ){
$available_variations[] = $this->get_available_variation( $variation );
}
}
$available_variations = array_filter( $available_variations );