Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Can Magento Do. 
 
ranga81200
Jr. Member
 
Total Posts:  1
Joined:  2010-10-23
 

please send me how to add \"upload file\” on check out page at billing information section.

many thnx..

 
Magento Community Magento Community
Magento Community
Magento Community
 
wmcferr
Sr. Member
 
Total Posts:  174
Joined:  2010-11-16
 

In order to add a check out page at billing information section, you can place the following code on whatever file you wish and include it in your template 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 which order can be make on one click.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top