Created
October 28, 2012 04:53
-
-
Save simonlk/3967569 to your computer and use it in GitHub Desktop.
Output Woocommerce product variations as a table so they look like a single product
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Output variations as a list so they look like a single product | |
// Works in theme/woocommerce/single-product/add-to-car/variable.php | |
?> | |
<table class="table table-striped table-hover"> | |
<thead> | |
<tr> | |
<th>Ref #</th> | |
<?php foreach ( $attributes as $name => $options) :?> | |
<th><?php echo $woocommerce->attribute_label($name); ?></th> | |
<?php endforeach;?> | |
</tr> | |
</thead> | |
<tbody> | |
<?php foreach ($available_variations as $prod_variation) : ?> | |
<tr> | |
<td><?php echo $prod_variation['sku'] ;?></td> | |
<?php foreach ($prod_variation['attributes'] as $prod_attributes) : ?> | |
<td><?php echo $prod_attributes ;?></td> | |
<?php endforeach;?> | |
</tr> | |
<?php endforeach;?> | |
</tbody> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hello how can we get sales or regular price in the table with that.
REF # SIZE QUANTITY PRICE ADD TO CART