on add to cart open side bar on product detail page
-
hi, i want to when add to cart an item then show mini-cart side bar. how its possible? in shop product view.blade.php? if i use for side bar on click display:block property then its show but not as propper. how there any possible way to call from add to cart button call in vue script?
i use now this.
methods: { addToCart(params) { const operation = this.is_buy_now ? 'buyNow' : 'addToCart'; this.isStoring[operation] = true; let formData = new FormData(this.$refs.formData); this.ensureQuantity(formData); this.$axios.post('{{ route("shop.api.checkout.cart.store") }}', formData, { headers: { 'Content-Type': 'multipart/form-data' } }) .then(response => { if (response.data.message) { this.$emitter.emit('update-mini-cart', response.data.data); this.$nextTick(() => { const miniCartDrawer = document.querySelector('#mini-cart-cus-ss'); if (miniCartDrawer) { miniCartDrawer.style.display = 'block'; // Make it visible document.body.style.overflow ='auto' } }); this.$emitter.emit('add-flash', { type: 'success', message: response.data.message }); if (response.data.redirect) { window.location.href= response.data.redirect; } } else { this.$emitter.emit('add-flash', { type: 'warning', message: response.data.data.message }); } this.isStoring[operation] = false; }) .catch(error => { this.isStoring[operation] = false; this.$emitter.emit('add-flash', { type: 'warning', message: error.response.data.message }); }); },
-
Hello @saqib
For this query kindly raise a ticket on Bagisto UV Desk check out the link below.
Link: https://bagisto.uvdesk.com/en/
Thanks & Regards