Solving Magento

Solutions for Magento E-Commerce Platform

by Oleg Ishenko

Magento Grouped Product Redirect Tutorial

Recently, one of my blog readers has raised a question in the comments to my post Magento Grouped Poduct Type: Is there a way to direct a customer to the grouped product when he clicks a link to the associated simple product?

The answer is, of course, yes. For this task I’ve proposed to use the Observer Pattern, which I have already covered in one of my tutorials. In this post, I am going to present you a simple extension that performs the grouped product redirect using an observer.

Continue reading

OneStep Checkout – A Magento Tutorial, Part 4 (Steps 11 and 12)

This is the last part of the long tutorial on the Magento checkout customization. here, I will describe the last checkout section “Order Review” and explain how the OneStep checkout link can be added to the Magento front-end.

Previous parts of this tutorial are: Part 1: Introducing OneStep Checkout, Part 2: Starting with the OneStep Checkout JavaScript, Part3: Deeper into the Checkout Sections.
Continue reading

OneStep Checkout – A Magento Tutorial, Part 3 (Steps 8 – 10 of 12)

In the third part of the Magento OneStep checkout tutorial I will continue describing the JavaScript and controller functionality of the OneStep checkout sections. See also the parts one and two.

If you are impatient, you can download the finished extension from GitHub Solvingmagento_OneStepCheckout now. A demo shop with a working OneStep checkout can be found here.
Continue reading

OneStep Checkout – A Magento Tutorial, Part 2 (Steps 5 – 7 of 12)

This is the second part of the Magento OneStep Checkout tutorial. In the first part, I’ve discussed the objective and challenges of the tutorial and laid the foundation for the new checkout extension. Next, I will describe the JavaScript component of the OneStep checkout and give more details on the controller functionality.
Continue reading

OneStep Checkout – A Magento Tutorial, Part 1 (Steps 1 – 4 of 12)

In this tutorial, I will demonstrate an extension that adds a OneStep checkout to Magento. In my earlier post Magento OnePage Checkout, I’ve explained the ideas behind different checkout types. In short, the checkout process is usually broken into steps, and in each step customers must provide a certain part of the checkout data. Despite the wide use of the step-by-step checkout, many online retailers find it too cumbersome for customers – especially the part where the browser has to load a new URL for each step. A different approach is the OnePage checkout such as the one implemented in Magento where all steps a brought under a single URL. The checkout shows only one step at a time and uses Ajax requests to switch between steps and refresh the checkout state without browser reloading the page. The process, however, retains its step character: customers must fill out all steps separately and in a specific order.

The OneStep approach is a further simplification of the checkout process: all step forms are shown at once and customers no longer need to submit each step individually. But, there is a catch: the customer must fill out the entire checkout form in one go. If you take all the fields of the Magento OnePage checkout and display them all in one step, they will make a long and intimidating form. Not only that might scare some buyers off, but implementing the dependencies between fields (e.g., shipping methods depending on the delivery destination) would be even more challenging. This is the exact opposite of a simple and transparent process that the OneStep checkout aims to achieve. For these reasons the use of the OneStep checkout is confined to special cases where the checkout process doesn’t need much information from customers. One such example could be a shop selling downloads which need no physical shipping and no fields for a shipping address and shipping methods are necessary. In this case, the checkout form is short: customer billing address, payment method, order overview – and ideal premise for a OneStep checkout.

In my extension I will not restrict myself to any specific scenario; instead, I will attempt to build a OneStep checkout as a replacement to the fully fledged Magento OnePage checkout. The necessary compromises may result in a checkout that is in some parameters less satisfactory than a production use would require – but, this I leave to you to judge.

This is a very long tutorial that spans several posts and consists of 12 steps. If you are impatient, you can download the finished extension from GitHub Solvingmagento_OneStepCheckout now. A demo shop with a working OneStep checkout can be found here.

Other parts of this tutorial are: Part 2: Starting with the OneStep Checkout JavaScript, Part3: Deeper into the Checkout Sections, Part4: Order Review.
Continue reading

Creating a Custom Product Type in Magento

The standard product types in Magento cover a wide range of possible merchandise: physical and virtual, configurable and downloadable, grouped and bundled. Yet, the e-commerce world is so diverse that often these types are not enough. There is always a chance that your product has some unique features that standard types do not cover. Fortunately, you can always extend an existing type, and I’ve shown you in my previous tutorials how to do that. Although extensions allow a high level of customization, sometimes business rules require a totally new product type. In this tutorial I am going to present such a case: a product type that requires a distinct functionality not available in core Magento. This may sound grand, but, in fact, this functionality is quite simple – it is an affiliate product.

Affiliate products are quite common. The idea behind them is that your shop is affiliated with some other retailer that allows you to display its products in your catalog. These affiliate products are not sold in your shop, they can’t be added to cart. Instead, customers are redirected to the partner shop where the actual transaction happens. The redirect link allows the partner shop to identify you as a referrer which entitles you to a commission from each sale. There are hundreds of thousands (or more like millions) websites that work like that: from humble blogs with a handful of Amazon links to e-commerce giants that “outsource” parts of their catalog to partners.

Continue reading

Magento Downloadable Product Type Tutorial

In this tutorial I am going to demonstrate some of the functions I’ve talked about in my overview of the Downloadable product type. I will develop a simple module that will add a new feature to the Downloadable type and while doing so I will be using some of the unique functions available to downloadable products.

The new feature is this: I want file size displayed next to product and sample links on the downloadable product detail page. For that I will have to do the following:

  • extend Link and Sample models with attributes to store file sizes,
  • obtain file sizes from files uploaded locally or from external URLs,
  • save file sizes to the respective attributes of Link and Sample models,
  • modify downloadable product templates to display the new attributes.

Continue reading

Magento Bundle Product Type Tutorial

An overview of Magento’s Bundle product type would not be complete without an exercise providing a practical insight to the functionality of bundles. In this tutorial I will guide you through development of a relatively simple module that slightly alters the standard bundle implementation. If you read the first part of the discussion on the Bundle product type, specifically the description of the option and selection settings, you’d recall that some option types can be configured to allow customers to enter their own quantity when selecting an option. This property is called User Defined Quantity and is defined per selection item. Bundle selections store this flag in table catalog_product_bundle_selection in field selection_can_change_qty. By default, this functionality is available for options of type “Drop-down” and “Radio buttons” only. You can’t set this property for options of type “Checkbox” and “Multiselect”. Consider the following example from a test shop which uses sample data available here. Let’s look at a bundle with SKU mycomputer. This how the options management looks like in the back-end:

Continue reading

Adding Custom Options to Products in Magento

In my post A Magento File Custom Option Type Primer I’ve talked about how file custom product options are handled in Magento. One of the readers posted a comment there asking if there was an alternative to manually adding custom options to existing products. For such a task I can recommend MAGMI, Magento Mass Importer, which was used in one of my projects to import product data including custom options. Another solution would be writing a script which could dynamically add custom options to a set of existing products. In this post I will show you how to create such script.

First, let’s see how custom option data are written to database when a product is saved. The product model class Mage_Catalog_Model_Product has a protected method _afterSave which is called, as the name suggests, after a product model is saved.

Continue reading

Magento Grouped Product Type Tutorial

This post is a follow up to the discussion on the Grouped product type in Magento. In this tutorial I will develop a simple Magento module, which will change some front-end display features of grouped products while providing an insight into certain functionality aspects of the Grouped product type. The examples I am going to use are based on the sample Magento store data, which can be downloaded here.

The sample extension will perform the following tasks:

  • Customers must not be able to enter custom quantity for grouped set items into the add-to-cart form. The quantity to be added to cart will be the one provided in the back-end grouped product management as default_quantity.
  • If a grouped item has no or zero default_quantity it will be displayed as “out of stock”.
  • Customers can choose which items to add to the cart by selecting check-boxes next to the respective items in the add-to-cart form.

To implement these features we will have to override a block class responsible for the display of the grouped product options as well as extend the Grouped product type functionality to use default_quantity when adding products to cart.

Continue reading

Theme: Esquire by Matthew Buchanan.