/*
window.dataLayer = window.dataLayer || [];
var cartItems = [];
var productElements = document.querySelectorAll('li[data-hook="CartItemsDataHook.item"]');
var Tprice= document.querySelector('dd[data-hook="Total.formattedValue"]');
if(Tprice)
{var priceTotal = Tprice.innerText.split("$")[1];}
else { var priceTotal=0;}
productElements.forEach(function(productElement) {
// Use productElement to scope the querySelector for each product
var productName = productElement.querySelector('p[data-hook="CartItemDataHook.name"]').innerText; //working
// Get the price element from within the current productElement
var priceText = productElement.querySelector('span[data-hook="CartItemDataHook.price"]').innerText.trim(); // working
var price = parseFloat(priceText.replace('$', ''));
// Fetch the quantity
var quantity = parseFloat(productElement.querySelector('input[aria-label="Choose quantity"]').value);
var totalPrice = price * quantity;
var items = {
item_id: productName.replace(/\s/g, "_"), // Replacing spaces with underscores
item_name: productName,
item_category: productName.split(" ")[0],
price: totalPrice,
quantity: quantity
};
cartItems.push(items);
});
console.log("Cart details:", cartItems);
console.log("Pushing cartPageView to adobeDataLayer...");
window.dataLayer = window.dataLayer || [];
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
dataLayer.push({
event: "add_to_cart",
ecommerce: {
currency: "USD",
value: priceTotal,
items: cartItems
}
});
*/
top of page
Address
500 Terry Francine St.
San Francisco, CA 94158
Contact
Opening Hours
bottom of page