Magento Analytics Conversion Tracking

Share
Posted on April 19th, 2013 | Posted by admin

Magento Analytics Conversion Tracking
When you do e-commerce sites it’s pretty obvious how to track your conversions – they will appear in sales in the Dashboard! However, sometimes you also get asked to add Google Analytics conversion tracking code just because the client wants all their statistics in one place. So the analytics guy will send through a request asking you to place a specific piece of code on the successful transaction ‘Thank You’ page.

Very easy to do. You need to add an new before_body_end block in the one_page_checkout_success section of checkout.xml in your layouts folder.

Magento – Editing phtml Files in Dreamweaver

Share
Posted on April 11th, 2013 | Posted by admin

Magento - Editing phtml Files in Dreamweaver

Its only recently that we came across a post which has now brought me a lot of joy to our lives and made it a lot easier on the eyes. Natively dreamweaver does not recognise phtml files and so you end up living in a black and white world, which is ok except you feel like you’ve been living in a 1950′s sid com for the last few years. However help is finally at hand and now you can finally see phtml files for what they really are and we’re going to show you how to achieve the same.
First of all since we’re all on PC’s, the fix described is only for windows based computers. But if you do need a fix for windows you can find the fix here.

  • Step One

Documents and Settings > [user] > Application Data > Adobe Dreamweaver > Configuration > extensions.txt
Change the top line and add the PHTML
HTM,HTML,SHTM,SHTML, … ,TXT,PHP,PHP3,PHP4,PHP5,PHTML,JSP,WML,TPL, … ,MASTER:All Documents
And then change the third line down to look like
PHP,PHP3,PHP4,PHP5,TPL,PHTML:PHP Files

Add Linkshare Pixel To Magento

Share
Posted on April 8th, 2013 | Posted by admin

Add Linkshare Pixel To Magento
Add this code to:
\app\design\frontend\enterprise\<your theme>\template\checkout\success.phtml

<?php

$order_id = Mage::getSingleton('checkout/session')->getLastOrderId();
$order = Mage::getModel('sales/order')->load($order_id);
$_totalData = $order->getData();

/*linkshare vars*/
$skus = array();
$qtys = array();
$amounts = array();

foreach ($order->getAllItems() as $item) {

        $skus[$item->getProductId()] = $item->getSku();
	$names[$item->getProductId()] = rawurlencode($item->getName());
	$qtys[$item->getProductId()] = $item->getQtyOrdered() * 1;
	$amounts[$item->getProductId()] = $item->getRowTotal() * 100;
}

$order_id = $_totalData['increment_id'];

Magento: Show Success, Error or notice message

Share
Posted on April 7th, 2013 | Posted by admin

If you want to show a success message or an error message in your custom module or in anything else in magento, we can use the addSuccess() and addError() functions. These functions show the respective messages in the magento format. You don’t have to build a seperate markup for you custom module messages you can use the magento default html for showing messages using the 2 functions.

Showing messages on the frontend

$message = 'Your message ... ';
Mage::getSingleton('core/session')->addError($message);
Mage::getSingleton('core/session')->addSuccess($message);

Setting A Global Variable In Magento – The GUI Way?

Share
Posted on April 6th, 2013 | Posted by admin

I’ve recently started using Magento for a client’s webshop, and still need to get to grips with its systems. The webshop should have several links to and also grab info from another domain, where the corporate website is located. I would prefer not to hardcode the domain name or URL but instead define it at some place and use that value in the phtml templates throughout the webshop. This makes it easy to adjust it when we move the site between dev, staging and production URL’s.

we could add a field to the Store’s Config GUI in the backend, similar to the way the {{base_url}} is set. Or maybe I’m thinking the wrong way?

Page 1 of 6012345»102030...Last »