How to Enable Google Analytics Ecommerce Tracking

How to enable Google Analytics Ecommerce Tracking Login to google analytics Account In Google Analytics Click on Admin In Left side Account panel select account In Middle Panel Select Property for which you want to enable google analytics ecommerce tracking In Third Panel Select View for which you want to enable google analytics ecommerce tracking Click on view settings Click

Read more

Ubuntu magento cron setup

Check whether crontab is installed or not ? –> you can check same by fire command to command line crontab -e if you see result of crontab -e command then it is working otherwise you have to install cron service. –> If cron service is not installed you can install it by command sudo apt-get install cron Now we need

Read more

magento search category name

Magento how to get category collection by name ? For example here we will get category by it name $category = Mage::getModel(“catalog/category”); $collection = $category->getCollection(); $collection->addAttributeToSelect(“*”); $collection->addFieldToFilter(“name”,array(“eq”=>’test’); The above code will fetch all category named “test”.

Read more

Magento get product by attribute

For example here we will product by it name   $collectionss = Mage::getModel(‘catalog/product’)->getCollection()->addAttributeToSelect(‘*’)->addUrlRewrite(); $collectionss->addFieldToFilter(array( array(‘attribute’=>’name’,’eq’=>’test’), )) Get Product By Id $_newProduct = Mage::getModel(‘catalog/product’)->load($id);

Read more

magento add product to cart

require_once ‘app/Mage.php’; Mage::app(“default”); Mage::getSingleton(“core/session”, array(“name” => “frontend”)); $session = Mage::getSingleton(“customer/session”); $userData=Mage::helper(‘customer’)->getCustomer()->getData(); $cart = Mage::getSingleton(‘checkout/cart’); $yourProId=7; $qty=2; $params = array( ‘product’ => $yourProId, ‘related_product’ => null, ‘qty’ => $qty ); $product = new Mage_Catalog_Model_Product(); $product->load($yourProId); $cart-> addProduct($product, $params); $cart->save(); Mage::getSingleton(‘checkout/session’)->setCartWasUpdated(true); $message = (‘Your cart has been updated successfully.’); Mage::getSingleton(‘checkout/session’)->addSuccess($message);

Read more

magento soap api check product exist or not

In magento there is soap and xml rpc api  catalog_product.info which will retrive product based on SKU or Product ID.But which will only works well when there is poduct available otherwise it will generate exception. So how to check if product is exist or not Bellow given code works when the product is exist or not. $proxy = new SoapClient(‘http://magentohost/api/soap/?wsdl’);

Read more