1 protected $_sectionUpdateFunctions = array(
2 'payment-method' => '_getPaymentMethodsHtml',
3 // 'shipping-method' => '_getShippingMethodsHtml',
4 'review' => '_getReviewHtml',
5 );
01 public function saveBillingAction()
02 {
03 if ($this->_expireAjax()) {
04 return;
05 }
06 if ($this->getRequest()->isPost()) {
07 //$postData = $this->getRequest()->getPost('billing', array());
08 //$data = $this->_filterPostData($postData);
09 $data = $this->getRequest()->getPost('billing', array());
10 $customerAddressId = $this->getRequest()->getPost('billing_address_id', false);
11 if (isset($data['email'])) {
12 $data['email'] = trim($data['email']);
13 }
14 $result = $this->getOnepage()->saveBilling($data, $customerAddressId);
15 if (!isset($result['error'])) {
16 /* check quote for virtual */
17 if ($this->getOnepage()->getQuote()->isVirtual()) {
18 $result['goto_section'] = 'payment';
19 $result['update_section'] = array(
20 'name' => 'payment-method',
21 'html' => $this->_getPaymentMethodsHtml()
22 );
23 }
24 /*elseif (isset($data['use_for_shipping']) && $data['use_for_shipping'] == 1) {
25 $result['goto_section'] = 'shipping_method';
26 $result['update_section'] = array(
27 'name' => 'shipping-method',
28 'html' => $this->_getShippingMethodsHtml()
29 );
30 $result['allow_sections'] = array('shipping');
31 $result['duplicateBillingInfo'] = 'true';
32 }*/
33 //End of Comment by Amit Bera
34 else {
35 //$result['goto_section'] = 'shipping';
36 $result['goto_section'] = 'payment';
37 }
38 }
39 $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));
40 }
41 }