Hey, I have created a personal layout of a product page via a dynamic page. This layout I would love to have for every item on my page, when you click on it. I already connected everything with the database, but I can replace the product page from six store to my dynamic “product page”.
If you are using the default WIX Shop (All Products) then your only chance is changing the the default productPage element to be collapsed on load. Then you can use code to connect data from the selected product to custom elements you created. Like this:
$w.onReady(async () => {
//This selects the current product, make sure your element id is correct
let currentProduct = await $w('#productPage1').getProduct()
//This inputs data to the elements
$w('#productImg').src = currentProduct.mainMedia
$w('#productTitle').text = currentProduct.name
})
If you could use a dataset element to connect to the “Stores/Products” collection, it would make life easier (less code), but not at the moment.
Maybe @Yisrael (Wix) could help us with that!
Edit: I just tested refreshing my Editors (they were open since yesterday) and you actually CAN insert a dataset element and connect elements withou code. Nice. Sorry about that @Yisrael (Wix).