Magento themes and extensions

MAGENTO DROPDOWN ATTRIBUTES

Share
Posted on January 29th, 2013 | Posted by admin

Let’s say you want to create a new attribute for a product,  ‘color’.
There should be a set of possible values for this attribute. So what you do is create
an attribute of ‘Dropdown’ type. You set all its properties, give it a title and create its options, e.g. ‘black’, ‘white’, ‘red’ and ‘yellow’.
But there is still one surprise that you may have. When you try to obtain the color simply by:

$product->getColor()

all you get is a numeric value corresponding to an option value in the dropdown.
But you probably would like to get a color name.
Fortunately you don’t need to construct database queries, as Magento already thought about it.

Magento: How to fix template path errors when using symlinks

Share
Posted on January 27th, 2013 | Posted by admin

When working on projects, you might find it useful to keep the custom code in a separate directory, and create symlinks in the Magento directory. This makes it easier to have version control and to keep tidy the Magento base directory.

A custom project directory looks something like this:

myproject/app/etc/modules
myproject/app/design/frontend/default/mytheme
myproject/app/code/local

To install a custom front-end theme, I will just create a symbolic link in the appropriate directory, e.g.:

Magento – Upgrade to the latest version using Magento Connect

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

Upgrading Magento to the latest version is a fairly simple task. Copy and Paste this key below VIA Magento Connect where it states “Paste extension key to install:”. This will upgrade Magento to the newest version.

magento-core/Mage_All_Latest

magento trace code from xml to template

Share
Posted on January 24th, 2013 | Posted by admin

I have beed doing this for quite some time. So i thought lets write it down on the blog as well, so that it is more clear for any one starting with magento. Here is the thing in magento once the control reaches the xml, it finds the corresponding template files to render. So suppose you are on the sales order view page in the admin. So the corresponding xml is lets say sales.xml. Now there will be a block written like this.

<block type=”adminhtml/template” name=”gift_options” template=”sales/order/giftoptions.phtml”>

Now i will explain what each element means here.

First “adminhtml/template” this means that the related block which will call this xml is adminhtml/template, so go to the app/code/core/Mage/Adminhtml/Block/Template.php. The file Template.php is what the block refers to for the functions in the template file “giftoptions.phtml”. Please note that i have highlighted the elements in bold in the path which are used to trace the code.

How to mass update your Magento SKUs

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

We recently worked on a project where we needed to update all of the simple product’s SKUs on a pretty large site. It turned out there were just under 1000 SKUs that needed updated. The reason for needing to change all of the SKUs was to make an integration with an external supply chain management software called BlueCherry. In order to easily update BlueCherry with correct stock, we needed a way to match up items. It would be great to just do a mass export and then mass import to update the SKUs, but since Magento uses the SKU as its unique identifier on import/export we had to find an alternative method.

So, instead of going into each simple product individually, I quickly went to the Magento Community forum and tried to find an answer.

Page 1 of 41234»