I've created a custom product page and am encountering challenges with the variants section. After users make their selections (like choosing colors, sizes, etc.), I need a way to search for these selected choices within the variants collection. The goal is to identify and set the appropriate variant ID, so it can be added to the cart.
I've attempted several solutions without success. Has anyone managed to address this issue?
@Gaming Marula @Tony Daian I demonstrate how to do this here: https://www.youtube.com/watch?v=A37mjU87pHg
Hey @Tony Daian did you solve this problem? If you did, please tell me how because i am running into the same problem
Just some hours ago, i posted this one on another FORUM....
I am playing a little bit around with the Wix-Stores-App (investigating it a little bit).
I found now a second disatvantage of the Wix-Stores-APP.Maybe someone already has encountered the same problems.
-Once you settep-up your Wix-Store, you generate some products through your Wix-Dashboard. In some cases, you will generate PRODUCTS which will have different kind of VARIANTS (different colors, different sizes and so on).
Ok, after generating such a PRODUCT with diffeerent VARIANTS, the product gets stored inside of the DATABASE, till here everything seems to be good.
But what if a CUSTOMER wants to have for each VARIANT, a unique (out of the variant-product-values) generated URL ???
Example:Product-A: Bottle with 100mlProduct-B: Bottle with 200mlProduct-C: Bottle with 300ml
The ‘BOTTLE’-product itself is all the same, just having different ml-volume.
Inside of the database → PRODUCTS <— the product gets generated just once and has a basic (automatically generated) URL something like →
…/website/product-page/bottle
We remember → we have created 3x different VARIANTS → and now on our PRODUCT-PAGE we can find an automatic generated DROPDOWN where we can choose the VARIANT.
QUESTION-1: Where to find the TRIGGER for the DROPDOWN? (onChange) ???
…seemed to be promissing, but for wix-studio only ???
2023-12-09 23_46_39-onChoiceSelected - Velo API Reference - Wix.com1929×1484 141 KB
QUESTION-2: How to get 3-different generated URLs for the ‘BOTTLE’-product…a) …/website/product-page/bottle?=100mlb) …/website/product-page/bottle?=200mlc) …/website/product-page/bottle?=300ml
This question is related to the following one…
Wix-Stores ---> Getting the selected VARIANT Ask a question
I mean i have already created/found a workaround, but maybe there are better solution for it → (not to be forced to generate some BYPASS-CODING and DESIGNING).
Additional-Info: In the ordinary HTML/JS-World i probably would use something like…
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>URL Change Example</title> </head> <body> <button onclick="changeURL()">Change URL</button> <script> function changeURL() { window.history.pushState(null, "New Title", "/new-url"); } </script> </body> </html>
But Wix surely will not allow changes to the URL path using the pushState method directly due to security restrictions. By using the pushState-Method i shoulld be able to generate what i want (changing the URL inside my BROWSER-INPUT DIRECTLY WITHOUT REDIRICTION OR RELOADING OF MY CURRENT PAGE).
If someone ask himself, if the described issue is able to be resolved?→ YES, it can be resolved → but by a somekind of a very tricky and time-consuming BYPASS-CODING and restructuring of the whole PRODUCT-PAGE.
I am searching for a simple solution.
As i can see → 2020 <–there was already the same/similar problems…
On WIX Stores, Product page, how to add a button that opens a URL Ask a question
And today, people with the same looping questions…
Unique URL for each product variant Ask a question
Could wix-location help out in this case?
External Imagewix.com
wix-location-frontend - Velo API Reference - Wix.com
The wix-location-frontend module contains functionality for getting information about the URL of the current page and for navigating to other pages.
…or maybe Wix-Router??
External Imagewix.com
wix-router - Velo API Reference - Wix.com
This module contains the APIs for code routers and data binding router hooks.
Luckely there are still post to be found of some good programmers…
How to make repeater items pages have their own URL Ask a question
@Eitan Waxman --> Maybe some very good stuff for your next VIDEO ???
You seem to be on a good coding level ! 😉
Would like to see --> what would be your solution.
Surely no challange for you.
!!! HAPPY CODING !!!
Hi Tony,
Can you share some of the things you've tried?