- Created by Ekaterina Slesarchik, last modified on 27-06-2023
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 2 Next »
Deployment Kit this is the insctruction to integrate Wizart Button less than 10 min, if you are tech specialist.
Deployment Kit have 2 main buttons:
Examples of buttons:
1. Floating button:
1. Entry-point button:
Please note that integrating the shopping cart will help you better understand the purpose of the visualizer and track user actions to assess the impact of the visualizer on conversion rates. You can view the technical implementation of the shopping cart here.
Floating button (fixed button on screen, good for main page of your website)
For successful integration of this button, you need to add several lines of JS-code to the place, where you would like to display the button.
If you don’t need context or locale parameters, we recommend you use first integration option.
First integration option:
<script type="application/javascript" src="https://d35so7k19vd0fx.cloudfront.net/production/integration/floating-button.min.js"></script> <script> const floatingButton = new window.WFloatingButton({ 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: '', }), }); floatingButton.render(); </script>
Please, note, that articleQuery
isn’t required. This parameter need only, if you want init collection and sku in PIM, because, if you have multi-collection (one product in several collections) and you want init that product in that collection, please, use articleQuery
, but if you don’t need this, remove it.
Parameter | Description | Type |
---|---|---|
token | api token - generated and issued by Wizart Administrator. | Required |
vendorCode | Unique SKU ID of the product uploaded to Wizart system. | Required |
articleQuery | If you want init collection and sku in PIM, e.x: that product in that collection. | Optional |
element | link to the element to insert the entry point button (e.g | Optional |
When you are rendering button, you can write next parameters to style your button:
If you want re-styled button, it will look like: floatingButton.render({title: "Your title", color: "#000"});
The set method can be used to set “vendorCode,” or “element”.
floatingButton.set({ vendorCode: '' }); floatingButton.set({ element: document.getElementById("0000")});
fontSize, title, tooltipTitle, tooltipPosition, tooltipDisable, glitterDisable, className, borderRadius, parameters, background, color, width, height, border, image, compact, tutorial, tutorialDelay, onloadCallback, onCloseCallback, onButtonClick, iframeElementSelector, insertIframeElementPosition, onAddShoppigCartItem, onRemoveShoppingCartItem,
Name of parameter | Description and Examples of using |
---|---|
| Font size of your button. |
| Text to be displayed on the button (the default value is "Try it in your room in one click!"). |
| Text to be displayed on the tooltip (the default value is "See it in your room!"). |
| Tooltip position towards the button. Available values are top, right, bottom, left (the default value is top). |
| If the value is “true”, the tooltip will not be displayed. Default: false. |
| If the value is “true”, glitter will not be displayed. |
| Class to be set for the button element on the page. Mostly, using to change more style, that our default parameters can’t (e.x. box-shadow). |
| Button border-radius. |
| Parameter value should be a result of the function |
| Button background. |
| Button text color. |
| Max button width. |
| Button height. |
| Style of button. For example: |
| Link to the icon that will be displayed on the button. |
| If the value is true, button will be displayed in the compact mode*. |
| If the value is true and compact is true, the button will be animated: from the compact to the full mode and then back to compact mode*. Animation repeats only once. |
| Period of time before the animation is activated. |
| The name of the function to be in the global scope. The function will be called when the visualizer is loaded. function wizartOnLoad() { console.log('Visualizer is loaded!'); } floatingButton.render({onloadCallback: "wizartOnLoad"});
|
| The name of the function to be in the global scope. The function will be called after the visualizer is closed. function wizartOnClosed() { console.log('Visualizer is closed!'); } floatingButton.render({onloadCallback: "wizartOnClosed"});
|
| The name of the function to be in the global scope. The function will be called when the button is cliecked. function wizartButtonClicked() { console.log('Button is clicked!'); } floatingButton.render({onloadCallback: "wizartButtonClicked"});
|
| A CSS selector to select an element on the page to insert the fitting room where you want. The best way to put iframe is “before body“. <body></body> floatingButton.render({iframeElementSelector: "body"});
|
| The insertion position of the element. Values: append, before, after. default value: append. The best way to put iframe is “before body“. <body></body> floatingButton.render({insertIframeElementPosition: "before"});
|
| The function is called on the event of adding an product to the cart. function wizartAddItemToCart() { console.log('Product is added!'); } floatingButton.render({onAddShoppigCartItem: "wizartAddItemToCart"});
|
| The function is called on the event of deleting an product to the cart. function wizartRemoveItemToCart() { console.log('Product is removed!'); } floatingButton.render({onRemoveShoppingCartItem: "wizartRemoveItemToCart"});
|
Shopping cart.
const onAddShoppigCartItem = (payload) => { console.log(payload); // { item: { vendor_code: 'vendor_code' }}; } //The set method can be used to set vendorCode or articleQuery. floatingButton.set({ vendorCode: '' }); floatingButton.set({ articleQuery: Json.stringify({ vendor_code: '' })}); //The setShoppingCartStore method allows you to set the current state of the shopping cart. floatingButton.setShoppingCartStore(payload); // payload format [{vendor_code: 'vendor_code', quantity: 1 }, ...]
const onRemoveShoppingCartItem = () => { console.log(payload); // { item: { vendor_code: 'vendor_code', removeAll: true }}; }
Parameters | Type | Description |
---|---|---|
user_id | string | User identifier or Device identifier |
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. |
compact mode*:
Second integration option:
<script class="wizart__floating-button" data-title="Custom button title" data-token="token" data-vendor_code="" data-article_query="" data-parameters="" data-background="" data-color="" data-image="" data-tooltip-title="" data-tooltip-position="" data-tooltip-disable="" data-glitter-disable="" data-width="" data-height="" data-border="" data-border_radius="" data-class_name="" data-compact="" data-tutorial="" data-tutorial-delay="" data-on-button-click="" data-element-selector="" data-insert-element-position="" data-iframe-element-selector="" data-insert-iframe-element-position="" src="https://d35so7k19vd0fx.cloudfront.net/production/integration/floating-button.min.js" ></script>
Name of parameter | Description and Examples of using |
---|---|
class | Required parameter. |
src | Link to js-file with integration code. |
data-token | api token - generated and issued by Wizart Administrator. |
data-title | Text to be displayed on the button (the default value is "Try it in your room in one click!"). |
data-vendor_code | Unique SKU ID of the product uploaded to Wizart system. |
data-article_query | Required in the case if parameter data-vendor_code is not enough for product search in the Wizart system. Parameter value should be a result of the function Please, note, that
|
data-background | Button background. |
data-color | Button text color. |
data-tooltip-disable | If the value is “true”, the tooltip will not be displayed. |
data-tooltip-title | Text to be displayed on the tooltip (the default value is "See it in your room!"). |
data-tooltip-position | Tooltip position towards the button. Available values are top, right, bottom, left (the default value is top). |
data-glitter-disable | If the value is “true”, glitter will not be displayed. |
data-width | Max button width. |
data-height | Button height. |
data-border | Style of button. For example: |
data-border_radius | Button border-radius. |
data-image | Link to the icon that will be displayed on the button. |
data-class_name | Class to be set for the button element on the page. Mostly, using to change more style, that our default parameters can’t (e.x. box-shadow). |
data-compact | If the value is true, button will be displayed in the compact mode*. |
data-tutorial | If the value is true and data-compact is true, the button will be animated: from the compact to the full mode and then back to compact mode* Animation repeats only once. |
data-tutorial-delay | Period of time before the animation is activated. |
data-parameters | Parameter value should be a result of the function |
data-onload-callback | The name of the function to be in the global scope. The function will be called when the visualizer is loaded. function wizartOnLoad() { console.log('Visualizer is loaded!'); } <script class="wizart__floating-button" data-token="token" data-onload-callback="wizartOnLoad" src="https://d35so7k19vd0fx.cloudfront.net/production/integration/floating-button.min.js"> </script>
|
data-on-close-callback | The name of the function to be in the global scope. The function will be called after the visualizer is closed. function wizartOnClosed() { console.log('Visualizer is closed!'); } <script class="wizart__floating-button" data-token="token" data-onload-callback="wizartOnClosed" src="https://d35so7k19vd0fx.cloudfront.net/production/integration/floating-button.min.js"> </script>
|
data-element-selector | A CSS selector to select an element on the page to insert a button where you want. <div id="shopping-cart">Add to cart</div> <script class="wizart__floating-button" data-token="token" data-element-selector="#shopping-cart" data-insert-element-position="after" src="https://d35so7k19vd0fx.cloudfront.net/production/integration/floating-button.min.js"> </script>
|
data-insert-element-position | A CSS selector to select an element on the page to insert a button where you want. <div id="shopping-cart">Add to cart</div> <script class="wizart__floating-button" data-token="token" data-element-selector="#shopping-cart" data-insert-element-position="after" src="https://d35so7k19vd0fx.cloudfront.net/production/integration/floating-button.min.js"> </script>
|
data-iframe-element-selector | A CSS selector to select an element on the page to insert the fitting room where you want. The best way to put iframe is “before body“. <body></body> <script class="wizart__floating-button" data-token="token" data-iframe-element-selector="body" src="https://d35so7k19vd0fx.cloudfront.net/production/integration/floating-button.min.js"> </script>
|
data-insert-iframe-element-position | The insertion position of the element. Values: append, before, after. default value: append. The best way to put iframe is “before body“. <body></body> <script class="wizart__floating-button" data-token="token" data-iframe-element-selector="body" data-insert-iframe-element-position="before" src="https://d35so7k19vd0fx.cloudfront.net/production/integration/floating-button.min.js"> </script>
|
Parameters | Type | Description |
---|---|---|
context | array | Need to indicate from which part of string in CSV file need to be get. |
locale | array | Need to indicate in which language product’s should be displayed. |
user_id | string | User identifier or Device identifier |
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. |
Shopping cart.
When the visualizer is open, methods are added to the window.wizartDK to synchronize the shopping cart.
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 methodconst payload = [{vendor_code: 'vendor_code1', quantity: 1 }]; window.wizartDK.setShoppingCartStore(payload);
The method is available after opening the visualizer.
Getting the current state of items in the shopping cart –
getShoppingCartStore
. To get the items in the shopping cart, call thegetShoppingCartStore
method with a callback function. The callback function will receive the items in the shopping cart. The method is available after opening the visualizer.const callback = () => { console.log(payload); // [{vendor_code: 'vendor_code1', quantity: 1}, ...] } window.wizartDK.getShoppingCartStore(callback);
Removing an item from the shopping cart –
onRemoveShoppingCartItem
. To get the goods when they are removed, you must call theonRemoveShoppingCartItem
method with a callback function. The method is available after opening the visualizer.const callback = () => { console.log(payload); // { vendor_code: 'vendor_code', removeAll: true } } window.wizartDK.onRemoveShoppingCartItem(callback);
Adding an item to the shopping cart –
onAddShoppigCartItem
. To add a product, you need to call theonAddShoppigCartItem
function with a parameter{ vendor_code: 'vendor_code' }
. The method is available after opening the visualizer.window.wizartDK.onAddShoppigCartItem({ vendor_code: 'vendor_code' });
compact mode*:
Entry-point button (button, that you can put whatever you want, good for the product page or category page)
For successful integration of this button, you need to add several lines of JS-code to the place, where you would like to display the button.
If you don’t need context or locale parameters, we recommend you use second integration option.
First integration option:
<script type="application/javascript" src="https://d35so7k19vd0fx.cloudfront.net/production/integration/entry-point.min.js"></script> <script> 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: '', }), }); entryPoint.render(); </script>
Please, note, that articleQuery
isn’t required. This parameter need only, if you want init collection and sku in PIM, because, if you have multi-collection (one product in several collections) and you want init that product in that collection, please, use articleQuery
, but if you don’t need this, remove it.
Parameter | Description | Type |
---|---|---|
token | api token - generated and issued by Wizart Administrator. | Required |
vendorCode | Unique SKU ID of the product uploaded to Wizart system. | Required |
articleQuery | If you want init collection and sku in PIM, e.x: that product in that collection. | Optional |
element | link to the element to insert the entry point button (e.g | Optional |
When you are rendering button, you can write next parameters to style your button:
If you want re-styled button, it will look like: entryPoint.render({title: "Your title", color: "#000"});
The set method can be used to set “vendorCode,” or “element”.
floatingButton.set({ vendorCode: '' }); floatingButton.set({ element: document.getElementById("0000")});
fontSize, title, tooltipTitle, tooltipPosition, tooltipDisable, glitterDisable, className, borderRadius, parameters, background, color, width, height, border, image, onloadCallback, onCloseCallback, onButtonClick, elementSelector, insertElementPosition, iframeElementSelector, insertIframeElementPosition, onAddShoppigCartItem, onRemoveShoppingCartItem,
Name of parameter | Description and Examples of using |
---|---|
| Font size of your button. |
| Text to be displayed on the button (the default value is "Try it in your room in one click!"). |
| Text to be displayed on the tooltip (the default value is "See it in your room!"). |
| Tooltip position towards the button. Available values are top, right, bottom, left (the default value is top). |
| If the value is “true”, the tooltip will not be displayed. Default: false. |
| If the value is “true”, glitter will not be displayed. |
| Class to be set for the button element on the page. Mostly, using to change more style, that our default parameters can’t (e.x. box-shadow). |
| Button border-radius. |
| Parameter value should be a result of the function |
| Button background. |
| Button text color. |
| Max button width. |
| Button height. |
| Style of button. For example: |
| Link to the icon that will be displayed on the button. |
| The name of the function to be in the global scope. The function will be called when the visualizer is loaded. function wizartOnLoad() { console.log('Visualizer is loaded!'); } entryPoint.render({onloadCallback: "wizartOnLoad"});
|
| The name of the function to be in the global scope. The function will be called after the visualizer is closed. function wizartOnClosed() { console.log('Visualizer is closed!'); } entryPoint.render({onloadCallback: "wizartOnClosed"});
|
| The name of the function to be in the global scope. The function will be called when the button is cliecked. function wizartButtonClicked() { console.log('Button is clicked!'); } entryPoint.render({onloadCallback: "wizartButtonClicked"});
|
| A CSS selector to select an element on the page to insert a button where you want. <div id="shopping-cart">Add to cart</div> entryPoint.render({elementSelector: "#shopping-cart", insertElementPosition: "after"});
|
| A CSS selector to select an element on the page to insert a button where you want. <div id="shopping-cart">Add to cart</div> entryPoint.render({elementSelector: "#shopping-cart", insertElementPosition: "after"});
|
| A CSS selector to select an element on the page to insert the fitting room where you want. The best way to put iframe is “before body“. <body></body> entryPoint.render({iframeElementSelector: "body"});
|
| The insertion position of the element. Values: append, before, after. default value: append. The best way to put iframe is “before body“. <body></body> entryPoint.render({insertIframeElementPosition: "before"});
|
| The function is called on the event of adding an product to the cart. function wizartAddItemToCart() { console.log('Product is added!'); } entryPoint.render({onAddShoppigCartItem: "wizartAddItemToCart"});
|
| The function is called on the event of deleting an product to the cart. function wizartRemoveItemToCart() { console.log('Product is removed!'); } entryPoint.render({onRemoveShoppingCartItem: "wizartRemoveItemToCart"});
|
Shopping cart.
const onAddShoppigCartItem = (payload) => { console.log(payload); // { item: { vendor_code: 'vendor_code' }}; } //The set method can be used to set vendorCode or articleQuery. entryPoint.set({ vendorCode: '' }); entryPoint.set({ articleQuery: Json.stringify({ vendor_code: '' })}); //The setShoppingCartStore method allows you to set the current state of the shopping cart. entryPoint.setShoppingCartStore(payload); // payload format [{vendor_code: 'vendor_code', quantity: 1 }, ...]
const onRemoveShoppingCartItem = () => { console.log(payload); // { item: { vendor_code: 'vendor_code', removeAll: true }}; }
Parameters | Type | Description |
---|---|---|
user_id | string | User identifier or Device identifier |
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. |
Second integration option:
<script class="wizart__entry-point" data-token="token" data-title="" data-vendor_code="" data-article_query="" data-parameters="" data-image="" data-color="" data-background="" data-tooltip-title="" data-tooltip-position="" data-tooltip-disable="" data-glitter-disable="" data-width="" data-height="" data-border="" data-border_radius="" data-class_name="" data-onload-callback="" data-on-close-callback="" data-on-button-click="" data-element-selector="" data-insert-element-position="" data-iframe-element-selector="" data-insert-iframe-element-position="" src="https://d35so7k19vd0fx.cloudfront.net/production/integration/entry-point.min.js" ></script>
Name of parameter | Description and Examples of using |
---|---|
class | Required parameter. |
src | Link to js-file with integration code. |
data-token | api token - generated and issued by Wizart Administrator. |
data-title | Text to be displayed on the button (the default value is "Try it in your room in one click!"). |
data-vendor_code | Unique SKU ID of the product uploaded to Wizart system. |
data-article_query | Required in the case if parameter data-vendor_code is not enough for product search in the Wizart system. Parameter value should be a result of the function Please, note, that
|
data-background | Button background. |
data-color | Button text color. |
data-tooltip-disable | If the value is “true”, the tooltip will not be displayed. |
data-tooltip-title | Text to be displayed on the tooltip (the default value is "See it in your room!"). |
data-tooltip-position | Tooltip position towards the button. Available values are top, right, bottom, left (the default value is top). |
data-glitter-disable | If the value is “true”, glitter will not be displayed. |
data-width | Max button width. |
data-height | Button height. |
data-border | Style of button. For example: |
data-border_radius | Button border-radius. |
data-image | Link to the icon that will be displayed on the button. |
data-class_name | Class to be set for the button element on the page. Mostly, using to change more style, that our default parameters can’t (e.x. box-shadow). |
data-parameters | Parameter value should be a result of the function |
data-onload-callback | The name of the function to be in the global scope. The function will be called when the visualizer is loaded. function wizartOnLoad() { console.log('Visualizer is loaded!'); } <script class="wizart__entry-point" data-token="token" data-onload-callback="wizartOnLoad" src="https://d35so7k19vd0fx.cloudfront.net/production/integration/floating-button.min.js"> </script>
|
data-on-close-callback | The name of the function to be in the global scope. The function will be called after the visualizer is closed. function wizartOnClosed() { console.log('Visualizer is closed!'); } <script class="wizart__entry-point" data-token="token" data-onload-callback="wizartOnClosed" src="https://d35so7k19vd0fx.cloudfront.net/production/integration/floating-button.min.js"> </script>
|
data-element-selector | A CSS selector to select an element on the page to insert a button where you want. <div id="shopping-cart">Add to cart</div> <script class="wizart__entry-point" data-token="token" data-element-selector="#shopping-cart" data-insert-element-position="after" src="https://d35so7k19vd0fx.cloudfront.net/production/integration/floating-button.min.js"> </script>
|
data-insert-element-position | A CSS selector to select an element on the page to insert a button where you want. <div id="shopping-cart">Add to cart</div> <script class="wizart__entry-point" data-token="token" data-element-selector="#shopping-cart" data-insert-element-position="after" src="https://d35so7k19vd0fx.cloudfront.net/production/integration/floating-button.min.js"> </script>
|
data-iframe-element-selector | A CSS selector to select an element on the page to insert the fitting room where you want. The best way to put iframe is “before body“. <body></body> <script class="wizart__entry-point" data-token="token" data-iframe-element-selector="body" src="https://d35so7k19vd0fx.cloudfront.net/production/integration/floating-button.min.js"> </script>
|
data-insert-iframe-element-position | The insertion position of the element. Values: append, before, after. default value: append. The best way to put iframe is “before body“. <body></body> <script class="wizart__entry-point" data-token="token" data-iframe-element-selector="body" data-insert-iframe-element-position="before" src="https://d35so7k19vd0fx.cloudfront.net/production/integration/floating-button.min.js"> </script>
|
Parameters | Type | Description |
---|---|---|
context | array | Need to indicate from which part of string in CSV file need to be get. |
locale | array | Need to indicate in which language product’s should be displayed. |
user_id | string | User identifier or Device identifier |
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. |
Shopping cart.
When the visualizer is open, methods are added to the window.wizartDK to synchronize the shopping cart.
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 methodconst payload = [{vendor_code: 'vendor_code1', quantity: 1 }]; window.wizartDK.setShoppingCartStore(payload);
The method is available after opening the visualizer.
Getting the current state of items in the shopping cart –
getShoppingCartStore
. To get the items in the shopping cart, call thegetShoppingCartStore
method with a callback function. The callback function will receive the items in the shopping cart. The method is available after opening the visualizer.const callback = () => { console.log(payload); // [{vendor_code: 'vendor_code1', quantity: 1}, ...] } window.wizartDK.getShoppingCartStore(callback);
Removing an items from the shopping cart –
onRemoveShoppingCartItem
. To get the goods when they are removed, you must call theonRemoveShoppingCartItem
method with a callback function. The method is available after opening the visualizer.const callback = () => { console.log(payload); // { vendor_code: 'vendor_code', removeAll: true } } window.wizartDK.onRemoveShoppingCartItem(callback);
Adding an item to the shopping cart –
onAddShoppigCartItem
. To add a product, you need to call theonAddShoppigCartItem
function with a parameter{ vendor_code: 'vendor_code' }
. The method is available after opening the visualizer.window.wizartDK.onAddShoppigCartItem({ vendor_code: 'vendor_code' });
- No labels