Home › Forums › WoodMart support forum › swatches style
swatches style
- This topic has 13 replies, 2 voices, and was last updated 7 months, 1 week ago by Aizaz Imtiaz Awan.
-
AuthorPosts
-
August 18, 2023 at 11:09 am #489546
kontakt-3113ParticipantHi,
when my product is out of stock, swatch with size attribute doesn’t change.
I have variation products, with sizes from 34 to 48, and one size is out of stock. Customers can’t see which size is out of stock.
August 18, 2023 at 4:42 pm #489659
Aizaz Imtiaz AwanKeymasterHello,
Go to Products > Attributes > edit attribute > Choose the Disabled swatch style.
The Disabled Swatch style is for the variants of the Products which are disabled not for the Out of Stock variants. So, you need to have the variant of the Product not checked with the Enable option on it and then the Disabled Swatch style will work accordingly. See these images for reference:
https://snipboard.io/BMehIF.jpg
https://snipboard.io/NbOzfP.jpgBest Regards.
August 18, 2023 at 4:46 pm #489666
kontakt-3113ParticipantSo if one of my variants will be sold out, the customer won’t see that this variant is not avaiable? I have to manualy disable variant?
August 19, 2023 at 9:20 am #489742
Aizaz Imtiaz AwanKeymasterHello,
When the product variation is out of stock then customers will not be able to select the variation.
And if you want to hide this variation try to add the custom css code in the Theme Settings > Custom CSS:
[class*="wd-swatches"].wd-dis-style-2 .wd-swatch.wd-disabled { display: none !important; }
Best Regards.
August 19, 2023 at 9:27 am #489748
kontakt-3113ParticipantIs it possible to automatically disable variant when it’s out of stock?
I want my clients to see, that some sizes are available and some not, without clicking on all variations just to check that they are not available
August 19, 2023 at 12:19 pm #489794
Aizaz Imtiaz AwanKeymasterHello,
In the ‘Product Data’ section, select the ‘Variations’ tab.
You’ll see a list of variations with their attributes and stock statuses.
You need to deactivate the variation you want.But in the previous reply I gave you a custom css. When your variation is out of stock it is not visible.
Please try to add this code and check the issue.Best Regards.
September 18, 2023 at 10:46 am #496897
kontakt-3113ParticipantHi, unfortunately that CSS don’t work 🙁
Out of stock variation is still visible.
September 18, 2023 at 2:48 pm #497001
Aizaz Imtiaz AwanKeymasterHello,
Can you please share the page url where the out of stock variation is showing. Also share the wp logins detail i will check and give you a possible solution.
Best Regards.
September 20, 2023 at 10:55 pm #497837
kontakt-3113ParticipantYes, details in a private content below:
September 21, 2023 at 10:37 am #497927
Aizaz Imtiaz AwanKeymasterHello,
This code is working fine on your site. I have visited your site and edited the “Bluza damska pastelowo różowa” product. Click on variation and uncheck the option enabled.
https://ibb.co/whsfx5n
And on the product page the variation is not showing:
https://ibb.co/jTn6LhGBest Regards.
September 21, 2023 at 10:45 am #497937
kontakt-3113ParticipantYes, but i need to manualy disable variations that are out of stock.
I will have 300 products in my shop, with 5 variations per product. Its 1500 variations total (!).
Example:
I have a tshirt with 5 sizes (xs, s, m, l , xl). When any size is out of stock, i want it to be hidden OR marked as out of stock. RIght now i can see that some size is out of stock, but only if i click on that size on the product page.
September 21, 2023 at 3:20 pm #498060
Aizaz Imtiaz AwanKeymasterHello,
Sorry to say it is not possible in theme settings to be available for that. It requires customization and beyond our support policy. You need to uncheck the option enabled and it will work for you.
Best Regards.
September 24, 2023 at 3:37 pm #498800
kontakt-3113ParticipantFor those who need the solution, here’s a simple php code to do that:
function ace_grey_out_variations_when_out_of_stock( $is_active, $variation ) {
if ( ! $variation->is_in_stock() ) {
$is_active = false;
}return $is_active;
}
add_filter( ‘woocommerce_variation_is_active’, ‘ace_grey_out_variations_when_out_of_stock’, 10, 2 );September 25, 2023 at 12:28 pm #499009
Aizaz Imtiaz AwanKeymasterHello,
You are Most Welcome.
We are glad that you managed to solve the problem yourself. You are Great!!!
Let us know if there’s anything else we can do for you! You can always reach us at any time. We are always here to help you.
Have a wonderful day.
Topic Closed.
Best Regards. -
AuthorPosts
The topic ‘swatches style’ is closed to new replies.
- You must be logged in to create new topics. Login / Register