• Resolved prokreeger

    (@prokreeger)


    Hi, there!

    I want to add info icon with popup to Delivery time and Shipping costs info blocks. If there any hooks or methods to do this in your plugin?

    Example of icon appearence:
    https://i.ibb.co/jhZv3G0/Kleider-Valery-Mirawella-de.png

    Here is an code snippet for icon:
    <a href="#a" class="mpp-trigger-popup-4635"><i id="dlv-time-info" class="fas fa-info-circle"></i></a>

    • This topic was modified 4 years, 6 months ago by prokreeger.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author vendidero

    (@vendidero)

    Hi there,

    you might need to override the default Germanized templates. E.g.:

    Original:
    wp-content/plugins/woocommerce-germanized/templates/single-product/delivery-time-info.php

    Child-Theme:
    wp-content/themes/my-child/woocommerce-germanized/single-product/delivery-time-info.php

    You might then adjust the HTML to your custom needs.

    Cheers

    Thread Starter prokreeger

    (@prokreeger)

    I have override the default Germanized template and I’ve got a new issue. Icon appears for 2 seconds and then disappears.

    I have one more question: “How can I make text Lieferung bold?”.

    https://i.ibb.co/x7CsZqt/Kleider-Valery-Mirawella-de2.png

    Plugin Author vendidero

    (@vendidero)

    Hi there,

    I’ll guess you are testing variable products? In that case you might better override the global delivery time filter: woocommerce_germanized_delivery_time_html

    E.g.:
    https://gist.github.com/vendidero/40c058ba8ac914ab9dc4b5bf96b8f71c

    Cheers

    Thread Starter prokreeger

    (@prokreeger)

    Hi,

    After I added this piece of code:

    
    add_filter( 'woocommerce_germanized_delivery_time_html', 'my_child_adjust_delivery_time_html', 10, 4 );
    
    function my_child_adjust_delivery_time_html( $html, $option, $term_html, $product ) {
        $replacements = array(
           '{delivery_time}' => $term_html,
        );
        return wc_gzd_replace_label_shortcodes( '<span class="delivery-time-label">' . __( 'Delivery time: ', 'my-text-domain' ) . '</span> {delivery_time} <a href="#b" class="mpp-trigger-popup-4635"><i id="dlv-time-info" class="fas fa-info-circle"></i></a>', $replacements );
    }
    

    in my function.php file, the icon became normally displayed. But the pop-up window that should open when you click on this icon does not work.

    I also added the following code to my function.php file:

    
    add_action( 'woocommerce_single_product_summary', 'my_code', 28 );
    
    function my_code( ) {
        echo '<a href="#b" class="mpp-trigger-popup-4635"><i id="dlv-time-info" class="fas fa-info-circle"></i></a>';
    }
    

    which adds another icon to check if the popup works correctly and it works correctly.

    I do not understand what I am doing wrong. Why the icon does not work in the first case and everything is fine in the second.

    Plugin Author vendidero

    (@vendidero)

    Hi there,

    I guess you’ll need to check that with the used popup plugin or JS implementation. Maybe this is a DOM problem, e.g. the HTML might be replaced with the variation data on choosing a variation – the popup plugin might not be able to trigger the click on the newly inserted HTML. You’ll need to debug that yourself or let a webdeveloper debug the problem.

    Cheers

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add info icon to Delivery time and Shipping costs’ is closed to new replies.