I have created a custom product and inserted into the wix store products collection, when i navigate to cart page or show mini cart using cart.addproduct() method i got null value for media type in the return object, Please find below code . but getCurrentCart() returns the object which has media value can any one suggest/help, even if i navigate to cart page also image is not displaying first time but when i increse th count image appears.
cart.addProducts(cartObj) .then((res) => {
console.log("Step-5: Product Added to the Cart" + JSON.stringify(res.lineItems))
getCurrentCart() .then((response) => {
// Cart exists
let obj = JSON.parse(JSON.stringify(res.lineItems));
console.log(response);
console.log(new Date());
setTimeout(() => {
// cart.showMiniCart();
navigate.toCart();
$w("#imageX5").hide();
}, 2000);
});
})
.catch((err) => {
console.log("Cart error");
});
})
.catch((err) => {
console.log(err, "Product reference Error");
$w("#imageX5").hide();
});
})