• Hi

    I used your plugin on my shop page but have problem with showing icon on my “add to cart” button.

    I add button using this function:

    add_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’, 20 );

    And to show icon near add to cart text I add script to my head adding span with icon to text (jquery with prepend).

    I see this icon after loading page but when I loading new products (scrolling next page) I see button without icon.

    Where is the problem?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Giuseppe Madaudo

    (@askmagic)

    Hi there,

    could you send me a link where I can see the issue?

    Thread Starter marianok

    (@marianok)

    Can I send on priv?

    Plugin Support crodriguez1991

    (@crodriguez1991)

    Hello there,

    I hope you’re doing well :D.

    If the button is added by JS maybe it’s necessary to add the icon to new elements. Our plugin has a trigger after he finish to infinite scrolling.

    Maybe you can use this event in order to call the icon to be added to each add to cart button.

    jQuery(document).on( 'yith-infs-scroll-finished', function(){
    
     // Add code for show the icon near to the add to cart
    
    } );

    Please, try it and let me know if it can help you.

    Have a good day.

    Thread Starter marianok

    (@marianok)

    Hi
    
    My script look like this:
    
    <script>
    
    jQuery(document).ready(function () {
    
    ??? jQuery(".kma_loop_add_to_cart").prepend('<span class="kma_loop_add_to_cart"></span>');
    
    })
    
    </script>
    
    I change now as you wrote, but I dont see icon now even before scroll:
    
    <script>
    
    jQuery(document).on('yith-infs-scroll-finished', function(){
    
    ??? jQuery(".kma_loop_add_to_cart").prepend('<span class="kma_loop_add_to_cart"></span>');
    
    })
    
    </script>
    Plugin Support crodriguez1991

    (@crodriguez1991)

    Hello there,

    I hope you’re doing well :D.

    I think you should loop all elements and then you can prepend the value.
    You can use the each method in order to get your goal

    https://api.jquery.com/each/

    If continue to not work. Could you share with me the page where you have the problem?

    I’m looking forward your response.

    Have a good day.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Dont see icon on button’ is closed to new replies.