Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    on add to cart open side bar on product detail page

    Knowledge Base
    2
    2
    86
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      saqib last edited by

      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 });
                                  });
                          },
      
      1 Reply Last reply Reply Quote 0
      • Rishabh-Webkul
        Rishabh-Webkul last edited by

        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

        1 Reply Last reply Reply Quote 0
        • First post
          Last post