Liquid, JavaScript, themes, sales channels
Hi there,
Just wondering if someone could help me fix the last bit of my code so I can make the swatches etc work for my new set of variables on a particular product.
Image is currently what I'm dealing with, original product variables are showing in the usual spot as swatches and there is two drop-downs located at the bottom of the description with all the merged variants from 2 products.
Needing to obviously usher my code a bit to locate the default option selectors? I'm not that code savy bu I experiment and sometimes get great results.
Can anyone offer some advice?
Thanks in advance.
Cam.
Image:
Code:
Hi Jason,
I am happy to help you out. In regards the the select at the bottom, you can add a css style to just display none to hide them. Would you be able to give more specifics on the goals you are looking to have accomplished with the options.
"Fun part": I am trying since 2 days to do exactly the same.
I combined 2 products, have the multi optionSelector showing all (+100) possible Variant combination, so far so good.
I am to make it more difficult working also with linked-options to have stock updated on variant change, ok and change the slider as well.
I still can't get it to work. I assume that it has to do with the difference of the single selectors (color and size in my case), which are responsible for the swatches and the multi option selector working with the created master product in an array?
Did You solved it?
I did, but couldnt get the stock update via option-select.js all together with swatches for the 100+ products to work.
Anyway, since metafields can hold json strings now, i am using a completely different, would say better solution.
Instead of combining 2 products, i create "metafield products" with as much variants i need, and all the information a normal product would have. i use those to output my product in the shop. Very easy and clean method, if you respect the Shopify way of product json, you just have to add 'metafields' to the object. eg product.title change to product.metafields.titel. only when it comes to ATC i get the real product ID from a special metafield and add to cart.
Thanks for the reply. Your approach makes sense, thanks. I'll think about trying something like that.
Start with a regular "decent" product, quick easy setup to see the way it works.
Good luck!
Hi, can you share your code?
you have in metafields only the handles in json?
thanks
As for the code from Freakdesigns, it loads the dropdown for me in symmetry template, but doesn't add to cart
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