我正在尝试将Channel Intelligence的跟踪标签添加到Magento商店,他们提供了告诉要填充哪些变量的代码,但我不知道如何添加特定于Magento的变量,但它应该对所有Magento网站都是一样的。我在网上搜索了一下,找不到任何参考资料,但这应该不那么困难。
有什么帮助吗?
以下是字段:
var CI_ItemIDs = new Array ('SKU123','SKU456');(SKU values)
var CI_ItemPrices = new Array('15.00','50.00');(current sale price of the products)
var CI_ItemAvailability = new Array('1','0'); (1=in stock, 0=out of stock,-‐1=no update,-‐2=limited availability,-‐3=backorder,-‐4=preorder)
var CI_OrderID = 'ORD123';
var CI_ItemIDs = new Array('SKU123','SKU456');
var CI_ItemQtys = new Array('1','3');
var CI_ItemPrices = new Array('15.00','50.00');
这取决于您需要值的位置,但假设您想将其放在产品详细信息页面中,您将编辑/app/design/frontend/yourtheme/catalog/product/view.phtml。在该页面的顶部,应该有这样的一行:
$_product = $this->getProduct();
然后使用 getData(),以便将 SKU 分配给渠道智能:
var CI_ItemIDs = new Array ('<?php echo $_product->getData('sku'); ?>');
我没有具体细节,但订单 ID 等的过程相同。