Custom stock status remove from product carouse
-
Hi
I create a custom stock status that i need to hide it from Products Carousel (on hompage and recommanded products ) or treated as an outofstock status.
Can you help me with this situation ?
Or cand you give me some guidance with a filter or a hook?
Thanks,
B
Hello,
Can you please share some screenshots and share the page url where the issue is situated, Also share the wp logins details so i will check and give you a possible solution.
Best Regards.
In function.php line 119 to 128 i define two custom stock
The “X outofstock” need to treat as outofstock or remove from product carousel
From line 129 to 141 i define the product that have “X outofstock” to be treaded as outofstock (to remove de add to cart button).
Thanks,
B.
Hello,
Sorry to say such modification requires complicated code customization which is not covered by our support.
Hope you can understand!
Best Regards.
Ok but…
Is no other way to hide it from carousel ?
Like in this example
add_action( ‘woocommerce_product_query_meta_query’, ‘custom_product_query_meta_query’, 1000 );
function custom_product_query_meta_query( $meta_query ) {
if ( ! is_admin() ) {
$meta_query[] = array(
‘key’ => ‘_stock_status’,
‘value’ => ‘xoutofstock’,
‘compare’ => ‘NOT IN’,
);
}
return $meta_query;
}
But this example hide it from all parts of the website. I want only to hide it from products carousel.
Perhaps it is a filter for this situation when i can add a code snipet who hide specific custom stock status from carousel only.
Thanks,
B
Hello,
Sorry to say but right now there is no option in Theme Settings available for that. It requires Customization and this is beyond our limitations and support policy scope. Hope you can understand our limitations.
Best Regards.