All things Shopify and commerce
Hi,
Anyone know how to suppress a variant based on title - or manually?
I tried to use the text contains function in a smart collection - but that doesn't suppress the variant, it suppresses the entire listing if the variant condition is met.
Prefer not to use an app
TIA
Amy
Hi Amy,
What do you mean when you say you want to suppress the variant?
Let's say we have an item with 3 variants. ITEM A, Var 1, Var 2, Var 3.
We want to exclude Var 2, so that ITEM A displays Var 1 and Var 3.
If we use standard shopify functionality in a collection to NOT INCLUDE "Var 2", the entire ITEM A is suppressed, not just Var 2.
There must be a condition or say a reason for you to hide a specific variant?
Let's say for example that you want to hide out of stock variants, we can check with code that if a Variant is out of stock then don't display it on the frontend.
The criteria is something in the description of the variant or a tag in the variant - then the variant should be suppressed. (But what shopify does is suppress the entire item and ALL variants of that item). The way we're doing it now is with multiple warehouses and 0 stock and then suppress when out of stock (in the shop location). But that doesn't help us with a 2nd online collection - so if we could have that collection be without the variants by either forcing it to another location (how to do that) and then using the suppress, we could make it work. But the easiest is to suppress based on "XYZ" in the title of the variant. Long winded explanation 🙂
It is certainly a long explanation, thanks for the try though. But let's try keeping it simple.
So you need to hide a variant when a tag or title is met or some condition particular to that variant is met.
If you are looking to remove the variant from the variant selectors inside a product we can add an if condition to the list or loop responsible for rendering the variant. That way user won't be able to select that variant.
Just a suggestion from what in understood of your requirement.
Best
Shadab
No - the user should not even see the variant - not just be unable to select it.
Yeah I get the point if you remove or hide the variant option user won't even see the option to select it, and if you can't select it then it won't be displayed.
So ofcourse the variant will be in the backend but user won't have an option to see it
So how to do that? Shopify selection criteria suppresses the entire item, not just the variable. 🙂
What I am suggesting you is kind of a hack and will need to edit code.
So this is just the logic of a possibility will try to implement this. Will need access to the store with permissions to see products and edit code trying to implement the logic.
Please reach out via personal links below for a convenient conversation and collaboration.
Best
Shadab
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024