• I’ve added an add to cart button within product archive loops using this code:

    
    add_action( 'woocommerce_after_shop_loop_item_title', 'add_product_archive_buttons' );
    function add_product_archive_buttons() {
        $pid = get_the_id();
        echo do_shortcode('[add_to_cart id="' . $pid . '" show_price="FALSE" style="border: none; padding: 0;" ]');
    }
    

    This displays the buttons fine, but when you scroll past the first “page” of products and the infinite scroll loads new products in, it breaks the layout (it’s as if it puts the output within the last product

    • element). I’ve tried tweaking the infinite scroll settings to target different containers etc but that hasn’t helped. When I disable infinite scroll and revert back to standard pagination the layout looks normal between pages of products. Any idea how we might be able to fix this?

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

Viewing 1 replies (of 1 total)
  • Plugin Support crodriguez1991

    (@crodriguez1991)

    Hello there,

    Thanks for contacting us and I hope you’re doing well ??

    Could you please send me the configuration you have in our plugin.

    I’ll check if you have the correct settings.

    Also could you tell me which theme are you using? Could you try using a default theme like TwentySixteen?

    I’m looking forward your response.

    Have a good day.

Viewing 1 replies (of 1 total)
  • The topic ‘Layout breaks when add to cart button is added’ is closed to new replies.