Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Additional parameters for “data-parameters” attribute

Anchor
additional-parameters
additional-parameters

Parameters

Type

Description

user_id

string

User identifier or Device identifier

context

array

main_page_link

string

Link added to your clickable logo.

open_first_room

bool 1/0

Skipping step a room selection and open any first room

room_uuid

string

The room with the selected uuid will be opened

deactivate_custom_photo

bool 1/0

For deactivating uploading photo.

...

Two-way shopping cart synchronization:

Anchor
two-way-sync
two-way-sync

When the visualizer is open, methods are added to the window.wizartDK to synchronize the shopping cart.

  1. Setting the current state of items in the shopping cart – setShoppingCartStore. To transfer the current state of the shopping cart to the visualizer, call the method

    Code Block
    languagejs
    const payload = [{vendor_code: 'vendor_code1', quantity: 1 }];
    window.wizartDK.setShoppingCartStore(payload);

    The method is available after opening the visualizer.

  2. Getting the current state of items in the shopping cart – getShoppingCartStore. To get the items in the shopping cart, call the getShoppingCartStore method with a callback function. The callback function will receive the items in the shopping cart. The method is available after opening the visualizer.

    Code Block
    languagejs
    const callback = () => {
      console.log(payload);
      // [{vendor_code: 'vendor_code1', quantity: 1}, ...]
    }
    
    window.wizartDK.getShoppingCartStore(callback);
  3. Removing an items from the shopping cart – onRemoveShoppingCartItem. To get the goods when they are removed, you must call the onRemoveShoppingCartItem method with a callback function. The method is available after opening the visualizer.

    Code Block
    languagejs
    const callback = () => {
      console.log(payload);
      // {  vendor_code: 'vendor_code', removeAll: true }
    }
    
    window.wizartDK.onRemoveShoppingCartItem(callback);
  4. Adding an item to the shopping cart – onAddShoppigCartItem. To add a product, you need to call the onAddShoppigCartItem function with a parameter { vendor_code: 'vendor_code' } . The method is available after opening the visualizer.

    Code Block
    window.wizartDK.onAddShoppigCartItem({ vendor_code: 'vendor_code' });

Second integration option:

...