This topic has 6 replies, 2 voices, and was last updated 7 years, 2 months ago ago by Rose Tyler
Dear Sir or Madam,
is it possible to show the product units in the product listing pages?
I would like to display it after the categories and before the product information text?
Thank you very much in advance!
Best regards
Paul
Hello,
Could you please provide a screenshot for better understanding?
Regards
Thank you for your fast reply!
In the following image you can see what I mean. I added the red box manually with a graphic software.
There is no such possibility by default, but you may use this code:
http://prntscr.com/gqqu6s > http://prntscr.com/gqqx76
<?php
if ( $product->has_weight() && is_shop() ) {
$weight = $product->get_weight();
echo '<div class="product-meta product-weight-list"><span class="product-meta-label">Weight: </span>' . $weight . get_option('woocommerce_weight_unit') . '</div></br>';
}
?>
in legenda/woocommerce/content-product.php file
to show http://prntscr.com/gqqlyi > http://prntscr.com/gqqmes.
We recommend you to make changes in a child theme.
Regards
Thanks for the tip,
I added the meta-information in this code like so:
I am also hiding the tagged words with display: none
.
Thanks for your help
You’re welcome!
I am glad that you sorted out.
Regards
You must be logged in to reply to this topic.Log in/Sign up