This topic has 6 replies, 2 voices, and was last updated 11 months ago ago by Luca Rossi
Hello, I hope you are well
I want to add a feature
When the color or size is not available, it should not be displayed in the filter search
for example :
The customer enters the shoes category and filters size 40
And I want the shoes whose size 40 is finished not to be displayed in the filter
I also used the code below, but it didn’t work
Thank you for your guidance
add_filter( 'woocommerce_product_variation_get_available', 'hide_unavailable_variations', 10, 3 );
function hide_unavailable_variations( $available_variations, $product, $variation ) {
// Check if the variation is available
if ( ! $variation->is_in_stock() ) {
// If not available, remove it from the list of available variations
foreach ( $available_variations as $key => $value ) {
if ( $value['variation_id'] == $variation->get_id() ) {
unset( $available_variations[$key] );
}
}
}
return $available_variations;
}
Dear @MAHDAR,
We wish to inform you that we have encountered difficulties when attempting to access the Private Content area using the provided administrative credentials. It appears that the login details are no longer functioning as expected.
Could you kindly verify the accuracy of the login information at your earliest convenience?
Best regards,
The 8Theme Team
Hello
Please login with this
Dear @MAHDAR,
We regret to inform you that currently, there are no available hooks to conceal variations of products that are out of stock.
However, as an alternative solution, you may apply the following custom CSS code to hide all variations of products that are out of stock. Please navigate to Theme Options > Theme Custom CSS > Global CSS and insert the code provided below:
[data-attribute="pa_groesse"] li.type-label.sten-li-disabled {
display: none;
}
We trust this will serve as an effective workaround for your requirements.
Best regards,
The 8Theme Team
Thank you very much, can you do this in custom service?
Hi @MAHDAR,
If you wish our developers team can personally assist you via our customization service.
To get started, please follow this link to send us your requirements – https://prnt.sc/PZkD4AEf27qO https://www.8theme.com/account/#etheme_customization_panel , and we will prepare a detailed estimate for the customization work. Our goal is to create a design that aligns with your vision and enhances your website’s appearance and functionality.
Customize your website to suit your needs and make it stand out with our expert dev team.
Best regards,
The 8Theme Team
You must be logged in to reply to this topic.Log in/Sign up