Page error with different product category display

This topic has 6 replies, 2 voices, and was last updated 6 days, 12 hours ago ago by Luca Rossi

  • Avatar: Redgall
    Andrea
    Participant
    June 12, 2025 at 07:54

    Hi,
    I noticed that only in one page the layout is broken and it depends on the code inserted in the function.php file can you help to understand why only in that page there is a problem?

    Thanks.

    Content is visible for topic creator and
    support staff only.
    5 Answers
    Avatar: Justin
    Luca Rossi
    Support staff
    June 12, 2025 at 08:27

    Hi @Andrea,

    Can you please share the password?

    https://prnt.sc/Ml041j1HWS-9

    Thank you!

    Avatar: Redgall
    Andrea
    Participant
    June 12, 2025 at 08:33

    send

    Content is visible for topic creator and
    support staff only.
    Avatar: Justin
    Luca Rossi
    Support staff
    June 12, 2025 at 09:42

    Dear @Andrea,

    We’ve changed the custom code to this and it’s working fine now:

    
    add_action('before_etheme_product_grid_list_product_element_title', 'aggiungi_badge_spedizione_gratis_xstore', 10);
    
    function aggiungi_badge_spedizione_gratis_xstore() {
        global $product;
    
        if ( ! $product || ! $product->is_in_stock() ) return;
    
        // Ricarica il prodotto per sicurezza
        $product_id = $product->get_id();
        $product = wc_get_product($product_id);
    
        if ( ! $product ) return;
    
        // Prendi il prezzo netto (senza tasse)
        if ( $product->is_type('variable') ) {
            $price_netto = $product->get_variation_price('min', false); // prezzo netto minimo
            if ( ! $price_netto ) {
                $price_netto = $product->get_variation_regular_price('min', false);
            }
        } else {
            $price_netto = $product->get_price(false); // prezzo netto
            if ( ! $price_netto || $price_netto == 0 ) {
                $price_netto = $product->get_regular_price(false);
            }
        }
    
        // Calcola prezzo lordo (con IVA 22%)
        $iva_percentuale = 22; // percentuale IVA
        $price_lordo = floatval($price_netto) * (1 + $iva_percentuale / 100);
    
        if ( floatval($price_lordo) >= 200 ) {
            echo '<span class="badge-spedizione-gratis">Spedizione Gratis</span>';
        }
    }
    

    Can you please have a look?

    Thank you!

    Avatar: Redgall
    Andrea
    Participant
    June 12, 2025 at 12:25

    great it works! Thanks for your help!

    Avatar: Justin
    Luca Rossi
    Support staff
    June 12, 2025 at 14:13

    Dear @Andrea,

    In the spirit of gratitude, we want to express our appreciation for your trust in our products. As a valued customer, your experience matters greatly. Would you consider sharing it by giving our theme a deserving 5-star rating on ThemeForest?

    Click here to share your thoughts: https://themeforest.net/downloads

    Being part of our community means a lot, and your feedback contributes immensely.

    Best Regards,
    The 8Theme Team

  • Viewing 6 results - 1 through 6 (of 6 total)

The issue related to '‘Page error with different product category display’' has been successfully resolved, and the topic is now closed for further responses

Helpful Topics

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.