Answer the question
In order to leave comments, you need to log in
Woo - I can't display product sizes in the card through a loop, how to fix it?
I'm trying to display the sizes of goods through a loop so that each value is wrapped in a tag. But it does not output anything, without a loop everything works
$razmers = $product->get_attribute('Razmer');
foreach( $razmers as $razmer ) {
echo '<div class="text-white font-medium">'. $razmer .'</div>';
}
Answer the question
In order to leave comments, you need to log in
how to fix?Read documentation.
WC_Product::get_attribute() – Returns a single product attribute as a string.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question