public function getAddressesHtmlSelect($type)
 {
     if ($this->isCustomerLoggedIn()) {
         if ('billing' !== $type || false === Mage::helper('quafzi_fixedbillingaddress/data')->isBillingAddressFixed()) {
             return parent::getAddressesHtmlSelect($type);
         }
         if (Mage::helper('quafzi_fixedbillingaddress')->isBillingAddressSelectable()) {
             $options = array();
             foreach ($this->getCustomer()->getAddresses() as $address) {
                 $options[] = array('value' => $address->getId(), 'label' => $address->format('oneline'));
             }
             $addressId = $this->getAddress()->getCustomerAddressId();
             if (empty($addressId)) {
                 $address = $this->getCustomer()->getPrimaryBillingAddress();
                 if ($address) {
                     $addressId = $address->getId();
                 }
             }
             $select = $this->getLayout()->createBlock('core/html_select')->setName($type . '_address_id')->setId($type . '-address-select')->setClass('address-select')->setExtraParams('onchange="' . $type . '.newAddress(!this.value)"')->setValue($addressId)->setOptions($options);
             if (Mage::helper('quafzi_fixedbillingaddress')->isCreateOrModifyAdditionalAddressAllowed()) {
                 $select->addOption('', Mage::helper('checkout')->__('New Address'));
             }
             return $select->getHtml();
         } else {
             $selectId = 'billing-address-select';
             $js = '<script type="text/javascript">$("' . $selectId . '").parentElement.previousElementSibling.hide()</script>';
             return '<input id="' . $selectId . '" type="hidden" value="' . $this->getAddress()->getAddressId() . '">' . $this->_getBillingAddressHtml() . $js;
         }
     }
     return '';
 }
Exemple #2
0
 public function getAddress()
 {
     $address = $this->getQuote()->getBillingAddress();
     if ($address) {
         return $address;
     }
     return parent::getAddress();
 }
Exemple #3
0
 /**
  * Initialize billing address step
  *
  */
 protected function _construct()
 {
     $this->getCheckout()->setStepData('billing', array('label' => Mage::helper('checkout')->__('Billing Information'), 'is_show' => $this->isShow()));
     if ($this->isCustomerLoggedIn()) {
         $this->getCheckout()->setStepData('billing', 'allow', true);
     }
     $this->settings = Mage::helper('oscheckout/checkout')->loadSettings();
     parent::_construct();
 }
 public function getAddressesHtmlSelect($type)
 {
     if ('billing' !== $type || false === Mage::helper('quafzi_fixedbillingaddress/data')->isAddressFixed()) {
         return parent::getAddressesHtmlSelect($type);
     }
     $selectId = 'billing-address-select';
     $js = '<script type="text/javascript">$("' . $selectId . '").parentElement.previousElementSibling.hide()</script>';
     return '<input id="' . $selectId . '" type="hidden" value="' . $this->getAddress()->getAddressId() . '">' . $this->_getBillingAddressHtml() . $js;
 }
Exemple #5
0
 /**
  * Initialize billing address step
  *
  */
 protected function _construct()
 {
     parent::_construct();
     $this->getCheckout()->setStepData('billing', array('label' => Mage::helper('checkout')->__('Shipping Information'), 'is_show' => $this->isShow()));
     if ($this->isCustomerLoggedIn()) {
         $this->getCheckout()->setStepData('billing', 'allow', true);
     }
     //$this->setTemplate('removebilling/billing.phtml');
 }
 public function getAddress()
 {
     $HcdWallet = Mage::getSingleton('checkout/session')->getHcdWallet();
     if (!empty($HcdWallet)) {
         $wallet = Mage::getSingleton('checkout/session')->getHcdWallet();
         $this->_address = Mage::getModel('sales/quote_address')->setAddressType(Mage_Sales_Model_Quote_Address::TYPE_BILLING)->setStoreId(Mage::app()->getStore()->getId())->setFirstname($wallet['adress']['firstname'])->setLastname($wallet['adress']['lastname'])->setEmail($wallet['adress']['email'])->setSuffix('')->setCompany('')->setStreet(array('0' => $wallet['adress']['street'][0], '1' => $wallet['adress']['street'][1]))->setCity($wallet['adress']['city'])->setPostcode($wallet['adress']['postcode'])->setCountry_id($wallet['adress']['country_id'])->setRegion($wallet['adress']['region'])->setRegion_id((string) $wallet['adress']['region_id'])->setTelephone($wallet['adress']['telephone'])->setFax();
         return $this->_address;
     } else {
         return parent::getAddress();
     }
 }
Exemple #7
0
 public function getAddress()
 {
     if (is_null($this->_address) && !$this->isCustomerLoggedIn()) {
         $address = $this->getQuote()->getBillingAddress();
         if ($address->getId()) {
             $this->_address = $address;
             return $address;
         }
     }
     return parent::getAddress();
 }
Exemple #8
0
 protected function _toHtml()
 {
     if (Mage::helper('fieldsmanager')->getStoredDatafor('enable') && !Mage::getStoreConfig('quickcheckout/general/active')) {
         $version = Mage::getVersion();
         if (version_compare($version, '1.7.0.0', '<')) {
             $this->setTemplate("fieldsmanager/checkout/onepage/billing.phtml");
         } else {
             $this->setTemplate("fieldsmanager/checkout/onepage/1700/billing.phtml");
         }
     }
     return parent::_toHtml();
 }
Exemple #9
0
 /**
  * Return Sales Quote Address model
  *
  * @return Mage_Sales_Model_Quote_Address
  */
 public function getAddress()
 {
     $oAddress = parent::getAddress();
     if ($oAddress->isObjectNew()) {
         // Core functionality has created a new address object because it's not a logged-in customer
         if ($this->getQuote()->getBillingAddress()) {
             // If the visitor has previously been through the billing step then use that data
             $this->_address = $this->getQuote()->getBillingAddress();
         }
     }
     return $this->_address;
 }
Exemple #10
0
 /**
  * Initialize billing address step
  *
  */
 protected function _construct()
 {
     $this->getCheckout()->setStepData('billing', array('label' => Mage::helper('checkout')->__('Billing Information'), 'is_show' => $this->isShow()));
     if ($this->isCustomerLoggedIn()) {
         $this->getCheckout()->setStepData('billing', 'allow', true);
     }
     $this->settings = Mage::helper('onestepcheckout/checkout')->loadSettings();
     $enableGeoIp = Mage::getStoreConfig('onestepcheckout/general/enable_geoip');
     if ($enableGeoIp == '1') {
         $helper = Mage::helper('onestepcheckout/checkout');
         $strCountryId = $helper->getGeoIp()->countryCode;
         //$this->settings['default_country_id'] = $strCountryId;
     }
     parent::_construct();
 }
Exemple #11
0
 public function getAddress()
 {
     if (version_compare(Mage::getVersion(), '1.5.0', '<=')) {
         return parent::getAddress();
     } else {
         if (is_null($this->_address)) {
             if (!$this->isCustomerLoggedIn()) {
                 $this->_address = $this->getQuote()->getBillingAddress();
             } else {
                 parent::getAddress();
             }
         }
     }
     return $this->_address;
 }
 protected function _construct()
 {
     parent::_construct();
     $this->_mainModel = Mage::getModel('aitcheckoutfields/aitcheckoutfields');
 }
 public function _prepareLayout()
 {
     return parent::_prepareLayout();
 }
 public function __construct()
 {
     parent::__construct();
     //$this->setTemplate('outsourceOnline/captcha/onepage_billing.phtml');
     //die( $this->toHtml());//$this->getTemplate()
 }