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 100ml
Product-B: Bottle with 200ml
Product-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 ???
QUESTION-2: How to get 3-different generated URLs for the ‘BOTTLE’-product…
a) …/website/product-page/bottle?=100ml
b) …/website/product-page/bottle?=200ml
c) …/website/product-page/bottle?=300ml
This question is related to the following one…
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…
And today, people with the same looping questions…
Could wix-location help out in this case?
…or maybe Wix-Router??
Luckely there are still post to be found of some good programmers…