Home Archive

Articles in the Magento Guide Category

23 Sep 23 Sep 2009 Comments Off

Recently one of our clients needed and info on Affiliate module for Magento. When it comes to Magento, word “module” is loosely related. Sure, every module needs config files in order to report it’s “connection” to Magento core. Modules like this, Affiliates for all, are modules I consider loosely related to core. They are in one or another way connected to Magento but they are self standing, independent, applications.
Installation of Affiliate module is a trivial task. It mostly comes down to extracting downloaded archive file to a web accessible directory …

Read More

 
21 Sep 21 Sep 2009 1Comment

Recently I have been working on a custom checkout page for one of our clients in Sweden. I had some trouble figuring out how to send default Magento order email with all of the order info. After an hour or so of studying Magento core code, here is the solution on how to send email after successful order has been made.

< ?php
$order = new Mage_Sales_Model_Order();
$incrementId = Mage::getSingleton(’checkout/session’)->getLastRealOrderId();

$order->loadByIncrementId($incrementId);

try
{
$order->sendNewOrderEmail();
} catch (Exception $ex) {  }
?>

Not sure how useful this alone will be for you, so I’ll throw a little advice along the way. …

Read More

 
16 Sep 16 Sep 2009 Comments Off

For those of you who are into kinky stuff I made a simple, more of a proof of concept, application that sits in Widnows taskbar and shows the order info in balloon popup. Took me little more than half of hour to get this working. Almost forgot how great C# is
Magento has this great feature, rss feed for orders. You can access it via link http://myshopsite/rss/order/new. It requires authentication, so you need to provide Magento user and pass to access this link. Idea I wanted to play around …

Read More

 
15 Sep 15 Sep 2009 Comments Off

As you know, Magento has a built-in contact form that can be used for general contacts. That form isn’t part of any CMS page, you cannot edit some introduction text, you cannot add phone numbers administration, and you cannot see the breadcrumbs. If you wish to edit text in that default contact form, you will need to update front-end files. Luckily, there is an alternative.
If you are a developer, editing your contact form HTML is an easy task. You only need to open file:
app/design/frontend/default/[yourtheme]/template/contacts/form.phtml and you will find your way …

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

 
14 Sep 14 Sep 2009 Comments Off

One of my recent articles was on the subject of sorting “On Sale” product in Magento. The following is a cleaner and more advanced look at how—with few tricks and smart moves—you can reuse existing Magento code and modify it to suit your needs.
Product can be “on sale” in two ways:
1. when an item has a special price assigned to it on the individual level, or
2. when a special promotion “covers” the item
It is important to remember that you don’t have to set up the special price on each product …

Read More

 
12 Sep 12 Sep 2009 Comments Off

You can add items to magento’s system log and exception log in your code. This is very handy for pin-pointing coding errors / problems. Developing for Magento is often hard, especially since it’s not always possibly to have error reporting on (and even when it is on, its hard to find exactly what’s wrong!).
Here’s an example of it’s use:
1) Turn on your logging: Admin > Configuration > Developer > Log Settings > Enabled = Yes
2) Example code snippet where you might find this useful:

<?php
$response = curl_exec($ch); //just an example of …

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 Comments Off

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

 
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