To get viabill pricetags on your webshop, you need to insert a few code snippets.
- DIV elements used as a container for the actual pricetag (typically placed below the price of the item).
Please take a look at the code example here.
TIP You can open the file with notepad, if you do not have an editor for viewing source code.
In the code there find the following line of code:
$request['token'] = "PutYourMerchantTokenHere";
Replace the value with your merchant token found under Integration settings in our admin portal.
To verify that it work you can try and create a pricetag DIV element explained further down.
The pricetag DIV element contains the following attributes:
||Indicate pricetag type|
|data-price||10,00 , 10.00||Indicate price with a “,” or a “.”|
|data-dynamic-price||Query selector||A Query selector for the element that contains the price of the product.|
|data-dynamic-price-triggers||Query selector||If the price is variable then it is possible to trigger an vb-update-price event.|
If the “data-price” attribute is set the dynamic attributes are ignored.
<div class='viabill-pricetag' data-view='product' data-price='42'></div>
A pricetag with dynamic attributes could look like this:
<div class='viabill-pricetag' data-view="list" data-dynamic-price=".productpreview|.price" data-dynamic-price-triggers="#webshop_content .filters input"></div>
The two DIV elements above will yield a pricetag which look like this:
To get one of the below pricetags, change the data-view attribute on the DIV element.