commercelayer
Advanced tools
Comparing version 1.7.6 to 1.7.7
{ | ||
"name": "commercelayer", | ||
"version": "1.7.6", | ||
"version": "1.7.7", | ||
"description": "The Official Commerce Layer JS library", | ||
@@ -5,0 +5,0 @@ "main": "./src/main.js", |
@@ -140,2 +140,4 @@ const config = require('./config') | ||
).then(data => { | ||
console.log('createOrder'); | ||
console.log(data); | ||
utils.setOrderToken(data.get('token')) | ||
@@ -257,2 +259,4 @@ return(data) | ||
console.log(shoppingBagItem); | ||
// image | ||
@@ -282,2 +286,3 @@ let shoppingBagItemImage = shoppingBagItem.querySelector('.clayer-shopping-bag-item-image') | ||
qtySelect.addEventListener('change', function(event){ | ||
event.preventDefault() | ||
api.updateLineItemQty(this.dataset.lineItemId, this.value) | ||
@@ -325,5 +330,3 @@ }) | ||
let order = response.get(['line_items'])[0] | ||
if (order && order.line_items) { | ||
if (response.get(['line_items']).length > 0) { | ||
api.updateShoppingBagItems(response) | ||
@@ -330,0 +333,0 @@ ui.hideShoppingBagUnavailableMessage() // refactor |
@@ -33,5 +33,8 @@ const ui = require('./ui') | ||
console.log(utils.getOrderToken()); | ||
orderPromise = utils.getOrderToken() ? api.getOrder() : api.createOrder() | ||
orderPromise.then(function(order){ | ||
api.createLineItem(order.get('id')[0], addToBag.dataset.skuId, addToBag.dataset.skuName, addToBag.dataset.skuImageUrl).then(function(lineItem){ | ||
@@ -38,0 +41,0 @@ api.getOrder() |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
300215
2042