[value-name]
, vpon will provide value detail and example* install position: in all "add to card" button click function
* ref:
item_name: product name, value type: string
item_price: product price, like 10.00, value type: number (int or float)
currency: currency of item price represent in ISO 4217 currency code form, please reference to https://en.wikipedia.org/wiki/ISO_4217#Activecodes
* example:
Vpadn("add_to_cart",{
"item_name": "Scoop Back Skater Dress",
"item_price": 10.00,
"currency": "TWD"
});
* code:
----------------------
<script>
//----- !!NOTE!! all [] value should be replaced with actually value ------
Vpadn("add_to_cart",{
"item_name": [item_name],
"item_price": [item_price],
"currency": [currency]
});
</script>
-----------------------
This is an example page, the original content is as below:
<!DOCTYPE html>
<html>
<head>
...
</head>
<body>
<!-- part of your html content here -->
<!-- an example button -->
<a href="http://www.somedomain.com/shopcart">add to cart</a>
<!-- part of your html content here -->
</body>
</html>
Modified example page:
<!DOCTYPE html>
<html>
<head>
...
<!-- base code content here -->
</head>
<body>
<!-- part of your html content here -->
<!-- an example button -->
<a onclick="onAddToCartClick();">add to cart</a>
<script>
function onAboutClick(){
//vpon event code
//fill in data of current viewing product
Vpadn("add_to_cart",{
"item_name": "Lace Up Midi Dress",
"item_price": 16.00,
"currency": "USD"
});
//go to link page after a short timeout
setTimeout( function(){
location.href = "http://www.somedomain.com/shopcart";
}, 700);
}
</script>
<!-- part of your html content here -->
</body>
</html>