Product not added to cart when using

I am using eCommerce Catalog Custom Extension to create a new collection of products, called “Itens”.

I already coded frontend and backend scripts, but when the user clicks the button, I have a success log message that item was added to cart, but the cart continues with zero items.


import {addLensToCart} from 'backend/ecom-integration';

let selectedLens;

$w.onReady(function () {
    const lensDetailsRepeater = $w('#lensRepeater');
    lensDetailsRepeater.onItemReady(($item, itemData, index) => {
        $item('#subtitleText').text = itemData.subtitle;
        $item('#subtitleText').onClick(() => {
            selectedLens = itemData; 

    $w('#btnAddToCart').onClick(() => {
        const item = $w("#dynamicDataset").getCurrentItem();
        const lineItem = {
            id: item._id,



import { currentCart, cart } from 'wix-ecom-backend';

export async function addLensToCart(lensId) {
    const options = {
        lineItems: [{
            catalogReference: {
                appId: "96c81ef5-dbfe-471b-b449-7fb7a1552cd6",
                catalogItemId: lensId,

            quantity: 1, 
             title: item.title,
             price: item.price,
             mainMedia: item.image,
             description: item.description,
             quantityAvailable: 1,


    const myCart = await currentCart.getCurrentCart();
    if (myCart) {
        const addToCartIdResponse = await cart.addToCart(myCart._id, options);
        console.log("addToCartIdResponse: ", {addToCartIdResponse});
    } else {
        const createCartResponse = await cart.createCart(options);
        console.log("createCartResponse: ", {createCartResponse});

Any ideas on what could be going wrong?



Hi, curious if you got this working. I am planning on adding something similar for our site but I’m concerned that as this is a beta feature it may have issues. I can’t even get the catalog extension to publish to get the appid. Did you do anything special to do that? I posted a question here about it:

Would like to know if the extension has been working for you as we are also trying to add items to the cart from our own backend and not a wix collection.