Versions Compared

Key

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

...

Additional parameters for “data-parameters” attribute

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

Two-way shopping cart synchronization:

...

Code Block
languagejs
<script type="application/javascript" src="https://wizart-files.fra1.cdn.digitaloceanspaces.com/production/integration/entry-point.min.js"></script>
Tip

To initialize the button, you need to call this code with a token, element and vendor code or article query:

Code Block
languagejs
const entryPoint = new window.WEntryPoint({
  token: "your token for wizart",
  element: "link to the element to insert the entry point button", // example document.getElementById("0000")
  vendorCode: "vendor code for first apply",
  articleQuery: Json.stringify({
    vendor_code: 'vendor code for first apply',
    collection_name: '',
  }),
});

Parameter

Description

Type

token

api token - generated and issued by Wizart Administrator.

Required

element

link to the element to insert the entry point button (e.g
document.getElementsByTagName("")[0])

Optional

vendorCode

Unique SKU ID of the product uploaded to Wizart system.

Optional

articleQuery

vendor_code (unique SKU ID of the product uploaded to Wizart system)
collection_name (name of collection)

Optional

Info

Element articleQuery takes precedence over element vendorCode.

Tip

To display the button, you need to call the render method.

Code Block
languagejs
entryPoint.render();

...

Code Block
  fontSize,
  title,
  tooltipTitle,
  tooltipPosition,
  tooltipDisable,
  glitterDisable,
  className,
  borderRadius,
  parameters,
  background,
  color,
  width,
  height,
  border,
  image,
  onloadCallback,
  onCloseCallback,
  onButtonClick,
  elementSelector,
  insertElementPosition,
  iframeElementSelector,
  insertIframeElementPosition,
  onAddShoppigCartItem, // the function is called on the event of adding an article to the cart
  onRemoveShoppingCartItem, // the function is called on the event of deleting an article to the cart
Info

Description of this parameters you can find in the block of first integration.

Info

Parameters should write following this structure:
entryPoint.render({fontSize: '12px', title:'Custom title'});

Code Block
languagejs

const onAddShoppigCartItem = (payload) => {
  console.log(payload);
  // { item: { vendor_code: 'vendor_code' }};
}

const onRemoveShoppingCartItem = () => {
  console.log(payload);
  // { item: { vendor_code: 'vendor_code', removeAll: true }};
}

Info

The set method can be used to set vendorCode or articleQuery.

Code Block
languagejs
entryPoint.set({ vendorCode: '' });
entryPoint.set({ articleQuery: Json.stringify({ vendor_code: '' })});

...