Now we want to take a look at rewriting some of Magento’s core code in a module of our own. Our aim is to set the quantity of a related product (a product warranty) added to the cart to the same quantity as the main product that we select. There are bigger lessons here too, and we want to learn those along the way. Here goes…
My Magento Blog
Change the Product Quantity Added to Cart – part 1: Introduction
In this and subsequent posts we’re going to look at how to change the quantity of a product added to the cart. Our first solution will be a rewrite of a model class. Second – lighter touch – we’ll look at using an observer to do the same. Along the way, we’ll discuss ways to approach a problem such as this. Ready?
Despatch Date Module – part 10: Magento Admin – AJAX with jQuery
This is a follow-on post to a recent series where I provided administrators with an option to add a despatch date in Admin, present this in the order grid and include it in an order update email. In this post, we want to ‘ajaxify’ the user experience. We’ll update the database with the new date without having to refresh the order view page.
Despatch Date Module – part 9: Add field to ‘My Account’
In this post, we are going to add our newly created despatch date field to the customer’s ‘My Account’ area for any orders they have made. For this, we’ll take a similar approach to the one taken in part 2 of this series, when we set up the layout for the field within Magento Admin.
Despatch Date Module – part 8: Customise the order grid
In this post, we’re going to add our new despatch date field as a column to the order grid page. This is the page with the list of customer orders. We’ll also add the company name as this column has also been requested by our client.
Despatch Date Module – part 7: Custom email variable
This post continues our series to build a module for order despatch date. Here, we want to develop our store so that we can communicate the estimated despatch date to the customer in an email. Magento provides the facility to send an order update email from within the Order View Information page. We’ll add an estimated despatch date to this email template and serve the template with a method to get the date from the database.
(more…)
Despatch Date Module – part 6: Contructing the block class
In this post we continue our series to provide a despatch date field accessible via the Order View page. We’ll see how the block class we created in part 2 will serve the form template. We still need to populate the input box with the current value for the date if it already exists in the database. And the user will update this as needed.
(more…)
Despatch Date Module – part 5: Building the controller
This is the post at the heart of this series. The controller will take the values entered into the input form, save the despatch date in the database and provide messages on the status of the success or failure of this action.
(more…)
Despatch Date Module – part 4: Setting up the database
This is the fourth post of a series to build a module for a Despatch Date field on the Order View page in Magento Admin. In this post we’ll add a column to a table in the database where we can store the despatch date for the customer’s order. In the next post, we’ll put data in it with our controller class, and in subsequent posts, we’ll see how we can get the data out. (more…)
Despatch Date Module – part 3: Form enhancement with javascript
In this the third post of the series to add a Despatch Date field in Magento Admin, we’re going to use jQuery and prototype to enhance our form. jQuery to add some validation and prototype to add a datepicker. Before we get that far, let’s enhance the appearance of our form and make it consistent with other elements on the page. (more…)