How to make Magento’s checkout in a one page

Dealing with Magento we’ve noticed there’s with 6 steps checkout. Magento is not very flexible to customize so 1 step there’s 1 step checkout plugins you can buy for this. Here’s what I’ve found about that.
Basicaly a page can be shown in Magento using simple Core_Template type. Basically all code is set inside the .phtml file so it can be shown on every possible page or block, meaning it’s object independent, no inheritance. Something you can call from with your layout files like
If you have such special requirements for your site below is the code that you can place on whatever file you wish and include it yout tempalte as block type core/template.
$checkout = Mage::getSingleton(’checkout/type_onepage’); /* * One page checkout consists of following steps * (1) Customer login method aka Checkout method * (2) Billing information (address) * (3) Shipping information (address) * (4) Shipping method * (5) Payment information * (6) Order review, in short: DO THE ORDER */ //STEP(1) $checkout->saveCheckoutMethod(’guest’); //STEP(2) $checkout->saveBilling($billingAddress, false); //STEP(3) $checkout->saveShipping($shippingAddress, false); //STEP(4) $checkout->saveShippingMethod(’flatrate_flatrate’); //STEP(5) $checkout->savePayment(array(’method’=>’checkmo’)); //STEP(6) /* * $checkout->saveOrder() returns array holding empty object * of type Mage_Checkout_Model_Type_Onepage */ $checkout->saveOrder();
And here is the example of how the $address variables are supose to look
[billing] => Array ( [address_id] => 5 [firstname] => Branko [lastname] => Ajzele [company] => Surgeworks [email] => ajzele@somemail.com [street] => Array ( [0] => Address part 1 [1] => Address part 2 ) [city] => Osijek [region_id] => [region] => [postcode] => 31000 [country_id] => HR [telephone] => 0038531000331 [fax] => 0038531000332 [customer_password] => [confirm_password] => [save_in_address_book] => 1 ) [shipping] => Array ( [address_id] => 6 [firstname] => Ivan [lastname] => Weiller [company] => Surgeworks [street] => Array ( [0] => Address part 1 [1] => Address part 2 ) [city] => Osijek [region_id] => [region] => [postcode] => 31000 [country_id] => HR [telephone] => 0038531000333 [fax] => 0038531000334 [save_in_address_book] => 1 )
And you can wrapp the above checkout code into something like
if($this->getRequest()->getParam(’submitCustomCheckout’))
{
//Checkout code from above…
}
Where ubmitCustomCheckout is the name of the submit button or submit input field. To extract addresses you can use something like
$billingAddress = $this->getRequest()->getParam(’billing’); $billingAddress['use_for_shipping'] = 0; $shippingAddress = $this->getRequest()->getParam(’shipping’);
That’s it. Simple, predefined checkout by whitch order can be make on one click.
Thanks for that. Had planned to try to solve this problem sometime soon. It’s obvious from your few posts on your blog that you’re very good at what you do. Best wishes. Tony
P.S. do you know that the bar at the bottom of your site is almost invisible (to me anyway)? Was looking for your RSS feed and only found it when I was writing this comment.