Layout breaks when add to cart button is added
-
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)
Viewing 1 replies (of 1 total)
- The topic ‘Layout breaks when add to cart button is added’ is closed to new replies.