personalized order with customer numer

This commit is contained in:
sidharth 2022-01-26 10:45:50 +05:30
parent 245c7a820f
commit 79cb86c2e6
3 changed files with 14 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -37,22 +37,22 @@ export default {
};
},
computed: {
userId() {
return this.$store.state.accountOne.one.id;
customerNumber() {
return this.$store.state.accountOne.customerNumber
},
},
watch: {
userId() {
customerNumber() {
this.url =
"https://orderexplorer.crane.com//OrderExplorer/?account=" +
this.userId;
this.customerNumber;
},
},
mounted() {
if (this.userId)
if (this.customerNumber)
this.url =
"https://orderexplorer.crane.com//OrderExplorer/?account=" +
this.userId;
this.customerNumber;
},
};
</script>

View File

@ -59,7 +59,8 @@ export const accountOne = {
wrongPasswordMessage: "",
shippingInformationsInProgress: false,
addressContainPOBox: null,
suggestedAddress: {}
suggestedAddress: {},
customerNumber:""
},
getters: {
getField,
@ -75,6 +76,11 @@ export const accountOne = {
setOne(state, one) {
criteoUpdateUserEmail(one.email)
state.one = Object.assign({}, state.one, defaultAddress, one);
let customerNumber=state.one.customAttributes
.filter((customAttribute)=>customAttribute.attributeCode==="customer_number")[0]
if(customerNumber)
state.customerNumber=customerNumber.value;
state.one.defaultShipping = Number(state.one.defaultShipping);
state.one.defaultBilling = Number(state.one.defaultBilling);
},