This topic has 4 replies, 2 voices, and was last updated 6 years, 10 months ago ago by Rose Tyler
Hi,
Is there a way to make the price of the grouped products the total of the separate grouped products?
For instance, I have this grouped product. I would like to have the listed amount not be: € 239,00–€ 685,00. Rather, I want the total amount to show: € 1269. Is this possible?
Thank you
Hello,
Please note that your query requests additional customization which is beyond our basic support scope.
But you may try to achieve the needed result in such way:
create structure xstore-child/woocommerce/single-product and file price.php
the content of this file should be at first like woocommerce default content -> https://github.com/woocommerce/woocommerce/blob/master/templates/single-product/price.php
then replace this http://prntscr.com/i4alr4 with
global $product;
$price = $product->get_price_html();
if ( $product->get_type() == 'grouped') {
$children = $product->get_children();
$price = 0;
foreach ($children as $key => $value) {
$_product = wc_get_product( $value );
$price += $_product->get_price();
}
$price = get_woocommerce_currency_symbol( '' ) . ' ' . $price;
}
?>
<p class="price"><?php echo $price; ?></p>
Regards
Thank you, I will not try for now.
You’re welcome!
Have a nice day.
Regards
You must be logged in to reply to this topic.Log in/Sign up