Hello, Krzysztof,
Please check the results now. We have provided screenshots for your reference at the following links: https://prnt.sc/imq1P3zGYPrP and https://prnt.sc/OXpE7Beg-Qw5
Additionally, we have also provided an improved version of the code, which can be found at the following link: https://prnt.sc/v7sHazYZ1KtI
Code:
add_action('wp', function() {
// add compatibility with WooCommerce Waitlist plugin and XStore Single product builder
if ( class_exists('Pie_WCWL_Frontend_Simple') ) {
if ( Pie_WCWL_Frontend_Simple::$product_id ) {
global $product;
if ( !$product->is_in_stock() ) {
add_action('etheme_woocommerce_template_single_add_to_cart', array('Pie_WCWL_Frontend_Simple', 'output_waitlist_elements'), 20);
}
else {
add_action('woocommerce_before_add_to_cart_form', array('Pie_WCWL_Frontend_Simple', 'output_waitlist_elements'), 10);
add_action('etheme_sticky_add_to_cart_before', function() {
remove_action('woocommerce_before_add_to_cart_form', array('Pie_WCWL_Frontend_Simple', 'output_waitlist_elements'), 10);
});
add_action('etheme_sticky_add_to_cart_after', function() {
add_action('woocommerce_before_add_to_cart_form', array('Pie_WCWL_Frontend_Simple', 'output_waitlist_elements'), 10);
});
}
}
}
}, 20);
Kind Regards,
8theme team