updated cart count as per product qty
This commit is contained in:
parent
eb77f928e9
commit
c49e2da4bb
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
* Vue.js v2.7.3
|
||||
* Vue.js v2.7.14
|
||||
* (c) 2014-2022 Evan You
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
* jQuery JavaScript Library v3.6.0
|
||||
* jQuery JavaScript Library v3.6.1
|
||||
* https://jquery.com/
|
||||
*
|
||||
* Includes Sizzle.js
|
||||
|
|
@ -43,7 +43,7 @@
|
|||
* Released under the MIT license
|
||||
* https://jquery.org/license
|
||||
*
|
||||
* Date: 2021-03-02T17:08Z
|
||||
* Date: 2022-08-26T17:52Z
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"/js/jquery-ez-plus.js": "/js/jquery-ez-plus.js?id=49cf283b39e940ef66243de6b2f91383",
|
||||
"/js/velocity-core.js": "/js/velocity-core.js?id=dcc312fe978be1aff63a33eaf7ad190c",
|
||||
"/js/velocity.js": "/js/velocity.js?id=0a68bc9ac7b74131b53b571350c995e1",
|
||||
"/js/velocity.js": "/js/velocity.js?id=1076cff87e4676e516ec97580e1ae9ce",
|
||||
"/js/manifest.js": "/js/manifest.js?id=4113cf6789cdd4f2768f508bc32cad2d",
|
||||
"/js/components.js": "/js/components.js?id=07c3c397ac1408b053609f3960ff9b50",
|
||||
"/css/velocity.css": "/css/velocity.css?id=4bbb68a93d3410f503fdd4d987d3aaca",
|
||||
"/js/components.js": "/js/components.js?id=8799027b13a317853f30cd0c16a820f0",
|
||||
"/css/velocity.css": "/css/velocity.css?id=be5c5fdfabd33347a7d083e5425dc8e3",
|
||||
"/css/velocity-admin.css": "/css/velocity-admin.css?id=b67a82956e53163b5e3ff45a44f9778f",
|
||||
"/images/Camera.svg": "/images/Camera.svg?id=b2fd2f9e17e1ccee96e29f6c6cec91e8",
|
||||
"/images/Icon-Arrow-Right.svg": "/images/Icon-Arrow-Right.svg?id=e30f624f1a70197dc9ad9011b240aa8e",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<div class="mini-cart-content">
|
||||
<i class="material-icons-outlined">shopping_cart</i>
|
||||
<div class="badge-container">
|
||||
<span class="badge" v-text="cartItems.length" v-if="cartItems.length != 0"></span>
|
||||
<span class="badge" v-text="cartTotal" v-if="cartTotal != 0"></span>
|
||||
</div>
|
||||
<span class="fs18 fw6 cart-text" v-text="cartText"></span>
|
||||
</div>
|
||||
|
|
@ -129,7 +129,8 @@ export default {
|
|||
data: function() {
|
||||
return {
|
||||
cartItems: [],
|
||||
cartInformation: []
|
||||
cartInformation: [],
|
||||
cartTotal:0
|
||||
};
|
||||
},
|
||||
|
||||
|
|
@ -150,8 +151,15 @@ export default {
|
|||
.then(response => {
|
||||
if (response.data.status) {
|
||||
this.cartItems = response.data.mini_cart.cart_items;
|
||||
this.cartTotal = 0;
|
||||
for (const [idx, item] of response.data.mini_cart.cart_items.entries()) {
|
||||
this.cartTotal += item.quantity;
|
||||
}
|
||||
|
||||
this.cartInformation =
|
||||
response.data.mini_cart.cart_details;
|
||||
} else {
|
||||
this.cartTotal = 0;
|
||||
}
|
||||
})
|
||||
.catch(exception => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue