سلام وقت بخیر
متاسفانه اینکار زیاد عملی نیست چون المنتور رو رسما نمیشه ادیت کرد سورسش رو. یه تعداد فیلتر شاید بشه استفاده کرد اونم قطعی نیست:
add_action( 'woocommerce_before_shop_loop_item_title', 'wk_out_of_stock_variations_loop' );
function wk_out_of_stock_variations_loop(){
global $product;
if ( $product->product_type == 'variable' ) { // if variation product is out of stock
$available = $product->get_available_variations();
if ( $available )foreach ( $available as $instockvar ) {
if ( isset($instockvar['attributes']['attribute_pa_megethos'] ) ) {
if ( ( $instockvar['attributes']['attribute_pa_megethos'] == $_GET['filter_megethos'] ) && (!$instockvar['max_qty']>0) ) {
global $product;
$id = $product->get_id();
echo "<style>.post-$id{display: none}</style>";
}
}
}
}
if ( !$product->is_in_stock() ) { // if single product is out of stock
global $product;
$id = $product->get_id();
echo "<style>.post-$id{display: none}</style>";
}
}
ولی در المنتور در قسمت تنظیمات المان ها، بخش استثناء یا Exclude هست که می تونید یه سری شرط براش تعریف کنید تا یه سری محصولات متغیر رو نشون نده.
ولی اگه این کاروسل کاملا کدنویسی اختصاصی بود می شد با یکی دو ساعت کار روی کدهاش، مشکل رو حل کرد.