FetchError when adding product to the cart

Hello, hope someone can help me, I’m struggliung few days with this.

I have two databases - Wix Store is one (original database where products are stored) and another, second one where I have additional details about same products as in first one, which I’m using on dynamic pages.

I have them connected via one reference column in my custom second DB.

Now to the problem:
I have created Slug page (basically product page) where I’m using data from my custom DB described above.

With this code I’m getting ID of the displayed product which is refering to same product in Wix Store database:

let product = $w('#dynamicDataset').getCurrentItem().refProduct;

refProduct in this case is reference column which is connected to the original product ID in the Wix Store DB.

But when I try to add this product to the cart via code below, I doesn’t put the product to the card and throws this error in to the console.

export async function addToCartButton_click(event, $w) {
 await $w("#shoppingCartIcon").addToCart(product,1);
}

This is the error from console:

Unhandled promise rejection FetchError: [object Object]

I didn’t found any workaround so far and I can’t figure out how to fix the error.

Thanks.
If you need any more info feel free ask :slight_smile: