Liquid, JavaScript, themes, sales channels
Help Needed Please.
I am on Minimal theme and whenever I show products that have no sizes to display there is a 'size NOSIZE' dropdown that shows.
Screenshot below.
I would like to see if there is a way I can make sure that the size dropdown doesn't show when there are no sizes available.
Is this possible at all?
https://purestylecollection.com/collections/mens-watches/products/kom-w3012
Thanks in advance for the help, if anyone can offer any?
You could remove the size option on the product from the admin if it is not needed.
Thank you for your reply.
I know that there is a way to manually remove the size Variant on each product through admin.
I'm looking for a way, in code, to make it so that it is automatically hidden on my website if there is no size options available.
Thanks
But there is a size option, that is how nosize was added, as a nosize option.
Assuming when nosize exists its alone you could use this js:
$('[value="NOSIZE"]').closest('.selector-wrapper').hide();
That could go in your theme.js right after
var selectCallback = function(variant, selector) {
self.productPage({
money_format: theme.moneyFormat,
variant: variant,
selector: selector,
translations: {
add_to_cart: theme.strings.addToCart,
sold_out: theme.strings.soldOut,
unavailable: theme.strings.unavailable
}
});
Thank you for your reply and your help.
That has worked in removing the size NOSIZE perfectly, but it has also removed the colour Variant. Example below.
Is there any way to just isolate the 'size' = NOSIZE and leave the colour Variant showing, even if it is just the 1 colour. ie. black in this example. Screenshot below
Thank you again for your help.
Thats odd, the code is just for nosize, I can't see what I might be missing.
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024