Home › Forums › WoodMart support forum › If there are more than 24 variations of products, an error occurs. › Reply To: If there are more than 24 variations of products, an error occurs.
January 27, 2019 at 5:49 pm
#104342
Artem Temos
Keymaster
Hi,
Try to add the following PHP code snippet to the child theme functions.php file to fix this
function woodmart_get_active_variations( $attribute_name, $available_variations ) {
$results = array();
if ( ! $available_variations ) {
return $results;
}
foreach ( $available_variations as $variation ) {
$attr_key = 'attribute_' . $attribute_name;
if ( isset( $variation['attributes'][ $attr_key ] ) ) {
$results[] = $variation['attributes'][ $attr_key ];
}
}
return $results;
}