fixes
This commit is contained in:
parent
72055c92e6
commit
56e9907bc5
|
@ -1,17 +1,17 @@
|
|||
|
||||
VUE_APP_BRAINTREE_AUTH_KEY=sandbox_bn48hmp6_cz6p85sw4dr5tp8h
|
||||
VUE_APP_MAGENTO_API_URL=https://retailer-stg.crane.com
|
||||
VUE_APP_MAGENTO_API_URL=https://retailer.crane.com
|
||||
VUE_APP_CRANE_URL=/shop
|
||||
VUE_APP_GATE_URL=/gate
|
||||
VUE_APP_ME_URL=/b2b
|
||||
VUE_APP_LOGIN_URL=/gate/sign-in
|
||||
VUE_APP_PERSONALIZE_URL=https://studio-stg.crane.com/personalize
|
||||
VUE_APP_IMAGE_PATH_URL=https://retailer-stg.crane.com/media/catalog/product
|
||||
VUE_APP_PERSONALIZE_URL=https://studio.crane.com/personalize
|
||||
VUE_APP_IMAGE_PATH_URL=https://retailer.crane.com/media/catalog/product
|
||||
VUE_APP_RETAILOR_ID=49057567-f789-420c-98b6-2e0443af73f5
|
||||
VUE_APP_IMAGE_CATEGORY_PATH_URL=https://retailer-stg.crane.com
|
||||
VUE_APP_NODESLS_API_URL=https://imagelib-sls-stg.crane.com
|
||||
VUE_APP_IMAGE_CATEGORY_PATH_URL=https://retailer.crane.com
|
||||
VUE_APP_NODESLS_API_URL=https://imagelib-sls.crane.com
|
||||
|
||||
VUE_APP_HOME_PAGE_URL=https://www-retailer-stg.crane.com
|
||||
VUE_APP_HOME_PAGE_URL=https://www-retailer.crane.com
|
||||
VUE_APP_CC_CONNECTION_URL=https://www.staging.personalized-stationery.com/CranesConnectionRedesign/Personalize.aspx?
|
||||
VUE_APP_MAINTENANCE_MODE=false
|
||||
VUE_APP_MAINTENANCE_PAGE_URL=/maintenance
|
||||
|
@ -23,6 +23,6 @@ VUE_APP_CRANE_ORDER_URL=https://ordertest.crane.com
|
|||
DEPLOY_S3_REGION=us-east-1
|
||||
DEPLOY_S3_BUCKET=
|
||||
DEPLOY_CLOUDFRONT_ID=
|
||||
VUE_APP_ASSETS_NODESLS_URL=https://assets-stg-sls.crane.com
|
||||
VUE_APP_IMAGE_LIB_URL=https://imagelib-stg-api.crane.com
|
||||
VUE_APP_BASE_URL=https://www-retailer-stg.crane.com
|
||||
VUE_APP_ASSETS_NODESLS_URL=https://assets-sls.crane.com
|
||||
VUE_APP_IMAGE_LIB_URL=https://imagelib-api.crane.com
|
||||
VUE_APP_BASE_URL=https://www-retailer.crane.com
|
|
@ -1 +1 @@
|
|||
{"branch_name":"beta","last_commit_date":"2022-01-10T16:11:16.000Z","last_commit_author":"sidharth","last_commit_hash":"25ae3331437809e4092c87f686e093b4f662b163"}
|
||||
{"branch_name":"beta","last_commit_date":"2022-01-11T14:18:17.000Z","last_commit_author":"sidharth","last_commit_hash":"72055c92e69a2f6c8d892620ef587454986cf0f3"}
|
|
@ -488,24 +488,7 @@
|
|||
<!------------------------------------------------------------------------------------->
|
||||
<v-row class="mr-1" v-show="checkOut">
|
||||
<v-col align="right">
|
||||
<a
|
||||
class="fontsize-14 black--text text-uppercase cartproductlist-action-link"
|
||||
@click.stop="
|
||||
editProduct(
|
||||
product.name,
|
||||
product.sku,
|
||||
product.itemId,
|
||||
index,
|
||||
product.customAttributes.isPersonalize,
|
||||
product.customAttributes.builderVersion,
|
||||
product.ccid,
|
||||
product.productType,
|
||||
product.parentSku
|
||||
)
|
||||
"
|
||||
>Edit</a
|
||||
>
|
||||
<span class="px-1">|</span>
|
||||
|
||||
<a
|
||||
class="fontsize-14 black--text text-uppercase cartproductlist-action-link"
|
||||
@click.stop="
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
.fontcolor-grey-shade8b {
|
||||
color: #8b8b8b;
|
||||
}
|
||||
|
||||
.categorybaseproducts-select-button {
|
||||
max-width: 300px !important;
|
||||
}
|
||||
|
||||
.categorybaseproduct-cancel-buttons.v-icon.v-icon::after {
|
||||
opacity: 0 !important;
|
||||
}
|
||||
@media screen and (max-width:320px) {
|
||||
.searchproducts-sortby{
|
||||
font-size:14px !important;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,378 @@
|
|||
<template>
|
||||
<v-row v-if="searchResults.page.length" class="mx-4">
|
||||
<v-col cols="12" lg="12" md="12" sm="12" >
|
||||
<v-row v-if="inProgress">
|
||||
<v-col
|
||||
v-for="(i, index) in 9"
|
||||
v-bind:key="index"
|
||||
lg="4"
|
||||
md="4"
|
||||
sm="4"
|
||||
cols="12"
|
||||
class=" cursor-pointer"
|
||||
>
|
||||
<v-skeleton-loader type="card"></v-skeleton-loader>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="searchResults.page.length > 0">
|
||||
<v-col
|
||||
v-for="(product, index) in searchResults.page"
|
||||
v-bind:key="index"
|
||||
lg="4"
|
||||
md="4"
|
||||
sm="4"
|
||||
cols="12"
|
||||
class=" cursor-pointer "
|
||||
|
||||
>
|
||||
{{product}}
|
||||
<v-img
|
||||
:src="imageBasePathUrl + product.i + imageBaseParams"
|
||||
width="100%"
|
||||
:alt="product.n"
|
||||
:title="product.n"
|
||||
></v-img>
|
||||
<v-row>
|
||||
<v-col cols="6" >
|
||||
<h1
|
||||
class="float-left fontsize-14 body ls-n009 fontcolor-black-darken font-weight-300 word-break"
|
||||
>{{ product.n }}</h1>
|
||||
</v-col>
|
||||
<v-col cols="5" >
|
||||
<p
|
||||
v-if="product.lp"
|
||||
class="float-right fontsize-14 body ls-n009 fontcolor-black-darken font-weight-300"
|
||||
>
|
||||
From ${{ product.lp }}
|
||||
{{ product.u }}
|
||||
</p>
|
||||
<div
|
||||
v-else
|
||||
class="float-right fontsize-14 body ls-n009 fontcolor-black-darken font-weight-300"
|
||||
>
|
||||
<div v-if="product.sp">
|
||||
<s>${{ product.p }}</s>
|
||||
<p class="red--text mb-0">${{ roundUp(product.sp) }}</p> / {{ product.u }}
|
||||
</div>
|
||||
<div v-else-if="product.p != 0">
|
||||
<p>
|
||||
${{ product.p }} / {{ product.u }}
|
||||
</p>
|
||||
</div>
|
||||
<div v-else>
|
||||
<p>TBD</p>
|
||||
</div>
|
||||
</div>
|
||||
</v-col>
|
||||
<v-col cols="12" class="float-right" >
|
||||
<v-hover v-slot:default="{ hover }">
|
||||
<v-btn
|
||||
:disabled="inProgress"
|
||||
block
|
||||
x-large
|
||||
:outlined="!inProgress ? hover:false"
|
||||
:color="hover?'white':'primary'"
|
||||
:class="hover?'primary--text':'white--text'"
|
||||
class="text-uppercase ls-0 body productpage-button"
|
||||
tile
|
||||
depressed
|
||||
@click="addToCart(product.sku)"
|
||||
>
|
||||
<v-progress-circular
|
||||
align="center"
|
||||
:size="40"
|
||||
block
|
||||
color="primary"
|
||||
indeterminate
|
||||
v-if="inProgress"
|
||||
></v-progress-circular>
|
||||
<span v-if="!inProgress">ADD TO CART</span>
|
||||
</v-btn>
|
||||
</v-hover>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-else class="text-center">
|
||||
<v-col
|
||||
lg="12"
|
||||
md="12"
|
||||
sm="12"
|
||||
cols="12">
|
||||
<v-alert type="error" text class="font-weight-300 body-font h3">{{
|
||||
noProducts
|
||||
}}</v-alert>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
<script>
|
||||
/* eslint-disable no-alert, no-console , no-debugger */
|
||||
//import * as easings from "vuetify/es5/services/goto/easing-patterns";
|
||||
import { mapState } from "vuex";
|
||||
|
||||
export default {
|
||||
name: "RetailerSearchProducts",
|
||||
components: {
|
||||
},
|
||||
props: [
|
||||
"criteria",
|
||||
"searchPageContent",
|
||||
"breadcrumbData",
|
||||
"categoryPageContent"
|
||||
],
|
||||
computed: {
|
||||
...mapState({
|
||||
searchResults: state => state.catalogBrowser.searchResults,
|
||||
inProgress: state => state.catalogBrowser.inProgress,
|
||||
}),
|
||||
|
||||
imageBasePathUrl() {
|
||||
return process.env.VUE_APP_IMAGE_PATH_URL;
|
||||
},
|
||||
imageBaseParams() {
|
||||
return process.env.VUE_APP_IMAGE_CATEGORY_PARAMS;
|
||||
},
|
||||
isIpadOrMobile: function() {
|
||||
return this.$vuetify.breakpoint.mdAndDown ? true : false;
|
||||
},
|
||||
isIpad: function() {
|
||||
return this.$vuetify.breakpoint.smOnly || this.$vuetify.breakpoint.mdOnly
|
||||
? true
|
||||
: false;
|
||||
},
|
||||
isMobile: function() {
|
||||
return this.$vuetify.breakpoint.xs ? true : false;
|
||||
},
|
||||
userAuth: function() {
|
||||
return this.$store.state.auth.userAuth;
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
},
|
||||
data: () => ({
|
||||
menu: false,
|
||||
showDrawarFilter: false,
|
||||
noProducts: "No products found.",
|
||||
}),
|
||||
methods: {
|
||||
roundUp(num) {
|
||||
var with2Decimals = num.toString().match(/^-?\d+(?:\.\d{0,2})?/)[0];
|
||||
return with2Decimals;
|
||||
},
|
||||
addToCart(sku) {
|
||||
if (sku) {
|
||||
this.errorMessage = "";
|
||||
if (this.userAuth) {
|
||||
this.$store
|
||||
.dispatch("userCartProduct/addToCart", {
|
||||
sku: sku,
|
||||
qty: 1,
|
||||
ccid: null,
|
||||
price: null,
|
||||
personalizeDetails: null
|
||||
})
|
||||
.then(() => {
|
||||
this.$store.dispatch("userCartProduct/cartProductList");
|
||||
|
||||
this.$store.dispatch("userCartProduct/cartDrawer", true);
|
||||
this.snackbar = {
|
||||
message: "Product Added Successfully",
|
||||
color: "success",
|
||||
show: true,
|
||||
timeout: 2000
|
||||
};
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
this.snackbar = {
|
||||
message: 'Unexpected error while communicating with the cloud',
|
||||
color: "error",
|
||||
show: true,
|
||||
timeout: 2000
|
||||
};
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
this.errorMessage = "Please Select Quantity";
|
||||
}
|
||||
},
|
||||
OnResize() {
|
||||
setTimeout(() => {
|
||||
if (this.$vuetify.breakpoint.lgAndUp) {
|
||||
this.showDrawarFilter = false;
|
||||
}
|
||||
}, 200);
|
||||
},
|
||||
},
|
||||
|
||||
created() {
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" >
|
||||
.sort-button.theme--light.v-text-field--solo
|
||||
> .v-input__control
|
||||
> .v-input__slot {
|
||||
background: transparent !important;
|
||||
}
|
||||
.categorybaseproducts-pagination-button .v-pagination__item--active {
|
||||
outline: #ffffff !important;
|
||||
}
|
||||
.categorybaseproducts-pagination-button .v-pagination__item {
|
||||
outline: #ffffff !important;
|
||||
box-shadow: none !important;
|
||||
padding: 0px !important;
|
||||
margin: 0px !important;
|
||||
}
|
||||
.categorybaseproducts-pagination-button {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.categorybaseproducts-overflow-button .v-select__slot {
|
||||
border-left: 1px solid #dcdddd !important;
|
||||
border-right: 1px solid #dcdddd !important;
|
||||
max-width: 85px !important;
|
||||
max-height: 36px !important;
|
||||
}
|
||||
.categorybaseproducts-overflow-button {
|
||||
max-width: 85px !important;
|
||||
}
|
||||
.categorybaseproducts-overflow-button .v-select__slot .v-input__append-inner {
|
||||
max-height: 36px !important;
|
||||
}
|
||||
.categorybaseproducts-overflow-button .v-overflow-btn .v-select__slot {
|
||||
max-height: 36px !important;
|
||||
}
|
||||
.categorybaseproducts-overflow-button .v-text-field__details {
|
||||
display: none;
|
||||
}
|
||||
.categorybaseproducts-pagination-button
|
||||
.v-pagination__navigation.v-pagination__navigation--disabled {
|
||||
display: none;
|
||||
}
|
||||
.categorybaseproducts-pagination-button
|
||||
.v-pagination__navigation
|
||||
.v-icon.v-icon {
|
||||
font-style: normal !important;
|
||||
color: #1d1d1d !important;
|
||||
text-transform: uppercase !important;
|
||||
font-size: 14px;
|
||||
font-family: "Whyte-Regular", sans-serif;
|
||||
letter-spacing: -0.1px;
|
||||
}
|
||||
.categorybaseproducts-select-button .v-input__control .v-input__slot {
|
||||
border: thin solid #8b8b8b !important;
|
||||
}
|
||||
.categorybaseproducts-select-button:hover .v-input__control .v-input__slot {
|
||||
border: thin solid #2850da !important;
|
||||
}
|
||||
.categorybaseproducts-select-button.v-input--is-label-active.v-input--is-focused
|
||||
.v-input__control
|
||||
.v-input__slot {
|
||||
border: thin solid #2850da !important;
|
||||
}
|
||||
.categorybaseproducts-select-button:hover
|
||||
.v-select__selection.v-select__selection--comma {
|
||||
color: #2850da !important;
|
||||
}
|
||||
.categorybaseproducts-select-button:hover
|
||||
.v-input__append-inner
|
||||
.v-input__icon
|
||||
.v-icon {
|
||||
color: #2850da !important;
|
||||
}
|
||||
.categorybaseproducts-pagination-button .v-pagination__navigation {
|
||||
outline: #ffffff !important;
|
||||
box-shadow: none !important;
|
||||
padding: 0px !important;
|
||||
//margin: 0px 10px !important;
|
||||
}
|
||||
.custom-pagination li:nth-child(1) {
|
||||
margin-right: 15px !important;
|
||||
margin-left: 15px;
|
||||
}
|
||||
.categorybaseproducts-select-button.v-input--is-label-active.v-input--is-focused
|
||||
.v-select__selection.v-select__selection--comma {
|
||||
color: #2850da !important;
|
||||
}
|
||||
.categorybaseproducts-sortby-button.theme--light.v-select
|
||||
.v-select__selection--comma {
|
||||
color: #2850da !important;
|
||||
}
|
||||
.categorybaseproducts-sortby-button .v-text-field__details {
|
||||
display: none;
|
||||
}
|
||||
.categorybaseproducts-sortby-button .v-input__control .v-input__slot {
|
||||
border: thin solid #2850da !important;
|
||||
}
|
||||
.categorybaseproducts-sortby-button:hover .v-input__control .v-input__slot {
|
||||
border: thin solid #2850da !important;
|
||||
}
|
||||
.categorybaseproducts-sortby-button.v-input--is-label-active.v-input--is-focused
|
||||
.v-input__control
|
||||
.v-input__slot {
|
||||
border: thin solid #2850da !important;
|
||||
}
|
||||
.categorybaseproducts-sortby-button:hover
|
||||
.v-select__selection.v-select__selection--comma {
|
||||
color: #2850da !important;
|
||||
}
|
||||
.categorybaseproducts-sortby-button:hover
|
||||
.v-input__append-inner
|
||||
.v-input__icon
|
||||
.v-icon {
|
||||
color: #2850da !important;
|
||||
}
|
||||
.categorybaseproducts-sortby-button
|
||||
.v-input__append-inner
|
||||
.v-input__icon
|
||||
.v-icon {
|
||||
color: #2850da !important;
|
||||
}
|
||||
.categorybaseproducts-sortby-button.v-input--is-label-active.v-input--is-focused
|
||||
.v-select__selection.v-select__selection--comma {
|
||||
color: #2850da !important;
|
||||
}
|
||||
.categorybaseproducts-sortby-button.v-input--is-label-active.v-input--is-focused.v-text-field.v-text-field--solo
|
||||
.v-input__append-inner,
|
||||
.v-text-field.v-text-field--solo .v-input__prepend-inner {
|
||||
-ms-flex-item-align: center;
|
||||
align-self: center;
|
||||
padding-top: 5px;
|
||||
border-left: 1px solid #2850da;
|
||||
padding-left: 10px;
|
||||
height: 34px;
|
||||
}
|
||||
.categorybaseproducts-select-button.v-input--is-label-active.v-input--is-focused.v-text-field.v-text-field--solo
|
||||
.v-input__append-inner,
|
||||
.v-text-field.v-text-field--solo .v-input__prepend-inner {
|
||||
-ms-flex-item-align: center;
|
||||
align-self: center;
|
||||
padding-top: 5px;
|
||||
border-left: 1px solid #2850da;
|
||||
padding-left: 10px;
|
||||
height: 34px;
|
||||
}
|
||||
.searchproducts-cancel-buttons.v-icon.v-icon::after {
|
||||
opacity: 0 !important;
|
||||
}
|
||||
.categorybaseproducts-sortby-button .v-text-field__details {
|
||||
display: none;
|
||||
}
|
||||
.categorybaseproducts-overflow-button .v-text-field__details {
|
||||
display: none;
|
||||
}
|
||||
.categorybaseproducts-filter-button .v-text-field__details {
|
||||
display: none;
|
||||
}
|
||||
.filter-component-width .v-expansion-panels {
|
||||
display: inline-block;
|
||||
}
|
||||
// .v-text-field__details {
|
||||
// display: none;
|
||||
// }
|
||||
</style>
|
||||
<style src="./RetailerSearchProducts.scss" lang="scss" scoped />
|
|
@ -16,6 +16,28 @@
|
|||
</v-container>
|
||||
</v-overlay>
|
||||
<div v-show="!cartProductsProgress">
|
||||
<v-row><v-col cols="12" sm="12" md="12">
|
||||
<v-col cols="12" sm="12" md="8">
|
||||
<v-menu offset-y down allow-overflow >
|
||||
<template v-slot:activator="{ on }">
|
||||
<v-text-field
|
||||
prepend-inner-icon="mdi-magnify"
|
||||
placeholder="Enter Item, Name, Keyword"
|
||||
v-model="searchData"
|
||||
v-on="on"
|
||||
@input="searchProducts"
|
||||
>
|
||||
</v-text-field>
|
||||
</template>
|
||||
<div>
|
||||
<v-card tile flat v-if="searchData">
|
||||
<RetailerSearchProducts />
|
||||
</v-card>
|
||||
</div>
|
||||
</v-menu>
|
||||
</v-col>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-show="cartProductsItem.length == 0">
|
||||
<v-col>
|
||||
<v-alert class="alert-box-outline" type="error" text dense
|
||||
|
@ -24,7 +46,13 @@
|
|||
<p>
|
||||
Click
|
||||
<span
|
||||
class="mr-1 text-decoration-none fontcolor-black-light fontsize-16 guest-shipping-address-login"
|
||||
class="
|
||||
mr-1
|
||||
text-decoration-none
|
||||
fontcolor-black-light
|
||||
fontsize-16
|
||||
guest-shipping-address-login
|
||||
"
|
||||
>
|
||||
<span @click="goToShopping()" class="cursor-pointer"
|
||||
>here</span
|
||||
|
@ -33,16 +61,14 @@
|
|||
</p>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<div v-show="cartProductsItem.length != 0">
|
||||
<v-row
|
||||
class="mt-12"
|
||||
:class="!isDesktop ? 'd-flex flex-row' : 'd-flex flex-column-reverse'"
|
||||
>
|
||||
<v-col cols="12" sm="12" md="8" class="pt-0 mt-0">
|
||||
<v-divider class="hidden-md-and-up"></v-divider>
|
||||
<v-col cols="12" class="mt-3">
|
||||
<v-row >
|
||||
<v-col cols="12" sm="12" md="8">
|
||||
|
||||
<v-col cols="12">
|
||||
<p
|
||||
class="h3 pl-4 body-font text-uppercase primary--text"
|
||||
class="h3 body-font text-uppercase primary--text"
|
||||
v-if="!cartProductsProgress"
|
||||
>
|
||||
Your Cart ( {{ cartProductsItem.length }} )
|
||||
|
@ -50,7 +76,7 @@
|
|||
</v-col>
|
||||
<v-divider class="hidden-md-and-up"></v-divider>
|
||||
<v-row>
|
||||
<v-col cols="12" sm="11" md="11" class="mt-5">
|
||||
<v-col cols="12" sm="12" md="12" class="mt-5">
|
||||
<CartProductList
|
||||
:checkOut="chekoutFlag"
|
||||
:cartItems="cartProductsItem"
|
||||
|
@ -77,44 +103,13 @@
|
|||
${{ priceFormatter(cartProductTotalAmt.baseSubtotal) }}
|
||||
</p>
|
||||
</v-col>
|
||||
<v-col cols="12" v-show="cartProductTotalAmt.couponCode">
|
||||
<p class="float-left pb-0 mb-0">
|
||||
Discount ({{ cartProductTotalAmt.couponCode }})
|
||||
</p>
|
||||
<p
|
||||
class="float-right pb-0 mb-0"
|
||||
v-if="cartProductTotalAmt.baseDiscountAmount"
|
||||
>
|
||||
-${{
|
||||
priceFormatter(
|
||||
cartProductTotalAmt.baseDiscountAmount
|
||||
.toString()
|
||||
.substring(1)
|
||||
)
|
||||
}}
|
||||
</p>
|
||||
<p class="float-right pb-0 mb-0" v-else>-$0</p>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12">
|
||||
<p class="float-left pb-0 mb-0">Shipping</p>
|
||||
<p class="float-right pb-0 mb-0">
|
||||
${{ priceFormatter(cartProductTotalAmt.baseShippingAmount) }}
|
||||
</p>
|
||||
</v-col>
|
||||
<v-col cols="12">
|
||||
<p class="float-left pb-0 mb-0">Estimated Tax</p>
|
||||
<p class="float-right pb-0 mb-0">
|
||||
${{ priceFormatter(cartProductTotalAmt.taxAmount) }}
|
||||
</p>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12">
|
||||
<p class="float-left pb-0 mb-0">Estimated Total</p>
|
||||
<p class="float-right pb-0 mb-0">
|
||||
${{ priceFormatter(cartProductTotalAmt.baseGrandTotal) }}
|
||||
</p>
|
||||
</v-col>
|
||||
|
||||
<v-col
|
||||
v-if="stockFlag"
|
||||
cols="12"
|
||||
|
@ -140,7 +135,11 @@
|
|||
<v-btn
|
||||
tile
|
||||
large
|
||||
class="d-none d-sm-flex d-md-none px-12 cart-products-button"
|
||||
class="
|
||||
d-none d-sm-flex d-md-none
|
||||
px-12
|
||||
cart-products-button
|
||||
"
|
||||
:outlined="hover"
|
||||
:color="hover ? 'white' : 'primary'"
|
||||
:class="hover ? 'primary--text' : 'white--text'"
|
||||
|
@ -172,72 +171,6 @@
|
|||
></v-progress-circular>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<!-- <v-divider class="hidden-md-and-up"></v-divider>-->
|
||||
<v-divider class="primary"></v-divider>
|
||||
|
||||
<v-row>
|
||||
<v-col cols="12" align="center" v-if="inProgressDiscountCode">
|
||||
<v-progress-circular
|
||||
:size="60"
|
||||
color="primary"
|
||||
indeterminate
|
||||
></v-progress-circular>
|
||||
</v-col>
|
||||
<v-col cols="12" class="pb-0 mb-0" v-else>
|
||||
<p class="primary--text">Apply Discount Code</p>
|
||||
<v-form
|
||||
ref="discountCodeForm"
|
||||
v-model="validDiscountCode"
|
||||
:lazy-validation="lazy"
|
||||
>
|
||||
<v-row>
|
||||
<v-col cols="8" class="pb-0 mb-0">
|
||||
<v-text-field
|
||||
type="text"
|
||||
dense
|
||||
placeholder="Enter Discount Code"
|
||||
v-model="discountTextCode"
|
||||
outlined
|
||||
@blur="resetValidation"
|
||||
:rules="textRules"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="4" class="pb-0 mb-0">
|
||||
<v-hover v-slot:default="{ hover }">
|
||||
<v-btn
|
||||
v-if="!discountCode"
|
||||
class="text-uppercase checkoutpage-button-height cart-products-button"
|
||||
@click="applyDiscountCode"
|
||||
large
|
||||
dense
|
||||
depressed
|
||||
tile
|
||||
:outlined="hover"
|
||||
:color="hover ? 'white' : 'primary'"
|
||||
:class="hover ? 'primary--text' : 'white--text'"
|
||||
>APPLY</v-btn
|
||||
>
|
||||
</v-hover>
|
||||
<v-hover v-slot:default="{ hover }">
|
||||
<v-btn
|
||||
v-if="discountCode"
|
||||
class="text-uppercase checkoutpage-button-height cart-products-button"
|
||||
@click="removeDiscountCode"
|
||||
large
|
||||
dense
|
||||
:outlined="hover"
|
||||
:color="hover ? 'white' : 'error'"
|
||||
:class="hover ? 'error--text' : 'white--text'"
|
||||
depressed
|
||||
tile
|
||||
>CANCEL</v-btn
|
||||
>
|
||||
</v-hover>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-form>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</div>
|
||||
|
@ -249,12 +182,15 @@
|
|||
/* eslint-disable no-alert, no-console , no-debugger */
|
||||
const baseUrl = process.env.VUE_APP_BASE_URL;
|
||||
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",
|
||||
data: () => ({
|
||||
searchData: null,
|
||||
priceFormatter: priceFormatter,
|
||||
stockFlag: true,
|
||||
cartProductPage: true,
|
||||
|
@ -265,7 +201,6 @@ export default {
|
|||
dialog: false,
|
||||
chekoutFlag: true,
|
||||
discountTextCode: "",
|
||||
validDiscountCode: true,
|
||||
lazy: false,
|
||||
textRules: [(v) => !!v || "This field is required"],
|
||||
snackbar: {
|
||||
|
@ -278,6 +213,7 @@ export default {
|
|||
components: {
|
||||
CartProductList,
|
||||
SnackbarComponent,
|
||||
RetailerSearchProducts,
|
||||
},
|
||||
computed: {
|
||||
canonical: function () {
|
||||
|
@ -313,13 +249,7 @@ export default {
|
|||
return this.$store.state.cartProduct.cartTotalAmtProgress;
|
||||
}
|
||||
},
|
||||
inProgressDiscountCode() {
|
||||
if (this.userAuth) {
|
||||
return this.$store.state.userCartProduct.fetchInProgress;
|
||||
} else {
|
||||
return this.$store.state.cartProduct.fetchInProgress;
|
||||
}
|
||||
},
|
||||
|
||||
cartProductsProgress: function () {
|
||||
if (this.userAuth) {
|
||||
return this.$store.state.userCartProduct.cartProductsProgress;
|
||||
|
@ -327,13 +257,7 @@ export default {
|
|||
return this.$store.state.cartProduct.cartProductsProgress;
|
||||
}
|
||||
},
|
||||
discountCode() {
|
||||
if (this.userAuth) {
|
||||
return this.$store.state.userCartProduct.discountCode;
|
||||
} else {
|
||||
return this.$store.state.cartProduct.discountCode;
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
metaInfo() {
|
||||
return {
|
||||
|
@ -356,14 +280,7 @@ export default {
|
|||
};
|
||||
},
|
||||
watch: {
|
||||
validDiscountCode() {
|
||||
if (!this.validDiscountCode) {
|
||||
this.$refs.discountCodeForm.reset();
|
||||
}
|
||||
},
|
||||
discountCode() {
|
||||
this.discountTextCode = this.discountCode;
|
||||
},
|
||||
|
||||
cartProductsItem() {
|
||||
this.stockFlagHideShow();
|
||||
this.calledCriteoViewBasket();
|
||||
|
@ -380,7 +297,6 @@ export default {
|
|||
}
|
||||
},
|
||||
removeMinus(val) {
|
||||
debugger;
|
||||
if (val) return val.toString().substring(1);
|
||||
},
|
||||
showSnackBarMessage(obj) {
|
||||
|
@ -413,11 +329,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
resetValidation() {
|
||||
if (!this.validDiscountCode) {
|
||||
this.$refs.discountCodeForm.reset();
|
||||
}
|
||||
},
|
||||
resetValidation() {},
|
||||
goToShopping() {
|
||||
this.$router.push({
|
||||
name: "HomePage",
|
||||
|
@ -430,134 +342,28 @@ export default {
|
|||
params: {},
|
||||
});
|
||||
},
|
||||
setDiscountTextCode() {
|
||||
if (this.userAuth) {
|
||||
this.discountTextCode = this.$store.state.userCartProduct.discountCode;
|
||||
} else {
|
||||
this.discountTextCode = this.$store.state.cartProduct.discountCode;
|
||||
}
|
||||
},
|
||||
applyDiscountCode() {
|
||||
if (this.$refs.discountCodeForm.validate()) {
|
||||
if (this.userAuth) {
|
||||
this.$store
|
||||
.dispatch(
|
||||
"userCartProduct/applyDiscountCode",
|
||||
this.discountTextCode
|
||||
)
|
||||
.then(() => {
|
||||
this.snackbar = {
|
||||
message: "Your coupon was successfully applied",
|
||||
color: "success",
|
||||
show: true,
|
||||
timeout: 2000,
|
||||
};
|
||||
this.$store.dispatch("userCartProduct/productTotalAmt");
|
||||
})
|
||||
.catch((error) => {
|
||||
this.snackbar = {
|
||||
message: error.message,
|
||||
color: "error",
|
||||
show: true,
|
||||
timeout: 2000,
|
||||
};
|
||||
searchProducts() {
|
||||
if (this.searchData) {
|
||||
this.$store.dispatch("catalogBrowser/search", {
|
||||
fullCatalog: window.craneCatalog,
|
||||
keywords: this.searchData,
|
||||
filters: [],
|
||||
pageNumber: 1,
|
||||
pageSize: "ALL",
|
||||
sortBy: "relevance",
|
||||
});
|
||||
} 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(
|
||||
"cartProduct/productTotalAmt",
|
||||
this.guestQuoteId
|
||||
);
|
||||
})
|
||||
.catch((error) => {
|
||||
this.snackbar = {
|
||||
message: error.message,
|
||||
color: "error",
|
||||
show: true,
|
||||
timeout: 2000,
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
removeDiscountCode() {
|
||||
if (this.$refs.discountCodeForm.validate()) {
|
||||
if (this.userAuth) {
|
||||
this.$store
|
||||
.dispatch(
|
||||
"userCartProduct/removeDiscountCode",
|
||||
this.discountTextCode
|
||||
)
|
||||
.then(() => {
|
||||
this.snackbar = {
|
||||
message: "Your coupon was successfully removed",
|
||||
color: "success",
|
||||
show: true,
|
||||
timeout: 2000,
|
||||
};
|
||||
this.$store.dispatch("userCartProduct/productTotalAmt");
|
||||
})
|
||||
.catch((error) => {
|
||||
this.snackbar = {
|
||||
message: error,
|
||||
color: "error",
|
||||
show: true,
|
||||
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(
|
||||
"cartProduct/productTotalAmt",
|
||||
this.guestQuoteId
|
||||
);
|
||||
})
|
||||
.catch((error) => {
|
||||
this.snackbar = {
|
||||
message: error,
|
||||
color: "error",
|
||||
show: true,
|
||||
timeout: 2000,
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
created() {
|
||||
this.$store.dispatch("catalogBrowser/index", {
|
||||
productsCatalog: window.craneCatalog.products,
|
||||
});
|
||||
if (this.userAuth) {
|
||||
this.$store.dispatch("userCartProduct/fetchCartCoupon");
|
||||
this.setDiscountTextCode();
|
||||
|
||||
this.calledCriteoViewBasket();
|
||||
} else {
|
||||
if (this.guestQuoteId) {
|
||||
this.$store.dispatch("cartProduct/fetchCartCoupon", this.guestQuoteId);
|
||||
this.setDiscountTextCode();
|
||||
this.calledCriteoViewBasket();
|
||||
}
|
||||
}
|
||||
this.stockFlagHideShow();
|
||||
},
|
||||
|
|
|
@ -67,8 +67,9 @@ export const doFilterItems = ({ items, enabledFilters, availableFilters, attribu
|
|||
for (var i = 0; i < items.length; i++) {
|
||||
var product = items[i]
|
||||
const isValid = doCheckProductForEnabledFilters({ product, enabledFilters })
|
||||
if (isValid) {
|
||||
if (isValid && product.per =='No') {
|
||||
doCountProductAttributes({ product, availableFilters, attributesMap })
|
||||
|
||||
matchingItems.push(product)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { getField, updateField } from 'vuex-map-fields'
|
||||
import { doFilterItems } from '@/services/search.service'
|
||||
import { criteoForProductList } from "@/services/util.service";
|
||||
import { doFilterItems } from '@/services/search.service'
|
||||
//import { criteoForProductList } from "@/services/util.service";
|
||||
import Fuse from 'fuse.js'
|
||||
export const catalogBrowser = {
|
||||
namespaced: true,
|
||||
|
@ -63,7 +63,7 @@ export const catalogBrowser = {
|
|||
setSearchResults(state, results) {
|
||||
state.searchResults.page = [];
|
||||
state.searchResults.page = results;
|
||||
criteoForProductList(results);
|
||||
// criteoForProductList(results);
|
||||
},
|
||||
setFuseWithIndex(state, index) {
|
||||
state.fuseWithIndex = index
|
||||
|
@ -129,14 +129,16 @@ export const catalogBrowser = {
|
|||
const fuse = new Fuse(productsArray, options)
|
||||
commit('setFuseWithIndex', fuse)
|
||||
},
|
||||
/* eslint-disable no-alert, no-console , no-debugger */
|
||||
|
||||
search: ({ commit, state }, { fullCatalog, keywords, filters, pageNumber, pageSize, sortBy }) => {
|
||||
|
||||
//debugger
|
||||
|
||||
commit('inProgress', true)
|
||||
console.log('searching:', pageNumber)
|
||||
console.log('pageSize:', pageSize)
|
||||
commit('setEnabledFilters', filters)
|
||||
//debugger
|
||||
// commit('setEnabledFilters', filters)
|
||||
// debugger
|
||||
const products = []
|
||||
if (filters !== undefined && filters.length) {
|
||||
const categoryFilter = filters.find((f => f.prop == 'ci'))
|
||||
|
@ -154,6 +156,7 @@ export const catalogBrowser = {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (keywords !== null && keywords != '') {
|
||||
products.length = 0
|
||||
const relevantResults = state.fuseWithIndex.search(keywords)
|
||||
|
@ -164,17 +167,12 @@ export const catalogBrowser = {
|
|||
}
|
||||
}
|
||||
}
|
||||
/* else {
|
||||
if (products.length < 1) {
|
||||
for (const [, product] of Object.entries(fullCatalog.products)) {
|
||||
products.push(product)
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
const availableFilters = [];
|
||||
let filteredItems = [];
|
||||
let pageData = [];
|
||||
if (products.length > 0) {
|
||||
|
||||
filteredItems = doFilterItems({
|
||||
items: products, enabledFilters: state.enabledFilters,
|
||||
availableFilters, attributesMap: window.attributesMap
|
||||
|
@ -212,6 +210,7 @@ export const catalogBrowser = {
|
|||
}
|
||||
}
|
||||
commit('setSearchResults', pageData);
|
||||
|
||||
commit('setAvailableFilters', availableFilters);
|
||||
commit('setSearchTerms', { keywords: keywords, pageNumber: pageNumber, pageSize: pageSize, sortBy: sortBy, filters: filters }
|
||||
);
|
||||
|
|
|
@ -2213,9 +2213,9 @@ caniuse-api@^3.0.0:
|
|||
lodash.uniq "^4.5.0"
|
||||
|
||||
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001038, caniuse-lite@^1.0.30001039:
|
||||
version "1.0.30001137"
|
||||
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001137.tgz"
|
||||
integrity sha512-54xKQZTqZrKVHmVz0+UvdZR6kQc7pJDgfhsMYDG19ID1BWoNnDMFm5Q3uSBSU401pBvKYMsHAt9qhEDcxmk8aw==
|
||||
version "1.0.30001299"
|
||||
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001299.tgz"
|
||||
integrity sha512-iujN4+x7QzqA2NCSrS5VUy+4gLmRd4xv6vbBBsmfVqTx8bLAD8097euLqQgKxSVLvxjSDcvF1T/i9ocgnUFexw==
|
||||
|
||||
card-validator@8.1.1:
|
||||
version "8.1.1"
|
||||
|
|
Loading…
Reference in New Issue