Magento Themes and Magento Extensions

Log all SQL queries in Magento

Share
Posted on May 17th, 2013 | Posted by admin

In Varien_Db_Adapter_Pdo_Mysql

Magento : lib/varien/Db/Adapter/Pdo/Mysql.php
set
protected $_debug = true;
protected $_logAllQueries = true;

and (if nor already there) create the folder defined in

protected $_debugFile = ‘var/debug/sql.txt’;

Give read / write permission

Magento: Programmatically Modify Attribute Configuration

Share
Posted on May 16th, 2013 | Posted by admin

Magento: Programmatically Modify Attribute Configuration

I was asked programmatically modify a product attribute so that it was no longer searchable, and make a different attribute searchable instead. I wrote up the code and put it on our database updater module to run as an upgrade script, but you could put it anywhere you want. To modify an attribute, you can do the following:

How to Debug Magento

Share
Posted on May 9th, 2013 | Posted by admin

You can add your own debugging code pool in addition to core, community and local. This is what Magento team uses foe debugging.

require_once $mageFilename;
if($_SERVER['REMOTE_ADDR']==’MY_IP’){
$debuPath = BP . DS. ‘app’ . DS . ‘code’ . DS . ‘debug’;
set_include_path($debugPath . PS . get_include_path());
}

About Integrity constraint violation: 1062 Duplicate entry PROBLEM

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

I moved my one MAGENTO site from test side to the live side.

But when we did test for the website, we were trying to add some item to the shopping bag, but we got the message said:

Integrity constraint violation: 1062 Duplicate entry ’6′ for key 1

After some research, here is solution:

Go to PHPMyAdmin, find out all tables like Log_*,

Delete all the contents in Log_* except the Log_Summary_type one.

How To Setup Google Adwords Conversion Tracking On Magento

Share
Posted on May 5th, 2013 | Posted by admin

Setting up Google Adwords Conversion Tracking on your Magento store

1. Open this file:
/app/design/frontend/default/yourskinname/template/checkout/success.phtml

2. At the bottom of the file, insert this code:

1
2
3
4
    <?php
    $order_details = Mage::getModel(’sales/order’)->loadByIncrementId(Mage::getSingleton(‘checkout/session’)->getLastRealOrderId());
    $adwords_saleamt = $order_details->subtotal;
    ?>

3. Login to your Google Adwords account

Page 10 of 22« First...«89101112»20...Last »