magento - Adding the Attribute Set name to Google analytics Ga.php? -
magento - Adding the Attribute Set name to Google analytics Ga.php? -
i'm trying add together name of attribute set analytics reports in file /www/app/code/local/mage/googleanalytics/block/ga.php.
this code using isn't right , maintain getting blank page on magento success page:
$attributesetname = null; $attributesetname = mage::getmodel('eav/entity_attribute_set')->load($_product->getattributesetid())->getattributesetname(); foreach ($order->getallvisibleitems() $item) { $result[] = sprintf("_gaq.push(['_additem', '%s', '%s', '%s', '%s', '%s', '%s']);", $order->getincrementid(), $this->jsquoteescape($item->getsku()), $this->jsquoteescape($item->getname()), $attributesetname, $item->getbaseprice(), $item->getqtyordered() ); }
$_product
seem undefined
try
foreach ($order->getallvisibleitems() $item) { $_product = mage::getmodel('catalog/product')->load($item->getproductid()); $attributesetname = mage::getmodel('eav/entity_attribute_set')->load($_product->getattributesetid())->getattributesetname(); $result[] = sprintf("_gaq.push(['_additem', '%s', '%s', '%s', '%s', '%s', '%s']);", $order->getincrementid(), $this->jsquoteescape($item->getsku()), $this->jsquoteescape($item->getname()), $this->jsquoteescape($attributesetname), $item->getbaseprice(), $item->getqtyordered() ); }
magento google-analytics
Comments
Post a Comment