Magento Themes and Magento Extensions

Create a custom category attribute in Magento

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

Create a custom category attribute in Magento
Copy and paste the following code in your header.phtml

How to get custom attributes value in Magento Frontend

Share
Posted on March 21st, 2013 | Posted by admin

In Magento, you can create unlimited number of custom attributes to show different type of information about your product. These attributes can be different type as Text Field, Text Area, Date, Yes/No, Multiple Select, Dropdown, Price, Gallery, Media Image etc. Sometimes you need to get these attributes value to show in different places. There are different way to get different type of attributes.

you can get almost type of attribute value by using the following code:

  1. <?php
  2. echo $_product->getAttributeName();
  3. ?>

For example, suppose you are selling computer monitor in your web store and you created a attribute by using ‘screen_resolution‘ as its attribute code. Then You can get this attribute value by using the following code:

  1. <?php
  2. echo $_product->getScreenResolution();
  3. ?>

If it not work you can also try following code:

Magento adding you own custom RSS Feeds

Share
Posted on December 15th, 2012 | Posted by admin

You know you will need, before or after, to add your own custom RSS feeds to your Magento.
For example, I needed to create some custom RSS Feeds to list bestseller products by date (bestseller weekly, monthly, etc…)
How to do it? It’s quite complex but not so much if you follow this mini tutorial:

First of all, you need to setup a new namespace directory under your “local” dir, this will overwrite your current RSS Mage methods but not all.

So, create your directory app/local/Simplicissimus/Rss. (change Simplicissimus with your own Namespace and change it everywhere)

Create inside it the following directories:

  • Block
  • Block/Catalog
  • controllers
  • etc

Starting with the configuration XML, you need to create a file etc/config.xml like this:

How to create a custom router in Magento?

Share
Posted on December 11th, 2012 | Posted by admin

How to create a custom router in Magento?

If you want to create a router for your own modules, perform the following steps.

1. open /app/etc/local.xml
2. Insert the following source code between config tag

01 <frontend>
02 <routers>
03 <$name>
04 <use>standard</use>
05 <args>
06 <module>$module_name</module>
07 <frontName>$router</frontName>
08 </args>
09 </$name>
10 </routers>
11
12 </frontend>

$name = name of your router.
$module_name = name of your module where your router redirects. For example, Moon_Products.
$router = router name.

Magento Custom Options and Suhosin

Share
Posted on December 9th, 2012 | Posted by admin

I was working on a client’s new Magento site recently and I came across a puzzling issue. We had completed a Cart2Cart migration from PinnacleCart to Magento, and several of his products had a huge number of custom options. No matter what I did I couldn’t modify any of those custom options; however I could modify the custom options on a product that only had a handful of them. The page would hang for a second after hitting the Save button on one of the large products but it would process after about 20 seconds revealing that no change had occurred. No SQL queries were going through, but Magento gave me a successful save message. Because of the enormity of the POST being sent I checked ‘post_max_size’ in php.ini and changed it to a substantial value. This had no effect on the situation.

After a little pondering it hit me: we use Suhosin! For those of you who don’t know, Suhosin is a PHP extension that provides lots of extra configurable security options. I added the following Suhosin configurations in my php.ini:


suhosin.post.max_vars = ####
suhosin.request.max_vars = ####
Page 1 of 812345»...Last »