fix
This commit is contained in:
@@ -69,18 +69,21 @@ const currency = new Intl.NumberFormat("pt-BR", {
|
|||||||
|
|
||||||
target.disabled = true;
|
target.disabled = true;
|
||||||
|
|
||||||
|
window.dataLayer?.push({ ecommerce: null }); // Clear the previous ecommerce object.
|
||||||
window.dataLayer?.push({
|
window.dataLayer?.push({
|
||||||
event: "add_to_cart",
|
event: "add_to_cart",
|
||||||
currency: "BRL",
|
ecommerce: {
|
||||||
value: parseFloat(unit_price),
|
currency: "BRL",
|
||||||
items: [
|
value: parseFloat(unit_price),
|
||||||
{
|
items: [
|
||||||
item_id: id,
|
{
|
||||||
item_name: name,
|
item_id: id,
|
||||||
price: parseFloat(unit_price),
|
item_name: name,
|
||||||
quantity: 1,
|
price: parseFloat(unit_price),
|
||||||
},
|
quantity: 1,
|
||||||
],
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const r = await checkout(item);
|
const r = await checkout(item);
|
||||||
|
|||||||
Reference in New Issue
Block a user