not launching vue on commerce pages

This commit is contained in:
2019-10-07 17:32:14 +02:00
parent d5a6194727
commit dc3d0d1ca3
6 changed files with 72 additions and 127 deletions

View File

@@ -31,7 +31,7 @@
:styles="{width:'500px', height:'100%'}"
>
<h2>Please login or register before continue.</h2>
<LoginRegister @onLogedIn="logedIn" />
<LoginRegister @onLogedIn="logedIn" @onRegistered="registered" />
</Modal>
</article>
@@ -85,7 +85,11 @@ export default {
},
logedIn () {
console.log('Product: logedIn');
this.closeModal()
this.addtocart()
},
registered () {
console.log('Product: registered');
this.addtocart()
},
addtocart () {
console.log("addtocart")
@@ -97,9 +101,11 @@ export default {
}])
.then(({ data }) => {
console.log('product add to cart REST: data', data)
this.closeModal()
// TODO: redirect to /cart
})
.catch(( error ) => {
console.warn('Issue with pricing', error)
console.warn('Issue with product add to cart', error)
Promise.reject(error)
})