Home Archive

Articles tagged with: Magento Development

16 Sep 16 Sep 2009 0Comment

One of the coolest things in Magento is a form validation, and the way how it’s done. Magento uses Prototype library (which, personlay, I’m not a big fan of) to manage form validation. All you need to do when writing custom form is to assign a valid class names to your input fields. Here is an example of how your custom form might look in order to get use of automatic form validation.

<form name="<em><strong>my-custom-form</strong>" id="my-custom-form" action="" method="post">

<label for="firstname">< ?php echo $this->__(’First name’) ?> <span>*</span></label>
<input id="firstname" name="firstname" />

<label for="lastname">< ?php echo …

Read More

 
14 Sep 14 Sep 2009 4Comment

This is a popular bug that has been plaguing many people with their custom Magento solutions.
Problem: Magento shows products that are in stock as “Out of Stock” – It seems to be popularly reported within the New Product block.
Solution: The attribute “status” has not been selected in the product collection. This status attribute holds the information about whether or not the product is or is not in stock (among other items that determine if the item should be sale-able).
This attribute needs to be selected via the new product block code.
Find: …

Read More

 
12 Sep 12 Sep 2009 0Comment

This is not a comprehensive example (I didn’t write out an example of editing the navigation myself … yet) – but I will point out where the files are that you need to edit the top and left navigation.
This is a tad complicated because of the use of javascript in the navigation, but it’s not too bad. It ends up being a bunch of functions which just spits out the proper HTML and javascript to get things going (and some code to retrieve the categories).
First off, the template files.
The files …

Read More

 
12 Sep 12 Sep 2009 1Comment

Bestseller or best selling product is one of the features people tend to ask for when it comes to Magento™.
There are multiple ways to implement this feature.
In this example, I’m not using controller or model directories at all; I’m going to show you how to implement this feature using only one file: the View.
Basically, what you need to do is to create the directory inside your template directory and place the bestseller.phtml file in it. In my example, I’m using the custom-created directory /inchoo. All of the screenshots provided here …

Read More

 
11 Sep 11 Sep 2009 0Comment

I recently answered a question on the magento forums about how to remove the callout images in the right / left columns.
This is a pretty easy task, but finding them required a small bit of digging (as usual).
My first recommendation when trying to find any thing in the front end is to turn on Template Path hints in the admin section

Admin > System > Configuration
Switch your “Current Configuration Scope” to your store (’Main Website’ on a stock build)
Click on the Developer Tab (bottom left) and find the Debug area
Template Path …

Read More

 
11 Sep 11 Sep 2009 0Comment

The items in the footer area are in two different locations. One part is a static block created within the magento admin area (CMS > Static Block). The other part is held in the related .phtml / .php / .xml files within the design files.
First off, the XML files
app/design/frontend/*/*/layout/page.xml
Here you will find some footer reference:

<block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">
<block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>
<block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml"/>
</block>

app/design/frontend/*/*/layout/cms.xml

<reference name="footer">
<block type="cms/block" name="cms_footer_links" before="footer_links">
<!–
The content of this block is taken from the database by its block_id.
You can manage it in admin CMS -> …

Read More

 
10 Sep 10 Sep 2009 2Comment

Hi all – Here is my solution to a question I’ve seen asked many times: How to move the cart sidebar into the header area. You can use this technique to move it anywhere. This is not the only way to do this, but it is a useful one.
1) Copy the the block for the cart side bar:

//design/frontend/default/default/layout/checkout.xml
<block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml"/>

//there is also this full code in my version 1.1.3
<block type="checkout/cart_sidebar" name="cart_sidebar" template="checkout/cart/sidebar.phtml" before="-">
<action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/sidebar/default.phtml</template></action>
<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/sidebar/default.phtml</template></action>
<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/sidebar/default.phtml</template></action>
</block>

2) Open up app\design\frontend\default\default\layout\page.xml (assuming you are using the default design or didn’t create …

Read More

 
8 Sep 8 Sep 2009 0Comment

It’s been a while since my last post. I’ve been working on Magento quite actively last two months. I noticed this negative trend in my blogging; more I know about Magento, the less I write about it. Some things just look so easy now, and they start to feel like something I should not write about. Anyhow…. time to share some wisdom with community
Our current client uses somewhat specific (don’t they all) store set. When I say specific, i don’t imply anything bad about it. One of the stand …

Read More

 
8 Sep 8 Sep 2009 1Comment

Quite a few people have asked me for a price filter functionality that comes with Magento. Mostly, the questions are same: How does one put the price filter anywhere on the page? How does one set it’s on price ranges in that filter? What defines default price ranges. Is it possible to set price filter for all my products instead of just single category? Lot of questions. The answer might be simpler then you might think.
There are two ways to approach this problem. Head trough wall or stop and think …

Read More

 
7 Sep 7 Sep 2009 0Comment

If you worked with osCommerce, Zen Cart, CRE Loaded or any similar eCommerce platform before, you might find Magento database structure quite confusing when you see it for the first time. I advise you not to rush too much figuring out what is what by glancing through database. Try to spend first few hours getting familiar with some background. For purposes of flexibility, the Magento database heavily utilizes an Entity-Attribute-Value (EAV) data model. As is often the case, the cost of flexibility is complexity. Is there something in Magento that …

Read More