Split: Sticky add to cart replaced with empty space if product out of stock
-
Hi
Somehow the issue persists even after update to latest version. I have some products available on backorder and the sticky add to cart bar is not showing on scroll. Looks like te “wd-sticky-btn” div doesn’t get the “wd-sticky-btn-shown” class on scroll, so it’s not showing up.
Attachments:
You must be
logged in to view attached files.
Hello,
Could you please disable all plugins that are not related to our theme and provide us your admin access so we can check it?
Thank you in advance
Hello and thanks for the quick reply!
I did disable all the plugins, the problem was still there.
However, in my search for any custom functions that I might have added that could mess with the sticky add to cart I found a custom function. For some reason adding a custom body class to backorder products will interfere with the sticky add to cart.
My custom function, if anyone needs to check:
function Custom_backorder_class ($classes) {
global $post;
if($post->post_type !="product")
return $classes;
$product = wc_get_product( $post->ID );
if($product->backorders_allowed())
$classes[] = 'back-order-allowed';
return $classes;
}
add_filter('body_class', 'Custom_backorder_class');
OK, we are glad that you sorted it out. Feel free to contact us if you have any further questions.
Kind Regards