Wix code related products

Hello,

I am trying different ways to suggest related products in my store.
I come across this Velo Tutorial: Adding a Related Products Area to a Wix Store Product Page | Help Center | Wix.com
However, I found out that the related products repeater do not update itself if I click from product to product on the product page https://www.wix.com/code-examples/related-items-vw The code apparently works if I go back to the main store page and choose a new product instead of going to a new product though the suggested product.

Does everyone know how to resolve this? It will be greatly appreciated!!!

Thanks,
Liz


First Product Page

Clicked to second product through first product page, the 4 related products did not change

go back to the main store page and choose the same product, the related product suggestion became normal

Hi Liz! I liked the design of your site.

Hi there,
Anyone know how to fix the issue of this code?
Thanks
L

Hello Lou,

I have exactly the same issue. It happend on my website www.metallzaun.de

It used to be fine and now it works like you said. This is very anoying thing and I am thinking to switch to other ecommerce platform because of that :frowning:

Best regards,
Waldemar

hello!!!
try this,
change the function and add the url of your site to “yoursiteurl”

function relatedItemReady($w, product){
$w(" #productImage “).src = product.mainMedia;
$w(” #productName “).text = product.name ;
$w(” #productPrice “).text = product.formattedPrice;
$w(’ #productImage ').onClick(() => {
wixLocation.to (” https://yoursiteurl/product-page/ " + product.slug);
});
}