Skip to main content
added 1 character in body
Source Link
Pim
  • 1.2k
  • 1
  • 11
  • 26

If I understand your question correctly:

<?php
global $product$product;
$sizes = $product->get_attribute( 'size' ); $sizes = explode(", ",$sizes); ?>
<?php if($sizes[0]!=''){ // if product sizes are defined ?>
   <ul class="list-group">
    <?php foreach($sizes as $size){ ?>
      <li class="list-group-item"><?php echo $size; ?></li>
    <?php } ?>
  </ul>
<?php } ?>

If I understand your question correctly:

<?php
global $product
$sizes = $product->get_attribute( 'size' ); $sizes = explode(", ",$sizes); ?>
<?php if($sizes[0]!=''){ // if product sizes are defined ?>
   <ul class="list-group">
    <?php foreach($sizes as $size){ ?>
      <li class="list-group-item"><?php echo $size; ?></li>
    <?php } ?>
  </ul>
<?php } ?>

If I understand your question correctly:

<?php
global $product;
$sizes = $product->get_attribute( 'size' ); $sizes = explode(", ",$sizes); ?>
<?php if($sizes[0]!=''){ // if product sizes are defined ?>
   <ul class="list-group">
    <?php foreach($sizes as $size){ ?>
      <li class="list-group-item"><?php echo $size; ?></li>
    <?php } ?>
  </ul>
<?php } ?>
Source Link
Pim
  • 1.2k
  • 1
  • 11
  • 26

If I understand your question correctly:

<?php
global $product
$sizes = $product->get_attribute( 'size' ); $sizes = explode(", ",$sizes); ?>
<?php if($sizes[0]!=''){ // if product sizes are defined ?>
   <ul class="list-group">
    <?php foreach($sizes as $size){ ?>
      <li class="list-group-item"><?php echo $size; ?></li>
    <?php } ?>
  </ul>
<?php } ?>