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

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -