I know that I can create attributes of color, size and etc. But for some reason, I had to combine 3 attributes into one and then displayed them differently.
Now, I’ve the attribute with the values :
pa_mixed : Red, Blue, Green, S, M, L, Children, Adult
But on the front end I have to display like :
Colors : Blue, Red
Size : M
Aged : Children
So far I have tried :
if (!empty ($product->get_attribute('pa_mixed'))):
$pa_mixed = $product->get_attribute('pa_mixed');
else:
$pa_mixed = "";
endif;
$size = array('S','M','L');
if ( in_array( $size, $pa_mixed ) ) {
//colors attributes
}
//etc
And finally I got lost
please help me to find the right way, thank you