Magento themes and extensions

Showing Real Magento Inventory Amounts

Share
Posted on February 28th, 2013 | Posted by admin

So I was working on a project recently where I had to display the inventory amounts in Magento.  Easy, Right? Normally you’d just add this line of code:

<?php

$__invAmt = (int)Mage::getModel(‘cataloginventory/stock_item’)->loadByProduct($_product)->getQty();

echo $this->__(“$__invAmt Available in Stock”);

?>

However, if you are using the additional Magento inventory control such as “QTY for item’s status to become out of stock”, you’ll have to add a couple additional lines to make sure you’re showing the correct numbers.  Here’s my updated code:

Magento: Export Customers List as Google Spreadsheet Document

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

Magento: Export Customers List as Google Spreadsheet Document
How to export customers list as Google Spreadsheet document.
Please download the attached file as upload to your Google Docs.

Have Your Magento Caches Update Themselves

Share
Posted on February 26th, 2013 | Posted by admin

Magento has a lot of caches. They are (in my opinion) the biggest reason Magento is usable as a platform (If you think Magento runs slowly now – turn them off for a little bit).

One thing that I as a programmer find odd is that the caches in Magento are intelligent enough to flag themselves as invalidated, however they generally require that they be refreshed by hand. This can be especially irritating when you are running Magento Enterprise Edition and your full page cache is constantly being invalidated due to product and category updates.

In order to improve our site performance I wanted to find a practical way to run with the full page cache on all the time without requiring me to babysit it 24 hours a day. I figured I had to find the code that was triggered when you told the admin panel to update the cache.

Get current category or product model in Magento

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

How to get the current category or product model?

You may use the magento registry class like this:

//Get current category or product
Mage::registry('current_category');
Mage::registry('current_product');

Import Configurable Products in Magento

Share
Posted on February 23rd, 2013 | Posted by admin

Import Configurable Products in Magento
Importing Configurable Products is another great feature that comes with Magmi, but it can be a bit confusing for some, due to configurable and simple product having different columns and column count.

Start by creating a configurable product manually via the admin to assure that the super attribute and simple product relations are set-up correctly and working. After you successfully created a configurable product to go by, you can start with your configurable product spreadsheet, which requires less column headers due to most coming from the simple products. In a duplicated version of the simple products spreadsheet, cut down the values to the following (but do leave the columns you may require, such as page layout or custom designs if you intend to use them):

Page 1 of 3123»