Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // get the post IDs of all the product variations
- $variation_ids = $product->children;
- foreach( $variation_ids as $var_id ) :
- // get the data from the custom fields
- $color_hex = get_post_meta( $var_id, 'color_hex', true ); // does this product have an alternate buying option?
- // model-(attribute value)
- $model_name = 'model-'.get_post_meta($var_id, 'attribute_model', true);
- ?>
- <div class="custom_variation" id ="<?php echo $model_name; ?>">
- <div class="variations_button">
- <?php echo $color_hex ?>
- </div>
- </div><!-- #custom_variation -->
- <?php endforeach; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement