Comments 5Jesica started the conversationDecember 17, 2024 at 6:04pmHi, Dustin, how are you?What are the possibilities for hiding out-of-stock products in the recommended products from FlyCart? How can I add a specific class to those products, maybe by editing a file? I've tried using php and JS code, but it doesn't work. Thank you so much.Attached files: Home - Beauty Now.png 1,281Dustin repliedDecember 19, 2024 at 10:10amHi Jesica, Please add the custom code below. (How to add custom code? ↗): add_filter( 'woofc_suggested_products_before_limit', function ( $suggested_products ) { foreach ( $suggested_products as $suggested_product_id ) { $suggested_product = wc_get_product( $suggested_product_id ); if ( ! is_a( $suggested_product, 'WC_Product' ) || ! $suggested_product->is_purchasable() || ! $suggested_product->is_in_stock() ) { $suggested_products = array_diff( $suggested_products, [ $suggested_product_id ] ); } } return $suggested_products; } );Best regards,Dustin 5Jesica repliedDecember 20, 2024 at 6:36pmWe love you so much. Sign in to reply ...
Hi, Dustin, how are you?
What are the possibilities for hiding out-of-stock products in the recommended products from FlyCart? How can I add a specific class to those products, maybe by editing a file? I've tried using php and JS code, but it doesn't work.
Thank you so much.
Attached files: Home - Beauty Now.png
Hi Jesica,
Please add the custom code below. (How to add custom code? ↗):
Best regards,
Dustin
We love you so much.