I'm really new into WooCommerce and not an expert in WooCommerce, I have developed custom WordPress themes but not WooCommerce.
I have been trying to use different codes to display certain things like Attributes, Add to cart button, title, etc. I have managed to do almost everything, I had the Add to Cart button but I need to have sizes in a dropdown (i already have the attributes created) so my button just converted itself into "Select Options" when I made this product "Variable". So now I'm pretty confused
<h1>
<?php echo $product->get_title(); ?>
</h1>
<div class="amount">$
<?php echo $product->get_price ()?>
</div>
<p class="product-description">
<?php echo $product->get_description(); ?>
</p>
<!-- Add to Cart Button -->
<?php
global $product;
echo apply_filters( 'woocommerce_loop_add_to_cart_link',
sprintf( '<a href="%s" rel="nofollow" data-product_id="%s" data-product_sku="%s" class="button %s product_type_%s">%s</a>',
esc_url( $product->add_to_cart_url() ),
esc_attr( $product->id ),
esc_attr( $product->get_sku() ),
$product->is_purchasable() ? 'add_to_cart_button' : '',
esc_attr( $product->product_type ),
esc_html( $product->add_to_cart_text() )
),
$product );
?>
<?php
$subheadingvalues = get_terms('size', array(
'hide_empty' => false,
));
?>
<select>
<?php foreach ($subheadingvalues as $subheadingvalue): ?>
<option value="<?php echo $subheadingvalue->name; ?>">
<?php echo $subheadingvalue->name; ?>
</option>
<?php endforeach;?>
</select>
This is how it looks now: http://prntscr.com/oqbyry This is what I'm trying to achieve: http://prntscr.com/oqbzb6
Any help would be greatly appreciated! Sorry if this is not well formatted, it's my first post.