From df18b3bceffd93345c86d49cfd94d948aecfdb3e Mon Sep 17 00:00:00 2001 From: rakesh Date: Fri, 28 Jan 2022 18:20:14 +0530 Subject: [PATCH 1/2] remove extra code --- src/components/gate/GateLayout.vue | 11 +-- src/components/layout/Layout.vue | 11 +-- src/components/layout/header/Header.vue | 14 ++-- .../header/NavigationDrawerComponent.vue | 26 +++---- .../address/BillingAddressComponent.vue | 4 +- .../address/MeVerifyAddressComponent.vue | 10 +-- .../address/VerifyAddressComponent.vue | 6 +- .../retailer/cart-product/CartProductList.vue | 11 +-- .../retailer/layout/header/Header.vue | 4 +- .../ConfiguredProductDetailComponent.vue | 5 +- .../GiftCardDetailsComponent.vue | 37 +--------- .../product-detail/ProductDetailComponent.vue | 5 +- src/routes/retailer/cart_products.vue | 9 +-- src/routes/retailer/checkout_page.vue | 74 ++----------------- src/routes/retailer/order_success.vue | 13 +--- 15 files changed, 42 insertions(+), 198 deletions(-) diff --git a/src/components/gate/GateLayout.vue b/src/components/gate/GateLayout.vue index 788aafd..32a42f4 100644 --- a/src/components/gate/GateLayout.vue +++ b/src/components/gate/GateLayout.vue @@ -165,9 +165,7 @@ export default { userAuth: function () { return this.$store.state.auth.userAuth; }, - guestQuoteId: function () { - return this.$store.state.guestInfo.guestQuoteId; - }, + userName: function () { return this.$store.state.accountOne.one.firstname; }, @@ -329,16 +327,11 @@ export default { this.$store.dispatch("headerCategoryList/fetchCategoryList"); } - this.$store.dispatch("block/fetchHeaderPromoBanner", this.blockId); + // this.$store.dispatch("block/fetchHeaderPromoBanner", this.blockId); if (this.userAuth) { this.$store.dispatch("userCartProduct/cartProductList"); // this.$store.dispatch("userCartProduct/productTotalAmt"); this.$store.dispatch("accountOne/basicInfo"); - } else { - if (this.guestQuoteId) { - this.$store.dispatch("cartProduct/cartProductList", this.guestQuoteId); - this.$store.dispatch("cartProduct/productTotalAmt", this.guestQuoteId); - } } }, }; diff --git a/src/components/layout/Layout.vue b/src/components/layout/Layout.vue index 8ce7555..c365e86 100644 --- a/src/components/layout/Layout.vue +++ b/src/components/layout/Layout.vue @@ -359,9 +359,7 @@ export default { userAuth: function () { return this.$store.state.auth.userAuth; }, - guestQuoteId: function () { - return this.$store.state.guestInfo.guestQuoteId; - }, + userName: function () { return this.$store.state.accountOne.one.firstname; }, @@ -695,12 +693,7 @@ export default { this.$store.dispatch("userCartProduct/cartProductList"); // this.$store.dispatch("userCartProduct/productTotalAmt"); this.$store.dispatch("accountOne/basicInfo"); - } else { - if (this.guestQuoteId) { - this.$store.dispatch("cartProduct/cartProductList", this.guestQuoteId); - this.$store.dispatch("cartProduct/productTotalAmt", this.guestQuoteId); - } - } + } if (this.userVisits) { let userVisits = Number(this.userVisits) + 1; localStorage.setItem("cr_userVisitCount", userVisits); diff --git a/src/components/layout/header/Header.vue b/src/components/layout/header/Header.vue index 05653c4..b5ba15a 100644 --- a/src/components/layout/header/Header.vue +++ b/src/components/layout/header/Header.vue @@ -733,14 +733,14 @@ export default { if (this.userAuth) { return this.$store.state.userCartProduct.cartProductsProgress; } else { - return this.$store.state.cartProduct.cartProductsProgress; + return ''; } }, inProgress: function () { if (this.userAuth) { return this.$store.state.userCartProduct.inProgress; } else { - return this.$store.state.cartProduct.inProgress; + return ''; } }, isDesktop: function () { @@ -781,14 +781,12 @@ export default { userAuth: function () { return this.$store.state.auth.userAuth; }, - guestQuoteId: function () { - return this.$store.state.guestInfo.guestQuoteId; - }, + cartProductsItem() { if (this.userAuth) { return this.$store.state.userCartProduct.cartProductList; } else { - return this.$store.state.cartProduct.cartProductList; + return '' } }, @@ -858,9 +856,7 @@ export default { showCartDrawer(flag) { if (this.userAuth) { this.$store.dispatch("userCartProduct/cartDrawer", flag); - } else { - this.$store.dispatch("cartProduct/cartDrawer", flag); - } + } }, showMessage(obj) { diff --git a/src/components/layout/header/NavigationDrawerComponent.vue b/src/components/layout/header/NavigationDrawerComponent.vue index e8946c7..cfaec8a 100644 --- a/src/components/layout/header/NavigationDrawerComponent.vue +++ b/src/components/layout/header/NavigationDrawerComponent.vue @@ -135,15 +135,13 @@ export default { userAuth: function() { return this.$store.state.auth.userAuth; }, - guestQuoteId: function() { - return this.$store.state.guestInfo.guestQuoteId; - }, + cartDrawer: { get() { if (this.userAuth) { return this.$store.state.userCartProduct.cartDrawer; } else { - return this.$store.state.cartProduct.cartDrawer; + return '' } }, set() {} @@ -152,14 +150,14 @@ export default { if (this.userAuth) { return this.$store.state.userCartProduct.cartProductsProgress; } else { - return this.$store.state.cartProduct.cartProductsProgress; + return '' } }, inProgress: function() { if (this.userAuth) { return this.$store.state.userCartProduct.inProgress; } else { - return this.$store.state.cartProduct.inProgress; + return '' } }, cartTotalAmtProgress() { @@ -173,14 +171,14 @@ export default { if (this.userAuth) { return this.$store.state.userCartProduct.cartProductList; } else { - return this.$store.state.cartProduct.cartProductList; + return ''; } }, cartProductTotalAmt() { if (this.userAuth) { return this.$store.state.userCartProduct.productTotalAmt; } else { - return this.$store.state.cartProduct.productTotalAmt; + return '' } }, @@ -217,9 +215,7 @@ export default { goToCheckout() { if (this.userAuth) { this.$store.dispatch("userCartProduct/cartDrawer", false); - } else { - this.$store.dispatch("cartProduct/cartDrawer", false); - } + } let pagePath = this.$route.path; let isGateModulePage = pagePath.includes("/gate/"); if (isGateModulePage) { @@ -249,9 +245,7 @@ export default { // this.cartDrawer=false; if (this.userAuth) { this.$store.dispatch("userCartProduct/cartDrawer", false); - } else { - this.$store.dispatch("cartProduct/cartDrawer", false); - } + } }, stopPropogation(event) { event.stopPropagation(); @@ -259,9 +253,7 @@ export default { closeCartDrawer(flag) { if (this.userAuth) { this.$store.dispatch("userCartProduct/cartDrawer", flag); - } else { - this.$store.dispatch("cartProduct/cartDrawer", flag); - } + } }, resizeCart() { return this.sideBarHeight() && this.productListHeight(); diff --git a/src/components/retailer/address/BillingAddressComponent.vue b/src/components/retailer/address/BillingAddressComponent.vue index e953533..39a7ee9 100644 --- a/src/components/retailer/address/BillingAddressComponent.vue +++ b/src/components/retailer/address/BillingAddressComponent.vue @@ -42,9 +42,7 @@ export default { verifyAddress: function() { if (this.userAuth) { return this.$store.state.accountOne.address; - } else { - return this.$store.state.guestInfo.address; - } + } }, countryAndStatesList() { return this.$store.state.accountOne.allCountries; diff --git a/src/components/retailer/address/MeVerifyAddressComponent.vue b/src/components/retailer/address/MeVerifyAddressComponent.vue index b67c6e5..6e8148b 100644 --- a/src/components/retailer/address/MeVerifyAddressComponent.vue +++ b/src/components/retailer/address/MeVerifyAddressComponent.vue @@ -66,16 +66,12 @@ export default { verifyAddress: function() { if (this.userAuth) { return this.$store.state.accountOne.address; - } else { - return this.$store.state.guestInfo.address; - } + } }, fetchInProgress() { if (this.userAuth) { return this.$store.state.accountOne.inProgress; - } else { - return this.$store.state.guestInfo.fetchInProgress; - } + } }, countryAndStatesList() { return this.$store.state.accountOne.allCountries; @@ -91,8 +87,6 @@ export default { userSelectedState: function() { if (this.userAuth) { return this.$store.state.accountOne.address.regionId; - } else { - return this.$store.state.guestInfo.address.regionId; } }, }, diff --git a/src/components/retailer/address/VerifyAddressComponent.vue b/src/components/retailer/address/VerifyAddressComponent.vue index 80da026..6387ab4 100644 --- a/src/components/retailer/address/VerifyAddressComponent.vue +++ b/src/components/retailer/address/VerifyAddressComponent.vue @@ -119,14 +119,14 @@ export default { if (this.userAuth) { return this.$store.state.accountOne.address; } else { - return this.$store.state.guestInfo.address; + return '' } }, fetchInProgress() { if (this.userAuth) { return this.$store.state.accountOne.inProgress; } else { - return this.$store.state.guestInfo.fetchInProgress; + return '' } }, countryAndStatesList() { @@ -144,7 +144,7 @@ export default { if (this.userAuth) { return this.$store.state.accountOne.address.regionId; } else { - return this.$store.state.guestInfo.address.regionId; + return '' } }, }, diff --git a/src/components/retailer/cart-product/CartProductList.vue b/src/components/retailer/cart-product/CartProductList.vue index 534552f..81dec21 100644 --- a/src/components/retailer/cart-product/CartProductList.vue +++ b/src/components/retailer/cart-product/CartProductList.vue @@ -613,9 +613,7 @@ export default { userAuth: function () { return this.$store.state.auth.userAuth; }, - guestQuoteId: function () { - return this.$store.state.guestInfo.guestQuoteId; - }, + /*productAttributes: function() { return this.$store.state.productOne.productAttributes; },*/ @@ -649,11 +647,7 @@ export default { calledListrakCartList() { if (this.userAuth) { this.$store.dispatch("userCartProduct/setListrakCartList"); - } else { - if (this.guestQuoteId) { - this.$store.dispatch("cartProduct/setListrakCartList"); - } - } + } }, changeCheckoutFlag(flag) { this.$emit("stockFlag", flag); @@ -1158,7 +1152,6 @@ export default { await this.$store.dispatch( "cartProduct/removeCartProduct", this.productId - //guestQuoteId: this.guestQuoteId ); googleAanalyticsEventRemoveCart('remove_from_cart',this.productDetails) removeCookieByName(this.productId); diff --git a/src/components/retailer/layout/header/Header.vue b/src/components/retailer/layout/header/Header.vue index 3cea731..0dc91e1 100644 --- a/src/components/retailer/layout/header/Header.vue +++ b/src/components/retailer/layout/header/Header.vue @@ -245,9 +245,7 @@ export default { userAuth: function () { return this.$store.state.auth.userAuth; }, - guestQuoteId: function () { - return this.$store.state.guestInfo.guestQuoteId; - }, + categoryList: function () { return this.$store.state.headerCategoryList.categoryList; }, diff --git a/src/components/retailer/product-detail/ConfiguredProductDetailComponent.vue b/src/components/retailer/product-detail/ConfiguredProductDetailComponent.vue index 131362d..9b49011 100644 --- a/src/components/retailer/product-detail/ConfiguredProductDetailComponent.vue +++ b/src/components/retailer/product-detail/ConfiguredProductDetailComponent.vue @@ -517,9 +517,7 @@ export default { userAuth: function() { return this.$store.state.auth.userAuth; }, - guestQuoteId: function() { - return this.$store.state.guestInfo.guestQuoteId; - }, + inProgress: function() { if (this.userAuth) { return this.$store.state.userCartProduct.inProgress; @@ -736,7 +734,6 @@ export default { .dispatch("cartProduct/updateToConfiguredCart", { sku: sku, qty: this.selectedQty, - //guestQuote: this.guestQuoteId, itemId: this.itemId, typeId: typeId, optionId: optionId, diff --git a/src/components/retailer/product-detail/GiftCardDetailsComponent.vue b/src/components/retailer/product-detail/GiftCardDetailsComponent.vue index 48170fd..2cfd38e 100644 --- a/src/components/retailer/product-detail/GiftCardDetailsComponent.vue +++ b/src/components/retailer/product-detail/GiftCardDetailsComponent.vue @@ -646,9 +646,7 @@ export default { userAuth: function() { return this.$store.state.auth.userAuth; }, - guestQuoteId: function() { - return this.$store.state.guestInfo.guestQuoteId; - }, + inProgress: function() { if (this.userAuth) { return this.$store.state.userCartProduct.inProgress; @@ -774,31 +772,7 @@ export default { timeout: 3000 }; } - } else { - try{ - await this.$store.dispatch("cartProduct/updateToGiftCart", { - sku: sku, - qty: this.selectedQty, - guestQuote: this.guestQuoteId, - itemId: this.itemId - }) - - this.snackbar = { - message: "Product Updated Successfully", - color: "success", - show: true, - timeout: 3000 - }; - } - catch(error){ - this.snackbar = { - message: error.message, - color: "error", - show: true, - timeout: 3000 - }; - } - } + } if(this.$route.name == productName) this.$router.push({ name: productName, @@ -831,12 +805,7 @@ export default { await this.$store.dispatch("userCartProduct/fetchGiftMessage", { itemId: this.itemId }); - } else { - this.$store.dispatch("cartProduct/fetchGiftMessage", { - guestQuote: this.guestQuoteId, - itemId: this.itemId - }); - } + } } } }, diff --git a/src/components/retailer/product-detail/ProductDetailComponent.vue b/src/components/retailer/product-detail/ProductDetailComponent.vue index 30ad351..7f31a03 100644 --- a/src/components/retailer/product-detail/ProductDetailComponent.vue +++ b/src/components/retailer/product-detail/ProductDetailComponent.vue @@ -582,9 +582,7 @@ export default { userAuth: function() { return this.$store.state.auth.userAuth; }, - guestQuoteId: function() { - return this.$store.state.guestInfo.guestQuoteId; - }, + inProgress: function() { if (this.userAuth) { return this.$store.state.userCartProduct.inProgress; @@ -761,7 +759,6 @@ export default { .dispatch("cartProduct/updateToCart", { sku: sku, qty: this.selectedQty, - //guestQuote: this.guestQuoteId, itemId: this.itemId, ccid: null, price: null, diff --git a/src/routes/retailer/cart_products.vue b/src/routes/retailer/cart_products.vue index f646777..86177e1 100644 --- a/src/routes/retailer/cart_products.vue +++ b/src/routes/retailer/cart_products.vue @@ -190,7 +190,6 @@ import CartProductList from "@/components/retailer/cart-product/CartProductList" import RetailerSearchProducts from "@/components/retailer/retailer-search/RetailerSearchProducts"; import SnackbarComponent from "@/components/common/SnackbarComponent"; -import { getCookieByName } from "@/services/auth"; import { priceFormatter } from "@/services/util.service"; export default { name: "CartProducts", @@ -230,9 +229,7 @@ export default { userAuth: function () { return this.$store.state.auth.userAuth; }, - guestQuoteId: function () { - return getCookieByName("cr_guestQuoteId"); - }, + cartProductsItem() { if (this.userAuth) { return this.$store.state.userCartProduct.cartProductList; @@ -293,10 +290,6 @@ export default { calledCriteoViewBasket() { if (this.userAuth) { this.$store.dispatch("userCartProduct/setCriteoViewBasket"); - } else { - if (this.guestQuoteId) { - this.$store.dispatch("cartProduct/setCriteoViewBasket"); - } } }, removeMinus(val) { diff --git a/src/routes/retailer/checkout_page.vue b/src/routes/retailer/checkout_page.vue index da0df3f..ad094c4 100644 --- a/src/routes/retailer/checkout_page.vue +++ b/src/routes/retailer/checkout_page.vue @@ -39,7 +39,7 @@ justify="center" class="py-5" no-gutters - v-if="cartProductsItem.length && (guestQuoteId || userAuth)" + v-if="cartProductsItem.length && ( userAuth)" > @@ -1161,7 +1161,7 @@ /* eslint-disable */ var client = require("braintree-web/client"); const baseUrl = process.env.VUE_APP_BASE_URL; -const paypalCheckout = require("braintree-web/paypal-checkout"); +//const paypalCheckout = require("braintree-web/paypal-checkout"); import SnackbarComponent from "@/components/common/SnackbarComponent"; import CartProductList from "@/components/retailer/cart-product/CartProductList"; import ShippingAddressFormComponent from "@/components/retailer/address/ShippingAddressFormComponent"; @@ -1170,12 +1170,11 @@ import BillingAddressComponent from "@/components/retailer/address/BillingAddres import VerifyAddressComponent from "@/components/retailer/address/VerifyAddressComponent"; import CardPayment from "@/components/retailer/payment/CardPayment"; import { createHelpers } from "vuex-map-fields"; -import { getCookieByName } from "@/services/auth"; -import { VueTelInput } from "vue-tel-input"; + import { VueTelInput } from "vue-tel-input"; import { googleAanalyticsPurchase, googleAanalyticsCheckout, - checkEncodeURI, + // checkEncodeURI, priceFormatter, fetchStates, googleAanalyticsCheckoutAddShippingInfo, @@ -1364,10 +1363,7 @@ export default { userAuth: function () { return this.$store.state.auth.userAuth; }, - guestQuoteId: function () { - return getCookieByName("cr_guestQuoteId"); - // return this.$store.state.guestInfo.guestQuoteId; - }, + fetchSeletedAddress: function () { return this.$store.state.accountOne.seletedAddress; }, @@ -1638,33 +1634,8 @@ export default { timeout: 2000, }; }); - } else { - this.$store - .dispatch("cartProduct/applyDiscountCode", { - discountTextCode: this.discountTextCode, - guestQuoteId: this.guestQuoteId, - }) - .then(() => { - this.snackbar = { - message: "Your coupon was successfully applied", - color: "success", - show: true, - timeout: 2000, - }; - this.$store.dispatch("guestInfo/setShippingInformation", { - method: this.estimatedShipping, - email: this.email, - }); - }) - .catch((error) => { - this.snackbar = { - message: error.message, - color: "error", - show: true, - timeout: 2000, - }; - }); - } + } + } }, removeDiscountCode() { @@ -1695,32 +1666,6 @@ export default { timeout: 2000, }; }); - } else { - this.$store - .dispatch("cartProduct/removeDiscountCode", { - discountTextCode: this.discountTextCode, - guestQuoteId: this.guestQuoteId, - }) - .then(() => { - this.snackbar = { - message: "Your coupon was successfully removed", - color: "success", - show: true, - timeout: 2000, - }; - this.$store.dispatch("guestInfo/setShippingInformation", { - method: this.estimatedShipping, - email: this.email, - }); - }) - .catch((error) => { - this.snackbar = { - message: error.message, - color: "error", - show: true, - timeout: 2000, - }; - }); } } }, @@ -1918,11 +1863,6 @@ export default { }*/ if (vm.userAuth) { await vm.$store.dispatch("accountOne/setEstimatedShipping"); - } else if (vm.guestQuoteId) { - await vm.$store.dispatch( - "guestInfo/setEstimatedShipping", - vm.email - ); } this.addressInProgress = false; } diff --git a/src/routes/retailer/order_success.vue b/src/routes/retailer/order_success.vue index 6209350..fa1058b 100644 --- a/src/routes/retailer/order_success.vue +++ b/src/routes/retailer/order_success.vue @@ -152,10 +152,7 @@ export default { userAuth: function () { return this.$store.state.auth.userAuth; }, - guestQuoteId: function () { - return getCookieByName("cr_guestQuoteId"); - // return this.$store.state.guestInfo.guestQuoteId; - }, + orderNo: function () { return this.$route.params.orderNumber; }, @@ -237,13 +234,7 @@ export default { this.$store.dispatch("userCartProduct/cartProductList"); // this.$store.dispatch("userCartProduct/productTotalAmt"); this.$store.dispatch("meProductOne/fetchOrderProduct", this.orderNo); - } else { - if (this.guestQuoteId) { - this.$store.dispatch("cartProduct/cartProductList", this.guestQuoteId); - this.$store.dispatch("cartProduct/productTotalAmt", this.guestQuoteId); - } - this.$store.dispatch("meProductOne/fetchOrderProduct", this.orderNo); - } + } }, }; \ No newline at end of file From f761e502e83f5146a1a3279d2bd88fed5c8520cf Mon Sep 17 00:00:00 2001 From: rakesh Date: Mon, 31 Jan 2022 12:38:16 +0530 Subject: [PATCH 2/2] fixes --- package.json | 2 -- public/index.html | 12 +++---- src/components/gate/GateLayout.vue | 7 ++-- src/components/layout/Layout.vue | 2 +- .../layout/footer/FooterComponent.vue | 4 +-- src/components/layout/header/Header.vue | 8 ++--- src/components/layout/sub-menu/SubMenu.vue | 33 +++++++++---------- .../retailer/breadcrumb/Breadcrumb.vue | 10 +++--- .../retailer/cart-product/CartProductList.vue | 12 +++---- .../retailer/layout/header/Header.vue | 14 ++++---- .../ConfiguredProductDetailComponent.vue | 6 ++-- .../GiftCardDetailsComponent.vue | 6 ++-- .../product-detail/ProductDetailComponent.vue | 12 +++---- .../retailer/search/SearchProducts.vue | 29 ++++++++-------- src/main.js | 33 +++---------------- src/routes/retailer/cart_products.vue | 6 ++-- src/routes/retailer/checkout_page.vue | 32 +++++++++--------- src/routes/retailer/order_success.vue | 4 +-- src/routes/retailer/product_page.vue | 12 +++---- src/services/nav.js | 4 +-- src/stores/retailer/account.one.js | 4 +-- src/stores/retailer/user_cart.one.js | 16 ++++----- 22 files changed, 118 insertions(+), 150 deletions(-) diff --git a/package.json b/package.json index 88b739e..2686dc3 100644 --- a/package.json +++ b/package.json @@ -30,8 +30,6 @@ "lodash-humps": "^3.1.5", "vue": "^2.6.10", "vue-cookies": "^1.5.13", - "vue-gtag": "^1.8.0", - "vue-gtm": "3.0.0-vue2", "vue-meta": "^2.4.0", "vue-router": "^3.2.0", "vue-tel-input": "^4.4.0", diff --git a/public/index.html b/public/index.html index 26a3d0e..1b68532 100644 --- a/public/index.html +++ b/public/index.html @@ -39,7 +39,7 @@ - --> - --> - + diff --git a/src/components/gate/GateLayout.vue b/src/components/gate/GateLayout.vue index 32a42f4..47e0a2b 100644 --- a/src/components/gate/GateLayout.vue +++ b/src/components/gate/GateLayout.vue @@ -99,7 +99,6 @@