Solving Magento

Solutions for Magento E-Commerce Platform

by Oleg Ishenko

Magento Configurable Product Type Tutorial

This tutorial will demonstrate some functionality specific to the Configurable product type. This post complements the overview of this product type, which you can find in my previous posts: Magento Configurable Product Type (Part 1) and Magento Configurable Product Type (Part 2).

I will lead you through developing a simple Magento extension that will make a small change in the way configurable products are presented in the front-end. Normally, when you open a product detail page of a configurable product its options are not selected. Because of this a customer is unable to add the product to cart immediately. We are going to load configurable products with their options already pre-selected. The test shop the extension is developed for runs sample product data, which you can download here.

Continue reading

A Magento File Custom Option Type Primer

In the following example we are going to take a simple product and add a file option to it to see how the file is being handled by the system.

Our test product is “The Get Up Kids: Band Camp Pullover Hoodie (Shirts T)” from the Magento sample data (download). Its SKU is 4fasd5f5. We would like to allow customers to upload an image file to be printed on the shirt. Open this product in the back-end and switch to the Custom Options tab. The list of options is empty. Click the “Add New Option” button in the upper right corner. In the form that appears select File in the “Input Type” drop-down list. The form must look like this:

Figure 1. File custom options form

Figure 1. File custom options form

Continue reading

Events and Observers: a Magento Tutorial

This tutorial will demonstrate the principles of the observer pattern implemented in Magento. The details of this implementation have already been discussed in the previous part Event-Driven Architecture in Magento: Observer Pattern. Now we will apply this knowledge in practice and develop a module, whose functionality is built upon events and observers.

The module will perform the following tasks:

  1. An XML export file is created every time an order is placed in the shop.
  2. Every time a new customer places his first order an email is dispatched to the shop manager.

As usual, the first step to create a module is adding a module configuration file to the app/etc/modules directory. The local code pool’s package of the module is Solvingmagento and the module name is OrderExport. Place the following configuration into the app/etc/modules/Solvingmagento_OrderExport.xml:

<?xml version="1.0"?>
	<config>
	    <modules>
		<Solvingmagento_OrderExport>
		    <active>true</active>
		    <codePool>local</codePool>
		</Solvingmagento_OrderExport>
	    </modules>
	</config>

Continue reading

Accessing an External Database from Your Magento Module

In this post I will walk you through building a simple module to show how an external database can be accessed from Magento. Our module will include a model, whose table resides in an external database. We will create this table using Magento setup functionality and use the table to write and read data.

First you have to create the required folder structure:

app
    --code
        --Solvingmagento
            --Externaldb
                --Model
                --controllers
                --etc  
                --sql
    --etc
        --modules

Once ready, add module declaration file Solvingmagento_Externaldb.xml to app/etc/modules/. Its content is standard:

<?xml version="1.0"?>
<config>
    <modules>
        <Solvingmagento_Externaldb>
            <active>true</active>
            <codePool>local</codePool>
        </Solvingmagento_Externaldb>
    </modules>
</config>

Continue reading

Theme: Esquire by Matthew Buchanan.