JavaScript

Method Description

Implemented in tracker with an ‘async’ or ‘performOperation’ call that accepts product IDs. Operation name and input fields can be set up via Maestra framework.

maestra('async', {
  operation: '<operation name>',
  data: {
    customer: {
      ids: {
      	<ID>: '<ID value>',
      },
    },
    productList: [
      {
        product: {
          ids: {
            <ID>: '<product ID value>'
          },
          sku: {
            ids: {
              <ID>: '<SKU ID value>'
            }
          }
        },
        count: <number of selected product items>,
              price: <price of product item quantity>
      }
      ...
    ]
  }
});

Sample Operations

maestra('async', {
  operation: 'SetCart',
  data: {
    productList:[
      {
        product: {
          ids: {
            bitrixId: '34562'
          }
        },
        count: 1,
        price: 150
      },
      {
        product: {
          ids: {
            bitrixId: '33962'
          }
        },
        count: 2,
        price: 450
      }
    ]
  }
});
maestra('async', {
  operation: 'SetCart',
  data: {
    customer: {
      ids: {
      	bitrixId: '42',
      },
    },
    productList:[
      {
        product: {
          ids: {
            bitrixId: '34562'
          }
        },
        count: 1,
        price: 150
      },
      {
        product: {
          ids: {
            bitrixId: '33962'
          }
        },
        count: 2,
        price: 450
      }
    ]
  }
});
maestra('performOperation', {
  operation: 'AddInStockList',
  data: {
    action: {
      productId: '1593754'
    }
  }
});
maestra('performOperation', {
  operation: 'priceDrop',
  data: {
    action: {
      productId: '15393754',
      price: 1500
    }
  }
});
maestra('performOperation', {
  operation: 'DeleteFormWishlist',
  data: {
    action: {
      productId: '567657',
      skuId: '567657-green-52'
    }
  }
});