Wondor how to show attributes in product summary (Woocommerce)

Just add this small snippet and there you go….

//show attributes after summary in product single view
add_action('woocommerce_single_product_summary', function() {
//template for this is in storefront-child/woocommerce/single-product/product-attributes.php
global $product;
echo $product->list_attributes();
}, 25);

 

If you want to show only minimum price of variable product you can do something like this

//Show only minimum price of variable product
add_filter('woocommerce_variable_price_html', 'custom_variation_price', 10, 2);
function custom_variation_price( $price, $product ) {
$price = '';
$price .= wc_price($product->get_price());
return $price;
}

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.