diff --git a/build.gradle b/build.gradle index 85eff220..5ebe58d9 100644 --- a/build.gradle +++ b/build.gradle @@ -20,7 +20,7 @@ plugins { def compsPath = "screen/store/components" // source JS files in load order def compsJsFiles = [compsPath + "/utilities.js", compsPath + "/ApiServices.js", compsPath + "/ComponentsNav.js", - compsPath + "/ComponentsProduct.js", compsPath + "/ComponentsAccount.js", compsPath + "/ComponentsCheckout.js", compsPath + "/main.js"] + compsPath + "/ComponentsAccount.js", compsPath + "/ComponentsCheckout.js", compsPath + "/main.js"] task combineBaseJs(type: com.eriwen.gradle.js.tasks.CombineJsTask) { encoding = "UTF-8" diff --git a/screen/store/components/ComponentsCheckout.js b/screen/store/components/ComponentsCheckout.js index 1878f38a..2f16a5f0 100755 --- a/screen/store/components/ComponentsCheckout.js +++ b/screen/store/components/ComponentsCheckout.js @@ -55,7 +55,7 @@ storeComps.CheckOutPage = { name: "checkout-page", extends: storeComps.CheckoutNavbar, data: function() { return { - cvv: "", showCvvError: false, homePath: "", storePath: "", customerInfo: {}, productsInCart: {}, shippingAddress: {}, shippingAddressSelect: {}, paymentMethod: {}, shippingMethod: {}, + cvv: "", showCvvError: false, homePath: "", storePath: "", customerInfo: {}, cartItemsImage:{}, productsInCart: {}, shippingAddress: {}, shippingAddressSelect: {}, paymentMethod: {}, shippingMethod: {}, showCheckoutMessages:false, billingAddress: {}, billingAddressOption: "", listShippingAddress: [], listPaymentMethods: [], promoCode: "", promoError: "", postalAddressStateGeoSelected: null, countriesList: [], regionsList: [], shippingOption: "", addressOption: "", paymentOption: "", isSameAddress: "0", shippingItemPrice: 0, isUpdate: false, isSpinner: false, responseMessage: "", toNameErrorMessage: "", countryErrorMessage: "", addressErrorMessage: "", @@ -105,6 +105,12 @@ storeComps.CheckOutPage = { return a + value; }, 0); }, + getProductImage: function(productId) { + if (productId in this.cartItemsImage) + return storeConfig.productImageLocation + this.cartItemsImage[productId].productContentId; + else + return "/store/assets/default.png"; + }, notAddressSeleted: function() { return (this.addressOption == null || this.addressOption == '' || this.listShippingAddress == null || this.listShippingAddress.length == 0); @@ -190,6 +196,7 @@ storeComps.CheckOutPage = { this.addressOption = data.postalAddress.contactMechId + ':' + data.postalAddress.telecomContactMechId; this.shippingAddressSelect = data.postalAddress; this.shippingAddressSelect.contactNumber = data.telecomNumber.contactNumber; + this.cartItemsImage = data.cartItemsImage; } else if (this.listShippingAddress.length) { // Preselect first address this.addressOption = this.listShippingAddress[0].postalContactMechId + ':' + this.listShippingAddress[0].telecomContactMechId; diff --git a/screen/store/components/ComponentsProduct.js b/screen/store/components/ComponentsProduct.js deleted file mode 100644 index e4cc1b99..00000000 --- a/screen/store/components/ComponentsProduct.js +++ /dev/null @@ -1,29 +0,0 @@ -storeComps.ProductImage = { - name: "product-image", - data: function() { return { content: {} } }, - methods: { - getProductContent: function(){ - ProductService.getProductContent(this._props.productId, "PcntImageSmall").then(function (data) { - if(typeof(data.productContent) == 'undefined') { - ProductService.getProductContent(this._props.productId, "PcntImageMedium").then(function (data) { - if(typeof(data.productContent) == 'undefined') { - ProductService.getProductContent(this._props.productId, "PcntImageLarge").then(function (data) { - this.content = data.productContent; - }.bind(this)); - } else{ this.content = data.productContent; } - }.bind(this)); - } else { this.content = data.productContent; } - }.bind(this)); - }, - getProductImage: function() { - if(this.content == null || typeof(this.content.productContentId) == 'undefined') return null; - return storeConfig.productImageLocation + this.content.productContentId; - } - }, - props: ["productId"], - mounted: function() { - this.getProductContent(); - } -}; -storeComps.ProductImageTemplate = getPlaceholderRoute("template_client_productImage", "ProductImage", storeComps.ProductImage.props); - diff --git a/screen/store/components/template/CheckoutPage.html b/screen/store/components/template/CheckoutPage.html index 704ff028..cd6f0de6 100644 --- a/screen/store/components/template/CheckoutPage.html +++ b/screen/store/components/template/CheckoutPage.html @@ -17,8 +17,7 @@
diff --git a/screen/store/d.xml b/screen/store/d.xml
index 930ef42e..67309328 100644
--- a/screen/store/d.xml
+++ b/screen/store/d.xml
@@ -100,7 +100,6 @@ along with this software (see the LICENSE.md file). If not, see
-
diff --git a/service/popstore/CartServices.xml b/service/popstore/CartServices.xml
index 1d6c3f32..1c965313 100755
--- a/service/popstore/CartServices.xml
+++ b/service/popstore/CartServices.xml
@@ -46,6 +46,8 @@ General Order Placement and eCommerce Usage
<#else>
- <#else>
- <#if product.smallImageInfo??>
-
- #if>
+ <#if product.imageInfo??>
+
#if>