Buddi SEO Documentation
Home
Return to Buddi.io
Home
Return to Buddi.io
  • Getting Started

    • Installation Guide
  • Functions

    • Store Selection
    • Single Product
    • All Products
    • Products by Category
    • Products by Categories
    • Featured Promotions
    • Collections
    • Store Info
    • Add to Cart
    • Content Management System
  • Modules

    • Shopping Cart Module
    • Customer Profile
  • Advanced Functions

    • Dynamic object syncing
    • Cart
    • Customer
    • Login Customer
    • Logout Customer
    • Register Customer
    • Update Customer
  • Events
  • FAQ
  • Exceptions Handling
  • Caching
  • Deploying
  • Example Templates

Dynamic object syncing

Customer

In your app you can easily sync internal Buddi.customer object with a local var to be able to find out when a customer is logged in and get the customer details.

For example if you’re using VueJS you can easily do it like this:

new Vue({
    el: '#app',

    data: {
      customer: Buddi.customer,
    },

    beforeUnmount() {
      Buddi.$off('customer:updated', 'customerUpdatedEvent');
    },

    created() {
      Buddi.$on('customer:updated', customer => {
          this.customer = {...customer};
      }, 'customerUpdatedEvent');
    },
...
});

Now every time when the main Buddi module changes the customer object, the object will also be changed in your app.

Cart

In your app you can sync Buddi.cart object with a local var to be able to find out the products counts in the cart, totals, etc.

For example if you’re using VueJS you can easily do it like this:

new Vue({
    el: '#app',

    data: {
      cart: Buddi.cart,
    },

    beforeUnmount() {
      Buddi.$off('cart:updated', 'cartUpdatedEvent');
    },

    created() {
      Buddi.$on('cart:updated', cart => {
          this.cart = {...cart};
      }, 'cartUpdatedEvent');
    },
...
});

Now every time when the main Buddi module changes the cart object, the object will also be changed in your app.

Last Updated: 10/6/25, 10:32 PM
Contributors: jesseleejohnston
Next
Cart