I’m currently working on a woocommerce webshop using 40k+ affiliate products.
Below the add to cart button woocommerce automaticly shows SKU, Category and Tags. however i would like to add more info provided in the Product meta such as size, color and brand.
I’ve messed around with the Meta.php however no luck so far.
I’ve tried adding several variables eg:
existing:
$cat_count = sizeof( get_the_terms( $post->ID, 'product_cat' ) );
i added:
$col_count = sizeof( get_the_terms( $post->ID, 'product_col' ) );
in the div class “product_meta” it states the following:
<?php echo $product->get_categories( ', ', '<span class="posted_in">' . _n( 'Category:', 'Categories:', $cat_count, 'woocommerce' ) . ' ', '</span>' ); ?>
added:
<?php echo $product->get_colors( ', ', '<span class="posted_in">' . _n( 'Color:', 'Colors:', $col_count, 'woocommerce' ) . ' ', '</span>' ); ?>
however no succes. not an experienced coder so excuse me if i did somethin completely idiotic.
With kind regards,
Rudy
For example you can use product attributes in WooCommerce:
After that you need override WooCommerce template file (…/wp-content/plugins/woocommerce/templates/single-product/meta.php)
Copy this code in meta.php:
More about adding information to WC Shop Pages here:
https://www.skyverge.com/blog/add-information-to-woocommerce-shop-page/