Category Archives: Checkout Components

○ Describe how to modify and effectively customize the quote object, the quote item object, and the address object:
■ What is the quote model used for in Magento?
■ What is the shopping cart model used for in Magento?
■ How does Magento store information about the shopping cart?
■ How are different product types processed when added to the cart?
■ What is the difference between shipping and billing address objects in
Magento? How is each used in the quote object?
■ What is the difference in processing quote items for onepage and
multishipping checkout in Magento?
■ How does Magento process additional information about products
being added to the shopping cart (custom options, components of
configurable products, etc.)?
■ How do products in the shopping cart affect the checkout process?
■ How can the billing and shipping addresses affect the checkout process?
■ When exactly does inventory decrementing occur?
■ When exactly does card authorization and capturing occur?
These code references can be used as an entry point to find answers to the questions above:
■ Mage_Sales_Model_Quote
■ Mage_Sales_Model_Quote_Address
■ Mage_Sales_Model_Quote_Item
■ Mage_Sales_Model_Quote_Address_Item ■ Mage/CatalogInventory/etc/config.xml ■ Mage_CatalogInventory_Model_Observer
○ Explain the database schema for total models:
■ What are total models responsible for in Magento?
■ How you can customize total models?
■ How can the individual total models be identified for a given checkout
■ How can the priority of total model execution be customized?
■ To which objects do total models have access in Magento, and which objects do they usually manipulate?
■ Which class runs total models processing?
■ What is the flow of total model execution?
■ At which moment(s) are total models executed
These code references can be used as an entry point to find answers to the questions above:
■ Mage/Sales/etc/config.xml
■ Mage/Tax/etc/config.xml
■ Mage_Sales_Model_Quote_Address
■ Mage_Sales_Model_Quote_Address_Item
■ Mage_Sales_Model_Quote_Address_Total_Abstract ■ Mage_Sales_Model_Quote_Address_Total_Collector ■ Mage/Sales/Model/Quote/Address/Total/*
■ Mage/SalesRule/etc/config.xml
■ Mage_SalesRule_Model_Validator

Inserting an Additional Step Into Checkout

There are several things that need to be considered in implementing an additional step. Here the basics that may be useful to now. As always this will be stepped through by implementing a new module.


<?xml version="1.0"?>



                <customcheckout module="customcheckout">

            <customcheckout_controller_rewrite> <!--This can be any unique id -->
                <!-- the URL which to override-->
                <!-- destination url -->









An important part of the process in relation to the display of the new step goes to the layout aspect.


<?xml version="1.0" encoding="ISO-8859-1"?>
<layout version="0.1.0">
    <checkout_onepage_index> <!-- Adding our new step to onepage block  -->
        <reference name='checkout.onepage'>
            <action method='setTemplate'><template>checkout/onepage.phtml</template></action>

            <block type="customcheckout/checkout_onepage_customcheckout" name="checkout.onepage.customcheckout" as="customcheckout" template="checkout/onepage/customcheckout.phtml">
                <block type="customcheckout/checkout_onepage_customcheckout" name="checkout.onepage.customcheckout.child" as="customcheckout_child" template="checkout/onepage/customcheckout/customcheckout_child.phtml" />

        <reference name='checkout.progress'> <!-- Change the template of progress block -->
            <action method='setTemplate'><template>checkout/onepage/progress.phtml</template></action>
        </reference> <!-- Here we change the template of the progress block to our custom template created -->

        <!-- Mage_Checkout -->
        <remove name="right"/>
        <remove name="left"/>

        <block type="customcheckout/checkout_onepage_customcheckout" name="root" output="toHtml" template="checkout/onepage/customcheckout/customcheckout_child.phtml"/>

    <checkout_onepage_progress>  <!-- Change the template of progress block -->
        <reference name='root'>
            <action method='setTemplate'><template>checkout/onepage/progress.phtml</template></action>



class Webholism_DeliveryTimes_Block_Checkout_Onepage extends Mage_Checkout_Block_Onepage
	 * Get checkout steps codes
	 * @return array
	protected function _getStepCodes()
		return array('billing', 'shipping', 'additionaltest', 'deliverytimes', 'payment', 'review');

    public function getSteps()
        $steps = array();

        if (!$this->isCustomerLoggedIn()) {
            $steps['login'] = $this->getCheckout()->getStepData('login');

        // Adding new deliverytimes step, and remove shipping_method as this is to be automatically specified
        $stepCodes = array('billing', 'shipping', 'customcheckout', 'shipping-method', 'payment', 'review');

        foreach ($stepCodes as $step) {
            $steps[$step] = $this->getCheckout()->getStepData($step);
        return $steps;


<?php ?>
<form  action="" id="co-customcheckout-form">
        <ul class="form-list">
            <li id="checkout-customcheckout-load">
                <?php echo ($this->getChildHtml('customcheckout_child')); ?>

        <div class="buttons-set" id="customcheckout-buttons-container">
            <p class="back-link"><a href="#" onclick="checkout.back(); return false;"><small>&laquo; </small><?php echo $this->__('Back') ?></a></p>
            <button type="button" title="<?php echo $this->__('Continue') ?>" class="button" onclick=""><span><span><?php echo $this->__('Continue') ?></span></span></button>
            <span class="please-wait" id="customcheckout-please-wait" style="display:none;">
                <img src="<?php echo $this->getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="<?php echo $this->__('Loading next step...') ?>" title="<?php echo $this->__('Loading next step...') ?>" class="v-middle" /> <?php echo $this->__('Loading next step...') ?>
<script type="text/javascript">
    var customcheckout = new CustomcheckoutMethod('co-customcheckout-form','<?php echo $this->getUrl('customcheckout/onepage/saveCustomcheckout') ?>');
    var customcheckoutForm = new VarienForm('co-customcheckout-form');