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:

Get rid of ?__store=default from your Magento links

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

If you’re like me, you make use of a lot of widget links within Magento, and those Widget links have a pesky habit of adding ?___store=default to the end of your URLs, which first of all don’t look nice and it certainly doesn’t help your optimisation efforts when it comes to SEO and ridding yourself of duplicate content.

This is a dead simple fix, and gives you peace of mind.

Simply copy the follow file: app/code/core/Mage/Catalog/Block/Widget/Link.php and paste it into app/code/local/Magento/Catalog/Block/Widget/Link.php

Then lines 89 – 92 need to be commented out. These lines look like this: (if it changes in future versions!)

Hiding (or Showing) Filters In Certain Categories

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

Layered Navigation Plus and Layered Navigation Positioning extensions, you can easily hide or show individual filters in certain categories. Here is how:

  1. Open category in which you’d like to hide certain filter.
  2. Go to “Custom Design” tab.
  3. In “Custom Layout Update” field, add: 
    <reference name=”mana.catalog.above_products.nav“>
    <action method=”setHideCategory“><value>1</value></action>
    </reference>

ADD INCREASE AND DECREASE QUANTITY BUTTONS TO ITEMS IN MAGENTO CART

Share
Posted on April 22nd, 2013 | Posted by admin

When a customer views their cart, each product that they have added will be listed. By default, Magento provides info for each product, e.g. name, image, quantity, price. Customers can change the quantity in the text box and submit the “Update Shopping Cart” button. That is a lot of effort for the user, we want to make this process as smooth as possible.

We can make it easier by adding +1 and -1 links to change the quantity of each item. We will do this with some very simple JavaScript which takes the current value and adjusts it. Once this has been done, we submit the form through JavaScript to reduce customer effort.

In my implementation I have used images for the links, but obviously you could use text, e.g (↑ ↓). The following two code snippets should surround the input quantity box on the shopping cart/basket page:

Page 3 of 16«12345»10...Last »