Merge branch 'beta' of git.treelet.net:crane/retailer-vue into dev
This commit is contained in:
commit
ec3b6b80d1
|
@ -1,13 +1,13 @@
|
|||
VUE_APP_BRAINTREE_AUTH_KEY=sandbox_bn48hmp6_cz6p85sw4dr5tp8h
|
||||
VUE_APP_MAGENTO_API_URL=https://retailer-stg.crane.com
|
||||
VUE_APP_MAGENTO_API_URL=https://m2-stg.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_IMAGE_PATH_URL=https://m2-stg.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_IMAGE_CATEGORY_PATH_URL=https://m2-stg.crane.com
|
||||
VUE_APP_NODESLS_API_URL=https://imagelib-sls-stg.crane.com
|
||||
|
||||
VUE_APP_HOME_PAGE_URL=https://www-stg.crane.com
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
NODE_ENV=production
|
||||
VUE_APP_BRAINTREE_AUTH_KEY=sandbox_bn48hmp6_cz6p85sw4dr5tp8h
|
||||
VUE_APP_MAGENTO_API_URL=https://retailer-stg.crane.com
|
||||
VUE_APP_MAGENTO_API_URL=https://m2-stg.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_IMAGE_PATH_URL=https://m2-stg.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_IMAGE_CATEGORY_PATH_URL=https://m2-stg.crane.com
|
||||
VUE_APP_NODESLS_API_URL=https://imagelib-sls-stg.crane.com
|
||||
|
||||
VUE_APP_HOME_PAGE_URL=https://www-stg.crane.com
|
||||
|
|
|
@ -1 +1 @@
|
|||
{"branch_name":"dev","last_commit_date":"2022-01-19T13:25:20.000Z","last_commit_author":"rakesh","last_commit_hash":"aba7cd3dad225652a48ca6e2d596456c455c5db5"}
|
||||
{"branch_name":"dev","last_commit_date":"2022-01-21T06:09:37.000Z","last_commit_author":"anju j","last_commit_hash":"934b913728e33b2c9f6fdfff0b610198132bfe8a"}
|
|
@ -104,7 +104,7 @@ margin-bottom: 0px !important;
|
|||
.me-header-search-field .theme--dark.v-label {
|
||||
color:#1d1d1d;
|
||||
}
|
||||
.v-menu__content,.v-list{
|
||||
/*.v-menu__content,.v-list{
|
||||
border-radius: 0px !important;
|
||||
top: 64px !important;
|
||||
}
|
||||
}*/
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
class="text-uppercase ls-0 body productpage-button"
|
||||
tile
|
||||
depressed
|
||||
@click="addToCart(product.sku)"
|
||||
@click="addToCart(product.sku,product.mq)"
|
||||
>
|
||||
<v-progress-circular
|
||||
align="center"
|
||||
|
@ -107,19 +107,16 @@
|
|||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<SnackbarComponent :snackbar="snackbar"></SnackbarComponent>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
/* eslint-disable no-alert, no-console , no-debugger */
|
||||
//import * as easings from "vuetify/es5/services/goto/easing-patterns";
|
||||
import { mapState } from "vuex";
|
||||
import SnackbarComponent from "@/components/common/SnackbarComponent";
|
||||
|
||||
export default {
|
||||
name: "RetailerSearchProducts",
|
||||
components: {
|
||||
SnackbarComponent
|
||||
},
|
||||
props: [
|
||||
"criteria",
|
||||
|
@ -172,28 +169,28 @@ export default {
|
|||
var with2Decimals = num.toString().match(/^-?\d+(?:\.\d{0,2})?/)[0];
|
||||
return with2Decimals;
|
||||
},
|
||||
addToCart(sku) {
|
||||
async addToCart(sku,qty) {
|
||||
if (sku) {
|
||||
this.errorMessage = "";
|
||||
debugger
|
||||
if (this.userAuth) {
|
||||
this.$store
|
||||
await this.$store
|
||||
.dispatch("userCartProduct/addToCart", {
|
||||
sku: sku,
|
||||
qty: 1,
|
||||
qty:qty,
|
||||
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
|
||||
};
|
||||
debugger
|
||||
this.$store.dispatch("userCartProduct/cartProductList");
|
||||
this.$emit("actionClose", this.snackbar);
|
||||
|
||||
})
|
||||
.catch(() => {
|
||||
|
@ -203,7 +200,7 @@ export default {
|
|||
show: true,
|
||||
timeout: 2000
|
||||
};
|
||||
|
||||
this.$emit("actionClose", this.snackbar);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -242,6 +242,7 @@ export default [
|
|||
{
|
||||
path: '*',
|
||||
name: 'RouteNotFound',
|
||||
redirect: '/b2b',
|
||||
component: () => import( /* webpackChunkName: "craneMain" */'@/routes/retailer/route_not_found.vue'),
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,9 @@
|
|||
</template>
|
||||
<div>
|
||||
<v-card tile flat v-if="searchData">
|
||||
<RetailerSearchProducts />
|
||||
<RetailerSearchProducts
|
||||
@actionClose="showSnackBarMessage"
|
||||
/>
|
||||
</v-card>
|
||||
</div>
|
||||
</v-menu>
|
||||
|
@ -360,12 +362,12 @@ export default {
|
|||
this.$store.dispatch("catalogBrowser/index", {
|
||||
productsCatalog: window.craneCatalog.products,
|
||||
});
|
||||
if (this.userAuth) {
|
||||
/* if (this.userAuth) {
|
||||
this.$store.dispatch("userCartProduct/fetchCartCoupon");
|
||||
|
||||
this.calledCriteoViewBasket();
|
||||
}
|
||||
this.stockFlagHideShow();
|
||||
this.stockFlagHideShow();*/
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -464,8 +464,8 @@
|
|||
v-if="shippingInformations.totals.grandTotal !== 0"
|
||||
>
|
||||
<v-radio
|
||||
:label="shippingInformations.paymentMethods[0].title"
|
||||
:value="shippingInformations.paymentMethods[0].code"
|
||||
:label="shippingInformations.paymentMethods[1].title"
|
||||
:value="shippingInformations.paymentMethods[1].code"
|
||||
class="black--text"
|
||||
></v-radio>
|
||||
<div v-if="paymentMethod === 'purchaseorder'">
|
||||
|
@ -491,34 +491,32 @@
|
|||
>Edit</v-btn
|
||||
>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="pl-3">
|
||||
</v-row> <v-form ref="poNumberForm" v-model="valid" :lazy-validation="lazy">
|
||||
<v-row >
|
||||
<v-col cols="12" align="right">
|
||||
<v-text-field
|
||||
v-model="poNumber"
|
||||
type="text"
|
||||
dense
|
||||
placeholder="Purchase Order Number"
|
||||
outlined
|
||||
:rules="textRules"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
|
||||
<v-col cols="12" align="right">
|
||||
<v-btn
|
||||
class="primary mx-3 text-uppercase"
|
||||
@click="placeOrderFree()"
|
||||
@click="placeOrderFree($event)"
|
||||
tile
|
||||
depressed
|
||||
>Place Order</v-btn
|
||||
>
|
||||
</v-col>
|
||||
|
||||
<!-- <v-col cols="12" sm="6">
|
||||
<v-braintree
|
||||
:authorization="braintreeAuthKey"
|
||||
:vaultManager="true"
|
||||
@success="onPaymentSuccess"
|
||||
@error="onPaymentError"
|
||||
@load="onGatewayLoad"
|
||||
@loadFail="onGatewayLoadFail"
|
||||
>
|
||||
<template v-slot:button="slotProps">
|
||||
<v-btn @click="slotProps.submit" color="success">Place Order</v-btn>
|
||||
</template>
|
||||
</v-braintree>
|
||||
</v-col>-->
|
||||
|
||||
</v-row>
|
||||
</v-form>
|
||||
</div>
|
||||
<v-row v-else>
|
||||
<v-col cols="12" sm="8" v-if="this.userAuth">
|
||||
|
@ -701,226 +699,7 @@
|
|||
</v-col>
|
||||
</div>-->
|
||||
</v-radio-group>
|
||||
<v-radio-group
|
||||
:mandatory="false"
|
||||
v-model="paymentMethodFree"
|
||||
v-else-if="shippingInformations.totals.grandTotal == 0"
|
||||
>
|
||||
<p class="h3 mb-5">Payment Method</p>
|
||||
<v-radio
|
||||
:label="shippingInformations.paymentMethods[2].title"
|
||||
:value="paymentMethodFree"
|
||||
class="black--text"
|
||||
></v-radio>
|
||||
<div>
|
||||
<v-checkbox
|
||||
label="My billing and shipping address are the same"
|
||||
v-model="sameAddress"
|
||||
@change="resetFields()"
|
||||
dense
|
||||
:readonly="readOnlyCheckBox"
|
||||
hide-details
|
||||
></v-checkbox>
|
||||
<v-row v-if="sameAddress">
|
||||
<v-col cols="12" class="pl-sm-10">
|
||||
<BillingAddressComponent :address="address" />
|
||||
<v-btn
|
||||
class="primary my-3"
|
||||
large
|
||||
v-if="editBillingButton"
|
||||
@click="editBillBook()"
|
||||
>Edit</v-btn
|
||||
>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-else>
|
||||
<v-col cols="12" sm="8" v-if="this.userAuth">
|
||||
<v-row v-if="addressLength > 0">
|
||||
<v-col cols="12">
|
||||
<v-select
|
||||
v-model="selectedBillingAddress"
|
||||
dense
|
||||
:items="billingAddressList"
|
||||
outlined
|
||||
return-object
|
||||
class="billing-address-select"
|
||||
@change="changeBillingAddress()"
|
||||
item-value="id"
|
||||
>
|
||||
<template v-slot:selection="data">
|
||||
<div v-if="data.item.value">
|
||||
<span class>New Address</span>
|
||||
</div>
|
||||
<div
|
||||
class="
|
||||
d-inline-block
|
||||
text-truncate
|
||||
pt-sm-0
|
||||
"
|
||||
v-else
|
||||
>
|
||||
<span class
|
||||
>{{ data.item.firstname }}
|
||||
{{ data.item.lastname }}</span
|
||||
>
|
||||
<span
|
||||
class="body pl-1"
|
||||
v-if="data.item.streetNoOne"
|
||||
>{{ data.item.streetNoOne }},
|
||||
{{ data.item.streetNoTwo }}</span
|
||||
>
|
||||
<span class="body pl-1" v-else
|
||||
>{{ data.item.street[0] }} ,{{
|
||||
data.item.street[1]
|
||||
}}</span
|
||||
>
|
||||
<span class="pl-1"
|
||||
>{{ data.item.city }}
|
||||
{{ data.item.postcode }}</span
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:item="data">
|
||||
<v-list-item-content>
|
||||
<v-list-item-title
|
||||
v-if="data.item.value"
|
||||
>
|
||||
<span class="ml-2">New Address</span>
|
||||
</v-list-item-title>
|
||||
<v-list-item-title v-else>
|
||||
<span class="ml-2"
|
||||
>{{ data.item.firstname }}
|
||||
{{ data.item.lastname }},</span
|
||||
>
|
||||
<span
|
||||
class="body"
|
||||
v-if="data.item.streetNoOne"
|
||||
>{{ data.item.streetNoOne }},
|
||||
{{ data.item.streetNoTwo }}</span
|
||||
>
|
||||
<span class="body" v-else
|
||||
>{{ data.item.street[0] }} ,{{
|
||||
data.item.street[1]
|
||||
}}</span
|
||||
>
|
||||
<span class
|
||||
>{{ data.item.city }},
|
||||
{{ data.item.postcode }}</span
|
||||
>
|
||||
</v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</template>
|
||||
</v-select>
|
||||
</v-col>
|
||||
<v-col
|
||||
cols="12"
|
||||
class="d-flex justify-end pa-0"
|
||||
v-if="!showNewBillingForm"
|
||||
>
|
||||
<v-btn
|
||||
class="primary ma-3 text-uppercase"
|
||||
@click="cancelBillingAddress"
|
||||
>Cancel</v-btn
|
||||
>
|
||||
<v-btn
|
||||
class="success ma-3 text-uppercase"
|
||||
@click="updateBillingAddress"
|
||||
>Update</v-btn
|
||||
>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="showNewBillingForm">
|
||||
<v-col cols="12">
|
||||
<ShippingAddressFormComponent
|
||||
@actionValid="checkFormValid"
|
||||
:hideAndShowFields="hideAndShowFields"
|
||||
@verifyAddress="verifyAddress"
|
||||
ref="billingForm"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col cols="12" class="py-0">
|
||||
<v-checkbox
|
||||
label="Save in Address Book"
|
||||
v-model="saveInBillingAddressBook"
|
||||
class="mt-0"
|
||||
dense
|
||||
hide-details
|
||||
></v-checkbox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="8" v-else>
|
||||
<GuestShippingAddressForm
|
||||
@actionValid="checkGuestFormValid"
|
||||
:hideEmail="hideEmailField"
|
||||
@verifyAddress="verifyAddress"
|
||||
ref="addressForm"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col
|
||||
cols="12"
|
||||
sm="8"
|
||||
class="d-flex justify-end pa-0"
|
||||
v-if="showNewBillingForm"
|
||||
>
|
||||
<v-btn
|
||||
class="primary ma-3 text-uppercase"
|
||||
@click="cancelBillingAddress"
|
||||
>Cancel</v-btn
|
||||
>
|
||||
<v-btn
|
||||
class="success ma-3 text-uppercase"
|
||||
@click="newBillingAddress"
|
||||
>Update</v-btn
|
||||
>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="pl-3">
|
||||
|
||||
<v-col cols="12" align="right">
|
||||
<v-btn
|
||||
class="primary mx-3 text-uppercase"
|
||||
@click="placeOrderFree()"
|
||||
tile
|
||||
depressed
|
||||
>Place Order</v-btn
|
||||
>
|
||||
</v-col>
|
||||
|
||||
<!-- <v-col cols="12" sm="6">
|
||||
<v-braintree
|
||||
:authorization="braintreeAuthKey"
|
||||
:vaultManager="true"
|
||||
@success="onPaymentSuccess"
|
||||
@error="onPaymentError"
|
||||
@load="onGatewayLoad"
|
||||
@loadFail="onGatewayLoadFail"
|
||||
>
|
||||
<template v-slot:button="slotProps">
|
||||
<v-btn @click="slotProps.submit" color="success">Place Order</v-btn>
|
||||
</template>
|
||||
</v-braintree>
|
||||
</v-col>-->
|
||||
</v-row>
|
||||
</div>
|
||||
<!-- <v-divider class="my-3"></v-divider>
|
||||
<v-radio
|
||||
:label="shippingInformations.paymentMethods[0].title"
|
||||
:value="shippingInformations.paymentMethods[0].code"
|
||||
class="black--text"
|
||||
></v-radio>
|
||||
<div v-if="paymentMethod === 'braintree_paypal'">
|
||||
|
||||
<v-col cols="12" sm="12" class="pr-10 pt-10">
|
||||
<v-btn
|
||||
id="paypal-button"
|
||||
tile
|
||||
class="float-right text-uppercase"
|
||||
color="primary"
|
||||
>Continue To Paypal</v-btn>
|
||||
</v-col>
|
||||
</div>-->
|
||||
</v-radio-group>
|
||||
<v-divider></v-divider>
|
||||
</v-col>
|
||||
<v-col cols="12" v-else>
|
||||
|
@ -969,433 +748,7 @@
|
|||
>
|
||||
</v-form>
|
||||
</v-col>
|
||||
<v-radio-group
|
||||
:mandatory="false"
|
||||
v-model="paymentMethod"
|
||||
v-if="
|
||||
giftCardProduct &&
|
||||
cartProductTotalAmt.grandTotal !== 0
|
||||
"
|
||||
>
|
||||
<p class="h3 mb-5">Payment Method</p>
|
||||
<v-radio
|
||||
:label="giftCardProductTitle"
|
||||
:value="giftCardProductCode"
|
||||
class="black--text"
|
||||
></v-radio>
|
||||
<div v-if="paymentMethod === 'braintree'">
|
||||
<v-row>
|
||||
<v-col cols="12" sm="8" v-if="this.userAuth">
|
||||
<v-row v-if="addressLength > 0">
|
||||
<v-col cols="12">
|
||||
<v-select
|
||||
v-model="selectedBillingAddress"
|
||||
dense
|
||||
:items="billingAddressList"
|
||||
outlined
|
||||
return-object
|
||||
class="billing-address-select"
|
||||
@change="changeBillingAddress()"
|
||||
item-value="id"
|
||||
>
|
||||
<template v-slot:selection="data">
|
||||
<div v-if="data.item.value">
|
||||
<span class>New Address</span>
|
||||
</div>
|
||||
<div
|
||||
class="
|
||||
d-inline-block
|
||||
text-truncate
|
||||
pt-sm-0
|
||||
"
|
||||
v-else
|
||||
>
|
||||
<span class
|
||||
>{{ data.item.firstname }}
|
||||
{{ data.item.lastname }}</span
|
||||
>
|
||||
<span
|
||||
class="body pl-1"
|
||||
v-if="data.item.streetNoOne"
|
||||
>{{ data.item.streetNoOne }},
|
||||
{{ data.item.streetNoTwo }}</span
|
||||
>
|
||||
<span class="body pl-1" v-else
|
||||
>{{ data.item.street[0] }} ,{{
|
||||
data.item.street[1]
|
||||
}}</span
|
||||
>
|
||||
<span class="pl-1"
|
||||
>{{ data.item.city }}
|
||||
{{ data.item.postcode }}</span
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:item="data">
|
||||
<v-list-item-content>
|
||||
<v-list-item-title
|
||||
v-if="data.item.value"
|
||||
>
|
||||
<span class="ml-2">New Address</span>
|
||||
</v-list-item-title>
|
||||
<v-list-item-title v-else>
|
||||
<span class="ml-2"
|
||||
>{{ data.item.firstname }}
|
||||
{{ data.item.lastname }},</span
|
||||
>
|
||||
<span
|
||||
class="body"
|
||||
v-if="data.item.streetNoOne"
|
||||
>{{ data.item.streetNoOne }},
|
||||
{{ data.item.streetNoTwo }}</span
|
||||
>
|
||||
<span class="body" v-else
|
||||
>{{ data.item.street[0] }} ,{{
|
||||
data.item.street[1]
|
||||
}}</span
|
||||
>
|
||||
<span class
|
||||
>{{ data.item.city }},
|
||||
{{ data.item.postcode }}</span
|
||||
>
|
||||
</v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</template>
|
||||
</v-select>
|
||||
</v-col>
|
||||
<v-col
|
||||
cols="12"
|
||||
class="d-flex justify-end pa-0"
|
||||
v-if="!showNewBillingForm"
|
||||
>
|
||||
<v-btn
|
||||
class="primary ma-3 text-uppercase"
|
||||
@click="cancelBillingAddress"
|
||||
>Cancel</v-btn
|
||||
>
|
||||
<v-btn
|
||||
class="success ma-3 text-uppercase"
|
||||
@click="updateBillingAddress"
|
||||
>Update</v-btn
|
||||
>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-else-if="showNewBillingForm">
|
||||
<v-col cols="12">
|
||||
<ShippingAddressFormComponent
|
||||
@actionValid="checkFormValid"
|
||||
:hideAndShowFields="hideAndShowFields"
|
||||
@verifyAddress="verifyAddress"
|
||||
ref="billingForm"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col cols="12" class="py-0">
|
||||
<v-checkbox
|
||||
label="Save in Address Book"
|
||||
v-model="saveInBillingAddressBook"
|
||||
class="mt-0"
|
||||
dense
|
||||
hide-details
|
||||
></v-checkbox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="8" v-else>
|
||||
<GuestShippingAddressForm
|
||||
@actionValid="checkGuestFormValid"
|
||||
:hideHeader="true"
|
||||
:hideEmail="hideEmailFieldGiftCardProduct"
|
||||
@verifyAddress="verifyAddress"
|
||||
ref="addressFormGuest"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col
|
||||
cols="12"
|
||||
sm="8"
|
||||
class="d-flex justify-end pa-0"
|
||||
v-if="showNewBillingForm"
|
||||
>
|
||||
<v-btn
|
||||
class="primary ma-3 text-uppercase"
|
||||
@click="cancelBillingAddress"
|
||||
>Cancel</v-btn
|
||||
>
|
||||
<v-btn
|
||||
class="success ma-3 text-uppercase"
|
||||
@click="newBillingAddress"
|
||||
>Update</v-btn
|
||||
>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row>
|
||||
<CardPayment
|
||||
@submitCardPayment="submitCardPayment"
|
||||
/>
|
||||
<!-- <v-col cols="12" sm="6">
|
||||
<v-braintree
|
||||
:authorization="braintreeAuthKey"
|
||||
:vaultManager="true"
|
||||
@success="onPaymentSuccess"
|
||||
@error="onPaymentError"
|
||||
@load="onGatewayLoad"
|
||||
@loadFail="onGatewayLoadFail"
|
||||
>
|
||||
<template v-slot:button="slotProps">
|
||||
<v-btn @click="slotProps.submit" color="success">Place Order</v-btn>
|
||||
</template>
|
||||
</v-braintree>
|
||||
</v-col>-->
|
||||
</v-row>
|
||||
</div>
|
||||
<!-- <v-divider class="my-3"></v-divider>
|
||||
<v-radio
|
||||
:label="shippingInformations.paymentMethods[0].title"
|
||||
:value="shippingInformations.paymentMethods[0].code"
|
||||
class="black--text"
|
||||
></v-radio>
|
||||
<div v-if="paymentMethod === 'braintree_paypal'">
|
||||
|
||||
<v-col cols="12" sm="12" class="pr-10 pt-10">
|
||||
<v-btn
|
||||
id="paypal-button"
|
||||
tile
|
||||
class="float-right text-uppercase"
|
||||
color="primary"
|
||||
>Continue To Paypal</v-btn>
|
||||
</v-col>
|
||||
</div>-->
|
||||
</v-radio-group>
|
||||
<v-radio-group
|
||||
:mandatory="false"
|
||||
v-model="paymentMethodFree"
|
||||
v-else-if="
|
||||
giftCardProduct && cartProductTotalAmt.grandTotal == 0
|
||||
"
|
||||
>
|
||||
<p class="h3 mb-5">Payment Method</p>
|
||||
<v-radio
|
||||
:label="giftCardFreeProductTitle"
|
||||
:value="paymentMethodFree"
|
||||
class="black--text"
|
||||
></v-radio>
|
||||
<div>
|
||||
<v-checkbox
|
||||
label="My billing and shipping address are the same"
|
||||
v-model="sameAddress"
|
||||
@change="resetFields()"
|
||||
dense
|
||||
:readonly="readOnlyCheckBox"
|
||||
hide-details
|
||||
></v-checkbox>
|
||||
<v-row v-if="sameAddress">
|
||||
<v-col cols="12" class="pl-sm-10">
|
||||
<BillingAddressComponent :address="address" />
|
||||
<v-btn
|
||||
class="primary my-3"
|
||||
large
|
||||
v-if="editBillingButton"
|
||||
@click="editBillBook()"
|
||||
>Edit</v-btn
|
||||
>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-else>
|
||||
<v-col cols="12" sm="8" v-if="this.userAuth">
|
||||
<v-row v-if="addressLength > 0">
|
||||
<v-col cols="12">
|
||||
<v-select
|
||||
v-model="selectedBillingAddress"
|
||||
dense
|
||||
:items="billingAddressList"
|
||||
outlined
|
||||
return-object
|
||||
class="billing-address-select"
|
||||
@change="changeBillingAddress()"
|
||||
item-value="id"
|
||||
>
|
||||
<template v-slot:selection="data">
|
||||
<div v-if="data.item.value">
|
||||
<span class>New Address</span>
|
||||
</div>
|
||||
<div
|
||||
class="
|
||||
d-inline-block
|
||||
text-truncate
|
||||
pt-sm-0
|
||||
"
|
||||
v-else
|
||||
>
|
||||
<span class
|
||||
>{{ data.item.firstname }}
|
||||
{{ data.item.lastname }}</span
|
||||
>
|
||||
<span
|
||||
class="body pl-1"
|
||||
v-if="data.item.streetNoOne"
|
||||
>{{ data.item.streetNoOne }},
|
||||
{{ data.item.streetNoTwo }}</span
|
||||
>
|
||||
<span class="body pl-1" v-else
|
||||
>{{ data.item.street[0] }} ,{{
|
||||
data.item.street[1]
|
||||
}}</span
|
||||
>
|
||||
<span class="pl-1"
|
||||
>{{ data.item.city }}
|
||||
{{ data.item.postcode }}</span
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:item="data">
|
||||
<v-list-item-content>
|
||||
<v-list-item-title
|
||||
v-if="data.item.value"
|
||||
>
|
||||
<span class="ml-2">New Address</span>
|
||||
</v-list-item-title>
|
||||
<v-list-item-title v-else>
|
||||
<span class="ml-2"
|
||||
>{{ data.item.firstname }}
|
||||
{{ data.item.lastname }},</span
|
||||
>
|
||||
<span
|
||||
class="body"
|
||||
v-if="data.item.streetNoOne"
|
||||
>{{ data.item.streetNoOne }},
|
||||
{{ data.item.streetNoTwo }}</span
|
||||
>
|
||||
<span class="body" v-else
|
||||
>{{ data.item.street[0] }} ,{{
|
||||
data.item.street[1]
|
||||
}}</span
|
||||
>
|
||||
<span class
|
||||
>{{ data.item.city }},
|
||||
{{ data.item.postcode }}</span
|
||||
>
|
||||
</v-list-item-title>
|
||||
</v-list-item-content>
|
||||
</template>
|
||||
</v-select>
|
||||
</v-col>
|
||||
<v-col
|
||||
cols="12"
|
||||
class="d-flex justify-end pa-0"
|
||||
v-if="!showNewBillingForm"
|
||||
>
|
||||
<v-btn
|
||||
class="primary ma-3 text-uppercase"
|
||||
@click="cancelBillingAddress"
|
||||
>Cancel</v-btn
|
||||
>
|
||||
<v-btn
|
||||
class="success ma-3 text-uppercase"
|
||||
@click="updateBillingAddress"
|
||||
>Update</v-btn
|
||||
>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row v-if="showNewBillingForm">
|
||||
<v-col cols="12">
|
||||
<ShippingAddressFormComponent
|
||||
@actionValid="checkFormValid"
|
||||
:hideAndShowFields="hideAndShowFields"
|
||||
@verifyAddress="verifyAddress"
|
||||
ref="billingForm"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col cols="12" class="py-0">
|
||||
<v-checkbox
|
||||
label="Save in Address Book"
|
||||
v-model="saveInBillingAddressBook"
|
||||
class="mt-0"
|
||||
dense
|
||||
hide-details
|
||||
></v-checkbox>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-col>
|
||||
<v-col cols="12" sm="8" v-else>
|
||||
<GuestShippingAddressForm
|
||||
@actionValid="checkGuestFormValid"
|
||||
:hideEmail="hideEmailField"
|
||||
@verifyAddress="verifyAddress"
|
||||
ref="addressForm"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col
|
||||
cols="12"
|
||||
sm="8"
|
||||
class="d-flex justify-end pa-0"
|
||||
v-if="showNewBillingForm"
|
||||
>
|
||||
<v-btn
|
||||
class="primary ma-3 text-uppercase"
|
||||
@click="cancelBillingAddress"
|
||||
>Cancel</v-btn
|
||||
>
|
||||
<v-btn
|
||||
class="success ma-3 text-uppercase"
|
||||
@click="newBillingAddress"
|
||||
>Update</v-btn
|
||||
>
|
||||
</v-col>
|
||||
</v-row>
|
||||
<v-row class="pl-3">
|
||||
<v-col cols="12" align="right">
|
||||
<v-text-field
|
||||
v-model="poNumber"
|
||||
type="text"
|
||||
dense
|
||||
placeholder="Purchase Order Number"
|
||||
outlined
|
||||
:rules="textRules"
|
||||
></v-text-field>
|
||||
</v-col>
|
||||
<!-- <v-col cols="12" align="right">
|
||||
<v-btn
|
||||
class="primary mx-3 text-uppercase"
|
||||
@click="placeOrderFree()"
|
||||
tile
|
||||
depressed
|
||||
>Place Order</v-btn
|
||||
>
|
||||
</v-col>-->
|
||||
|
||||
<!-- <v-col cols="12" sm="6">
|
||||
<v-braintree
|
||||
:authorization="braintreeAuthKey"
|
||||
:vaultManager="true"
|
||||
@success="onPaymentSuccess"
|
||||
@error="onPaymentError"
|
||||
@load="onGatewayLoad"
|
||||
@loadFail="onGatewayLoadFail"
|
||||
>
|
||||
<template v-slot:button="slotProps">
|
||||
<v-btn @click="slotProps.submit" color="success">Place Order</v-btn>
|
||||
</template>
|
||||
</v-braintree>
|
||||
</v-col>-->
|
||||
</v-row>
|
||||
</div>
|
||||
<!-- <v-divider class="my-3"></v-divider>
|
||||
<v-radio
|
||||
:label="shippingInformations.paymentMethods[0].title"
|
||||
:value="shippingInformations.paymentMethods[0].code"
|
||||
class="black--text"
|
||||
></v-radio>
|
||||
<div v-if="paymentMethod === 'braintree_paypal'">
|
||||
|
||||
<v-col cols="12" sm="12" class="pr-10 pt-10">
|
||||
<v-btn
|
||||
id="paypal-button"
|
||||
tile
|
||||
class="float-right text-uppercase"
|
||||
color="primary"
|
||||
>Continue To Paypal</v-btn>
|
||||
</v-col>
|
||||
</div>-->
|
||||
</v-radio-group>
|
||||
<v-divider></v-divider>
|
||||
</v-col>
|
||||
<!-- <v-col cols="12" class="py-0">
|
||||
|
@ -1852,7 +1205,7 @@ export default {
|
|||
validLogin: false,
|
||||
passwordFields: false,
|
||||
showAlert: false,
|
||||
valid: false,
|
||||
valid: true,
|
||||
validDiscountCode: true,
|
||||
chekoutFlag: false,
|
||||
tabs: "",
|
||||
|
@ -2754,8 +2107,10 @@ export default {
|
|||
onGatewayLoadFail(instance) {
|
||||
console.log("load failed", instance);
|
||||
},
|
||||
async placeOrderFree() {
|
||||
async placeOrderFree(e) {
|
||||
try {
|
||||
e.preventDefault();
|
||||
if (this.$refs.poNumberForm.validate()) {
|
||||
this.isPageLoader = true;
|
||||
if (this.userAuth) {
|
||||
try {
|
||||
|
@ -2773,101 +2128,9 @@ export default {
|
|||
timeout: 5000,
|
||||
};
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
let res = await this.$store.dispatch("guestInfo/setOrder", {
|
||||
userEmail: this.email,
|
||||
paymentMethod: {
|
||||
method: this.freePaymentMethod,
|
||||
},
|
||||
});
|
||||
await this.$store.dispatch("guestInfo/setPaymentInProgress", true);
|
||||
if (res) {
|
||||
try {
|
||||
let resp = await this.$store.dispatch(
|
||||
"meProductOne/fetchOrderProduct",
|
||||
res
|
||||
);
|
||||
if (resp && resp.items) {
|
||||
/*googleAanalyticsCheckout("checkout_progress", {
|
||||
items: resp.items,
|
||||
});
|
||||
googleAanalyticsCheckout("set_checkout_option", {
|
||||
checkout_step: 1,
|
||||
checkout_option: "payment",
|
||||
});*/
|
||||
}
|
||||
}
|
||||
|
||||
googleAanalyticsCheckoutAddPaymentInfo(
|
||||
"add_payment_info",
|
||||
resp
|
||||
);
|
||||
googleAanalyticsPurchase(resp, resp.incrementId);
|
||||
let shippingAddress = [];
|
||||
let ccid = "";
|
||||
let webOrderNumber = resp.incrementId;
|
||||
let magentoOrderNumber = res;
|
||||
for (let i = 0; resp.items.length > i; i++) {
|
||||
let obj = resp.items[i];
|
||||
if (obj.extensionAttributes) {
|
||||
ccid = obj.extensionAttributes.ccid;
|
||||
if (ccid) {
|
||||
shippingAddress =
|
||||
resp.extensionAttributes.shippingAssignments[0]
|
||||
.shipping.address;
|
||||
try {
|
||||
let response = await this.$store.dispatch(
|
||||
"accountOne/setCCOrder",
|
||||
{
|
||||
orderNumber: ccid,
|
||||
shippingAddress: shippingAddress,
|
||||
webOrderNumber: webOrderNumber,
|
||||
estimatedShipping: this.estimatedShipping,
|
||||
}
|
||||
);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
if (obj.extensionAttributes.personalizeDetails) {
|
||||
await this.placeCraneOrder(
|
||||
resp,
|
||||
obj,
|
||||
webOrderNumber,
|
||||
magentoOrderNumber
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
await this.$store.dispatch(
|
||||
"accountOne/setPaymentInProgress",
|
||||
false
|
||||
);
|
||||
this.isPageLoader = false;
|
||||
this.snackbar = {
|
||||
message: error,
|
||||
color: "error",
|
||||
show: true,
|
||||
timeout: 5000,
|
||||
};
|
||||
}
|
||||
}
|
||||
await this.$store.dispatch("guestInfo/setPaymentInProgress", false);
|
||||
this.$router.push({
|
||||
name: "OrderSuccess",
|
||||
params: { orderNumber: res },
|
||||
});
|
||||
} catch (error) {
|
||||
this.isPageLoader = false;
|
||||
this.snackbar = {
|
||||
message: error.message,
|
||||
color: "error",
|
||||
show: true,
|
||||
timeout: 5000,
|
||||
};
|
||||
}
|
||||
}
|
||||
} catch (error) {}
|
||||
},
|
||||
async submitCardPayment(payment) {
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
...authHeader()
|
||||
},
|
||||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/crcmsBlock/${blockId}`, requestOptions)
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crcmsBlock/${blockId}`, requestOptions)
|
||||
});
|
||||
|
||||
export const doFetchList = wrapRequest(() => {
|
||||
|
@ -22,9 +22,9 @@
|
|||
'Authorization': 'Bearer ' + 'q6u1q4thvtw03ajuo5v6q3cb8vlq623v'
|
||||
},
|
||||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/cmsBlock/search?searchCriteria[filter_groups][0][filters][0][field]=id&searchCriteria[filter_groups][0][filters][0][value]=10&searchCriteria[filter_groups][0][filters][0][condition_type]=eq`, requestOptions)
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/cmsBlock/search?searchCriteria[filter_groups][0][filters][0][field]=id&searchCriteria[filter_groups][0][filters][0][value]=10&searchCriteria[filter_groups][0][filters][0][condition_type]=eq`, requestOptions)
|
||||
|
||||
// return fetch(`${vueAppMagenotApiUrl}/rest/V1/cmsBlock/search?
|
||||
// return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/cmsBlock/search?
|
||||
// searchCriteria[filter_groups][0][filters][0][field]=id&
|
||||
// searchCriteria[filter_groups][0][filters][0][value]=10&
|
||||
// searchCriteria[filter_groups][0][filters][0][condition_type]=eq&
|
||||
|
@ -38,5 +38,5 @@
|
|||
...authHeader()
|
||||
},
|
||||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/crcmsPage/search?searchCriteria[filter_groups][0][filters][0][field]=identifier&searchCriteria[filter_groups][0][filters][0][value]=${pageUrlKey}&searchCriteria[filter_groups][0][filters][0][condition_type]=eq`, requestOptions)
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crcmsPage/search?searchCriteria[filter_groups][0][filters][0][field]=identifier&searchCriteria[filter_groups][0][filters][0][value]=${pageUrlKey}&searchCriteria[filter_groups][0][filters][0][condition_type]=eq`, requestOptions)
|
||||
});
|
|
@ -14,7 +14,7 @@ export const doLogin = wrapRequest((loginDetail) => {
|
|||
password: loginDetail.password
|
||||
})
|
||||
};
|
||||
return fetch(`${vueAppMagentoApiUrl}/rest/V1/integration/customer/token`, requestOptions);
|
||||
return fetch(`${vueAppMagentoApiUrl}/rest/crn_retailer/V1/integration/customer/token`, requestOptions);
|
||||
});
|
||||
|
||||
////////////////// dummy api //////////////////
|
||||
|
|
|
@ -68,7 +68,7 @@ const meHandleError = async errorResponse => {
|
|||
if (localStorage.getItem("cr_changePassowrd") == "true") {
|
||||
localStorage.clear("cr_changePassowrd")
|
||||
} else {
|
||||
//loginInterrupt(window.location.href, 'There was an access violation caused by your request. You need to sign back in please.');
|
||||
loginInterrupt(window.location.href, 'There was an access violation caused by your request. You need to sign back in please.');
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -127,9 +127,9 @@ const handleError = async errorResponse => {
|
|||
if (typeof Vue.$snotify != 'undefined') {
|
||||
Vue.$snotify.error(data_401.message);
|
||||
}
|
||||
throw data_401;
|
||||
// throw data_401;
|
||||
|
||||
//loginInterrupt(window.location.href, 'There was an access violation caused by your request. You need to sign back in please.');
|
||||
loginInterrupt(window.location.href, 'There was an access violation caused by your request. You need to sign back in please.');
|
||||
break;
|
||||
}
|
||||
case 400:
|
||||
|
|
|
@ -15,7 +15,7 @@ export const doFetchOrderProductsList = wrapRequest((emailId) => {
|
|||
// ...authHeader()
|
||||
}
|
||||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/crorders?searchCriteria[filter_groups][0][filters][0][field]=customer_email&searchCriteria[filter_groups][0][filters][0][value]=${emailId}`, requestOptions)
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crorders?searchCriteria[filter_groups][0][filters][0][field]=customer_email&searchCriteria[filter_groups][0][filters][0][value]=${emailId}`, requestOptions)
|
||||
|
||||
});
|
||||
export const doFetchOrderProduct = wrapRequest((orderId) => {
|
||||
|
@ -27,7 +27,7 @@ export const doFetchOrderProduct = wrapRequest((orderId) => {
|
|||
// ...authHeader()
|
||||
}
|
||||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/crorders/${orderId}`, requestOptions)
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crorders/${orderId}`, requestOptions)
|
||||
|
||||
});
|
||||
|
||||
|
@ -146,7 +146,7 @@ export const doFetchProductsList = wrapRequest(() => {
|
|||
|
||||
},
|
||||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/crproducts?searchCriteria[current_page]=1&searchCriteria[page_size]=27`, requestOptions)
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crproducts?searchCriteria[current_page]=1&searchCriteria[page_size]=27`, requestOptions)
|
||||
});
|
||||
export const doFetchProductsMedia = wrapRequest((sku) => {
|
||||
const requestOptions = {
|
||||
|
@ -157,7 +157,7 @@ export const doFetchProductsMedia = wrapRequest((sku) => {
|
|||
'Access-Control-Allow-Origin': '*',
|
||||
},
|
||||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/crproducts/${sku}?fields=sku,media_gallery_entries[file]`, requestOptions)
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crproducts/${sku}?fields=sku,media_gallery_entries[file]`, requestOptions)
|
||||
});
|
||||
export const doFetchProductsAttributes = wrapRequest((sku) => {
|
||||
const requestOptions = {
|
||||
|
@ -168,7 +168,7 @@ export const doFetchProductsAttributes = wrapRequest((sku) => {
|
|||
'Access-Control-Allow-Origin': '*',
|
||||
},
|
||||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/crproducts/${sku}?fields=sku,custom_attributes`, requestOptions)
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crproducts/${sku}?fields=sku,custom_attributes`, requestOptions)
|
||||
});
|
||||
export const doFetchAttributeList = wrapRequest(() => {
|
||||
const requestOptions = {
|
||||
|
@ -178,7 +178,7 @@ export const doFetchAttributeList = wrapRequest(() => {
|
|||
|
||||
},
|
||||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/crproducts/attributes?searchCriteria=&fields=items[attribute_id,attribute_code,options,frontend_labels]`, requestOptions)
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crproducts/attributes?searchCriteria=&fields=items[attribute_id,attribute_code,options,frontend_labels]`, requestOptions)
|
||||
});
|
||||
|
||||
export const doFetchFilterOptions = async () => {
|
||||
|
@ -435,7 +435,7 @@ export const doFetchProductDetails = wrapRequest((sku) => {
|
|||
'Access-Control-Allow-Origin': '*'
|
||||
},
|
||||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/product/${sku}`, requestOptions)
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/product/${sku}`, requestOptions)
|
||||
|
||||
});
|
||||
export const doFetchConfiguredProductDetails = wrapRequest((productId) => {
|
||||
|
@ -446,7 +446,7 @@ export const doFetchConfiguredProductDetails = wrapRequest((productId) => {
|
|||
'Access-Control-Allow-Origin': '*'
|
||||
},
|
||||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/crproducts?searchCriteria[filter_groups][0][filters][0][field]=entity_id&searchCriteria[filter_groups][0][filters][0][value]=${productId}?searchCriteria&fields=items[price,sku,media_gallery_entries,custom_attributes]`, requestOptions)
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crproducts?searchCriteria[filter_groups][0][filters][0][field]=entity_id&searchCriteria[filter_groups][0][filters][0][value]=${productId}?searchCriteria&fields=items[price,sku,media_gallery_entries,custom_attributes]`, requestOptions)
|
||||
|
||||
});
|
||||
export const doFetchAttributeFilterProducts = wrapRequest(() => {
|
||||
|
@ -500,8 +500,8 @@ export const doFetchSortProducts = wrapRequest((pageNo, pageSize, sortBy, catego
|
|||
//side filter end//
|
||||
let query = "";
|
||||
query = `?searchCriteria[filter_groups][0][filters][0][field]=entity_id&searchCriteria[filter_groups][0][filters][0][value]=${categoryIds}&searchCriteria[filter_groups][0][filters][0][condition_type]=in&searchCriteria[sortOrders][0][field]=${sortBy}&searchCriteria[sortOrders][0][direction]=${sortFlag}`
|
||||
console.log('product', `${vueAppMagenotApiUrl}/rest/V1/crproducts/${query}`);
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/crproducts/${query}`, requestOptions)
|
||||
console.log('product', `${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crproducts/${query}`);
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crproducts/${query}`, requestOptions)
|
||||
|
||||
} else {
|
||||
let nameSearchQuery = "";
|
||||
|
@ -526,8 +526,8 @@ export const doFetchSortProducts = wrapRequest((pageNo, pageSize, sortBy, catego
|
|||
|
||||
query = `?${extraAttribute}${nameSearchQuery}${filterQuery}searchCriteria[filter_groups][${increment}][filters][0][field]=status&searchCriteria[filter_groups][${increment}][filters][0][value]=1&searchCriteria[filter_groups][${increment}][filters][0][condition_type]=eq&searchCriteria[sortOrders][0][field]=${sortBy}&searchCriteria[sortOrders][0][direction]=DESC`;
|
||||
|
||||
console.log('productNames', `${vueAppMagenotApiUrl}/rest/V1/crproducts/${query}`);
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/crproducts/${query}`, requestOptions)
|
||||
console.log('productNames', `${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crproducts/${query}`);
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crproducts/${query}`, requestOptions)
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -539,7 +539,7 @@ export const doFetchCategoryList = wrapRequest(() => {
|
|||
|
||||
},
|
||||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/crcategories`, requestOptions)
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crcategories`, requestOptions)
|
||||
});
|
||||
/*export const doFetchCategoryList = wrapRequest(() => {
|
||||
const requestOptions = {
|
||||
|
@ -554,7 +554,7 @@ export const dofetchCategoryListIdWise = wrapRequest(() => {
|
|||
'Content-type': 'application/json'
|
||||
},
|
||||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/crcategories/list?searchCriteria&fields=items[id,parent_id,name,custom_attributes]`, requestOptions)
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crcategories/list?searchCriteria&fields=items[id,parent_id,name,custom_attributes]`, requestOptions)
|
||||
});
|
||||
export const doFetchCatelogProducts = wrapRequest((searchCriteria) => {
|
||||
const requestOptions = {
|
||||
|
@ -562,7 +562,7 @@ export const doFetchCatelogProducts = wrapRequest((searchCriteria) => {
|
|||
headers: { 'Content-type': 'application/json' }
|
||||
};
|
||||
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/suggestion?q=${searchCriteria}`, requestOptions);
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/suggestion?q=${searchCriteria}`, requestOptions);
|
||||
});
|
||||
|
||||
export const doFetchRecentlyViewedList = wrapRequest((sku) => {
|
||||
|
@ -572,7 +572,7 @@ export const doFetchRecentlyViewedList = wrapRequest((sku) => {
|
|||
'Content-type': 'application/json'
|
||||
},
|
||||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/crproducts?searchCriteria[filter_groups][0][filters][0][field]=sku&searchCriteria[filter_groups][0][filters][0][value]=${sku}&searchCriteria[filter_groups][0][filters][0][condition_type]=in&searchCriteria[sortOrders][0][direction]=ASC`, requestOptions)
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/crproducts?searchCriteria[filter_groups][0][filters][0][field]=sku&searchCriteria[filter_groups][0][filters][0][value]=${sku}&searchCriteria[filter_groups][0][filters][0][condition_type]=in&searchCriteria[sortOrders][0][direction]=ASC`, requestOptions)
|
||||
});
|
||||
export const doSideBarFilter = wrapRequest((pageNo, pageSize, sortBy, categoryId, sideFilter, search) => {
|
||||
const requestOptions = {
|
||||
|
@ -601,9 +601,9 @@ export const doSideBarFilter = wrapRequest((pageNo, pageSize, sortBy, categoryId
|
|||
})
|
||||
}
|
||||
|
||||
console.log('searchCat', `${vueAppMagenotApiUrl}/rest/V1/search?searchCriteria[filter_groups][0][filters][0][field]=category_ids&searchCriteria[filter_groups][0][filters][0][value]=${categoryId}&searchCriteria[filter_groups][1][filters][0][field]=visibility&searchCriteria[filter_groups][1][filters][0][value]=4&${nameSearchQuery}${extraAttribute}searchCriteria[sortOrders][0][field]=${sortBy}&searchCriteria[sortOrders][0][direction]=${sortFlag}&searchCriteria[requestName]=catalog_view_container`);
|
||||
console.log('searchCat', `${vueAppMagenotApiUrl}/rest/crn_retailer/V1/search?searchCriteria[filter_groups][0][filters][0][field]=category_ids&searchCriteria[filter_groups][0][filters][0][value]=${categoryId}&searchCriteria[filter_groups][1][filters][0][field]=visibility&searchCriteria[filter_groups][1][filters][0][value]=4&${nameSearchQuery}${extraAttribute}searchCriteria[sortOrders][0][field]=${sortBy}&searchCriteria[sortOrders][0][direction]=${sortFlag}&searchCriteria[requestName]=catalog_view_container`);
|
||||
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/search?searchCriteria[filter_groups][0][filters][0][field]=category_ids&searchCriteria[filter_groups][0][filters][0][value]=${categoryId}&searchCriteria[filter_groups][1][filters][0][field]=visibility&searchCriteria[filter_groups][1][filters][0][value]=4&${nameSearchQuery}${extraAttribute}searchCriteria[sortOrders][0][field]=${sortBy}&searchCriteria[sortOrders][0][direction]=${sortFlag}&searchCriteria[requestName]=catalog_view_container`, requestOptions);
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/search?searchCriteria[filter_groups][0][filters][0][field]=category_ids&searchCriteria[filter_groups][0][filters][0][value]=${categoryId}&searchCriteria[filter_groups][1][filters][0][field]=visibility&searchCriteria[filter_groups][1][filters][0][value]=4&${nameSearchQuery}${extraAttribute}searchCriteria[sortOrders][0][field]=${sortBy}&searchCriteria[sortOrders][0][direction]=${sortFlag}&searchCriteria[requestName]=catalog_view_container`, requestOptions);
|
||||
|
||||
} else if (search) {
|
||||
let nameSearchQuery = "";
|
||||
|
@ -626,8 +626,8 @@ export const doSideBarFilter = wrapRequest((pageNo, pageSize, sortBy, categoryId
|
|||
increment++;
|
||||
})
|
||||
}
|
||||
console.log('search', `${vueAppMagenotApiUrl}/rest/V1/search?${nameSearchQuery}${filterQuery}searchCriteria[filter_groups][${increment}][filters][0][field]=visibility&searchCriteria[filter_groups][${increment}][filters][0][value]=4&${extraAttribute}searchCriteria[sortOrders][0][field]=${sortBy}&searchCriteria[sortOrders][0][direction]=${sortFlag}&searchCriteria[requestName]=quick_search_container`);
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/search?${nameSearchQuery}${filterQuery}searchCriteria[filter_groups][${increment}][filters][0][field]=visibility&searchCriteria[filter_groups][${increment}][filters][0][value]=4&${extraAttribute}searchCriteria[sortOrders][0][field]=${sortBy}&searchCriteria[sortOrders][0][direction]=${sortFlag}&searchCriteria[requestName]=quick_search_container`, requestOptions);
|
||||
console.log('search', `${vueAppMagenotApiUrl}/rest/crn_retailer/V1/search?${nameSearchQuery}${filterQuery}searchCriteria[filter_groups][${increment}][filters][0][field]=visibility&searchCriteria[filter_groups][${increment}][filters][0][value]=4&${extraAttribute}searchCriteria[sortOrders][0][field]=${sortBy}&searchCriteria[sortOrders][0][direction]=${sortFlag}&searchCriteria[requestName]=quick_search_container`);
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/search?${nameSearchQuery}${filterQuery}searchCriteria[filter_groups][${increment}][filters][0][field]=visibility&searchCriteria[filter_groups][${increment}][filters][0][value]=4&${extraAttribute}searchCriteria[sortOrders][0][field]=${sortBy}&searchCriteria[sortOrders][0][direction]=${sortFlag}&searchCriteria[requestName]=quick_search_container`, requestOptions);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ export const doFetchBasicInfo = meWrapRequest(() => {
|
|||
...authHeader()
|
||||
},
|
||||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/customers/me`, requestOptions)
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/customers/me`, requestOptions)
|
||||
});
|
||||
/*
|
||||
export const doFetchChangePassword = wrapRequest((token) => {
|
||||
|
|
|
@ -178,7 +178,7 @@ export const doFetchCartProducts = wrapRequest((userCartId) => {
|
|||
...authHeader()
|
||||
}
|
||||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/cart/data?cartid=${userCartId}`, requestOptions)
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/cart/data?cartid=${userCartId}`, requestOptions)
|
||||
});
|
||||
export const doFetchTotalAmt = wrapRequest(() => {
|
||||
|
||||
|
@ -277,7 +277,7 @@ export const doFetchGiftMessage = wrapRequest((quoteId, itemId) => {
|
|||
...authHeader()
|
||||
}
|
||||
};
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/V1/item/data?itemId=${itemId}&cartid=${quoteId}`, requestOptions)
|
||||
return fetch(`${vueAppMagenotApiUrl}/rest/crn_retailer/V1/item/data?itemId=${itemId}&cartid=${quoteId}`, requestOptions)
|
||||
});
|
||||
export const doPutCConectionCartItem = wrapRequest((sku, qty, ccid) => {
|
||||
const requestOptions = {
|
||||
|
|
|
@ -11,7 +11,7 @@ export const fetchStates = (countryId, countryWiseStates) => {
|
|||
return states.id == countryId;
|
||||
}
|
||||
);
|
||||
if (oneCountry.length > 0) {
|
||||
if (oneCountry.length > 0 && oneCountry[0].availableRegions) {
|
||||
let allStates = oneCountry[0].availableRegions.map(val => {
|
||||
return {
|
||||
value: val.id,
|
||||
|
|
Loading…
Reference in New Issue