Home Forums WoodMart support forum displaying prices

displaying prices

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #645640

    cristian-1741
    Participant

    hello!
    I have a problem with the prices:
    until a few days ago, the price of Grouped products was cumulative, now you see the prices of the two components, separated by a hyphen. I don’t understand why it changed on its own, maybe with an update? How can I do to get them back together?
    I put a screeshot(1_price)

    Also, if I set dynamic discounts, in the products that are part of a grouped product, I see the table with the discounts, but I don’t see it if I go to the product page with the two ‘grouped’ products, maybe it’s not possible to do that, right?
    I have put a screenshot of this table to make it clear (2_tab)

    thank you very much!

    Attachments:
    You must be logged in to view attached files.
    #645786

    Hello,

    01. Navigate to Theme Settings > Shop > Variable products and turn on the Hide “to” price option – https://take.ms/zM5aK

    02. Can you please share the product page URL so I can check and give you a possible solution?

    Best Regards,

    #645822

    cristian-1741
    Participant

    Thank you!

    01. Unfortunately, this doesn’t solve my problem: this way, only one of the two prices is shown, but I need to see the total sum of the prices of the two products (it was like this before, I don’t understand why it disappeared).

    02. Sure, this is the product link, but it’s private at the moment: https://packorama.it/catalogo/flacone-clio-200-ml-bianco/ (I will put you access in private information)

    thank you very much

    #645903

    Hello,

    01. It’s possible that a custom code or a plugin is used for the grouped product pricing display. Could you please share a screenshot of how it appeared before? That will help me understand the issue better and provide a solution.

    02. But this is your simple product and the dynamic discount table is showing. Can you please tell me what you actually want?

    Best Regards,

    #645940

    cristian-1741
    Participant

    Thank you very much,

    I haven’t inserted any custom code, and as for the plugins, we don’t have a specific plugin for adding prices, but we have many plugins installed for other functions. I wouldn’t want there to be any conflicts…
    Attached is a screenshot of how the price appeared before (it was adding the two ‘grouped’ items).
    But, based on how the default theme is structured, should the prices for grouped products be displayed separately or added together? (Because I didn’t build this site originally and I’m not sure what the default setting was).

    thanks,
    best,

    Attachments:
    You must be logged in to view attached files.
    #645974

    Hello,

    Thank you for sharing the details and the screenshot. By default, WooCommerce displays grouped product prices separately, listing the price range of the included items. However, if your site previously displayed a cumulative price, it’s possible that a custom function or a plugin was modifying this behavior.

    There is no option in the theme settings to display the prices of grouped products as a sum. This requires customization, which is beyond our support policy.

    To calculate the price of grouped products, I have searched for a possible solution and found a custom function that you can add to your functions.php file. If the provided code does not work as expected, unfortunately, we are unable to modify it further.

    Add this to your theme’s functions.php file of the theme.

    function custom_grouped_product_price_display( $price, $product ) {
        if ( $product->is_type( 'grouped' ) ) {
            $total_price = 0;
            $child_products = $product->get_children();
    
            foreach ( $child_products as $child_id ) {
                $child_product = wc_get_product( $child_id );
                if ( $child_product ) {
                    $total_price += $child_product->get_price();
                }
            }
    
            if ( $total_price > 0 ) {
                $price = wc_price( $total_price );
            }
        }
        return $price;
    }
    add_filter( 'woocommerce_get_price_html', 'custom_grouped_product_price_display', 10, 2 );

    Hope this Helps!

    Best Regards,

    #646483

    cristian-1741
    Participant

    Thank you very much,
    I understand that we probably have a bigger problem:
    I discovered that this code is already present in the functions.php file, the issue is that it is not being read, or at least it doesn’t show up online… And I believe this is the case because even other codes inside functions.php are not being read and are not working, even though they are correct. For example, the Flexible Checkout Fields plugin, which checks users’ VAT numbers and relies on a code inside functions.php, is not working properly…
    Could you please check what the issue is with our functions.php file?
    It might be the cause of all the strange problems we’ve been experiencing lately…

    Thank you so much!!!

    #646622

    Hello,

    Sorry to say, it requires customization and is beyond our support policy. Additional code customizations in theme files are out of our theme support scope.

    Hope you can understand!

    Best Regards,

    #646690

    cristian-1741
    Participant

    Hello,

    thank you for your response and for the assistance so far. We understand your point and really appreciate your support.

    We just wanted to ask if, by any chance, you have received any reports about potential conflicts between the theme and the functions.php file. We noticed some issues last week and are trying to determine whether they could be related to an incompatibility or unexpected behavior.

    Any information you could share would be very helpful as we continue our checks.

    Thanks again for your support, and I look forward to hearing from you.

    Best regards,

    #646796

    Hello,

    So far, we have not received any reports of conflicts between the theme and the functions.php file. However, certain factors could prevent the file from being read correctly, such as:

    Syntax errors in the file that cause PHP execution to stop.
    Conflicts with third-party plugins that override or interfere with the theme’s functions.
    Incorrect placement of custom code.

    We recommend enabling debug mode (WP_DEBUG) to check for errors.
    https://www.wpbeginner.com/wp-tutorials/how-to-easily-enable-wordpress-debug-mode-to-fix-site-errors/

    Best Regards.

Viewing 10 posts - 1 through 10 (of 10 total)