New product page with defined route and link from productCard.

This commit is contained in:
2020-07-21 12:59:46 +02:00
parent fdae74bdfa
commit 942a9140f0
3 changed files with 152 additions and 1 deletions

View File

@@ -22,6 +22,7 @@
<div class="content-bottom-actions">
<Button :small="true" :color="color" @click="addItemToCart">Add to cart</Button>
<Button :small="true" color="yellow" @click="viewProduct">View<i class="icon icon--arrow-forward"></i></Button>
</div>
</div>
</div>
@@ -61,13 +62,16 @@ export default {
methods: {
addItemToCart() {
store.dispatch('cartModule/addItemToCart', { ...this.product });
},
viewProduct() {
this.$router.push('/shop/' + this.product.urlSlug)
}
}
}
</script>
<style lang="scss" scoped>
@import '../../styles/variables';
@import '/frontend/styles/variables';
.product-card {
position: relative;
@@ -117,6 +121,8 @@ export default {
&-actions {
border-top: 1px solid rgba(0,0,0,0.1);
display: flex;
justify-content: space-between;
}
}
}