views:

21

answers:

1

We are need to build a cart page that allows customers to personalise their products according to pre-defined options (see wireframe image here: http://i.imgur.com/OY5XF.png). The personalisation must be on the cart page for user experience.

Technically speaking, what is the best way to build this type of feature? I have been suggested to look at attributes, but my feeling is they don’t provide quite the level of personalisation we’re looking for and I’m also unsure as to how to locate these options on the cart page.

Any help and advice would be very much appreciated.

+1  A: 

Looks like a pain. This is in reality a huge modification, so I'd go back and verify the requirement, as this bends the framework in directions it won't want to go. I'm including the major pitfalls I can see below for reference.

A good option to store the options along with the order (and potentially change the product price based on selected options) is to use Custom Options on the catalog products themselves. These will be saved with the order and are already displayed in all the admin tools for dealing with orders.

That leaves the undesirable task of adding them on the cart page. They are usually added to the catalog view page, so if you dont want them on that page, you'll need to remove them from the view template. In doing so, you'll probably also need to make the options optional so that Magento will allow the user to add the item to the cart.

Next, modify the cart "line" templates so that they display any options on the products while the products are in the cart. You don't mention whether the user will have to click anything to save their options, so presumably, you'll need to hack the JS to save the options whenever a field has a blur event. Create a new controller/action that takes an option value and a cart_item_id and saves it back into the cart. As long as the options are all optional Magento should let you save them one at a time. If price updates are involved, make sure to reload the totals as well.

If the options really are optional, this should cover most of your bases. If they really are required, you'll need to add a check to the "checkout" buttons that manually makes sure that all options have been accounted for, and bumps the user back into the cart otherwise.

Next, the image. In a very optimistic world, the client would not require that the text overlays are done in the correct font. This is a naive assumption. More likely, you'll need to create another controller/action that grabs the product options that have already been selected and renders images of the text. Absolutely position these elements over the product image itself on your overlay window and you'll get a good approximation of the image.


This isn't really an exhaustive list of the modifications necessary for this cart page, and if you're not an experienced Magento dev I would be hesitant to undertake it at all. It at all possible, skip this approach and keep the options where they belong on the product page.

Final note, attributes are not a good way to solve this problem. Each product can only have one value for an attribute, so each customer would not be able to customize their products.

Hope that helps!

Thanks, Joe

Joseph Mastey
Definitely push back on the requirement. If you can capture the personalization on the product view page before adding to cart, that will reduce many headaches. The cart should be about calculating discounts, shipping, taxes, etc - not customizing the cart contents.
Jonathan Day

related questions