public function getAddressesHtmlSelect($type)
 {
     if ($this->isCustomerLoggedIn()) {
         if ('shipping' !== $type || false === Mage::helper('quafzi_fixedbillingaddress/data')->isShippingAddressFixed()) {
             return parent::getAddressesHtmlSelect($type);
         }
         if (Mage::helper('quafzi_fixedbillingaddress')->isShippingAddressSelectable()) {
             $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()->getPrimaryShippingAddress();
                 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 = $type . '-address-select';
             $js = '<script type="text/javascript">$("' . $selectId . '").parentElement.previousElementSibling.hide()</script>';
             return '<input id="' . $selectId . '" type="hidden" value="' . $this->getAddress()->getAddressId() . '">' . $this->_getShippingAddressHtml() . $js;
         }
     }
     return '';
 }
 public function getAddress()
 {
     if (!empty(Mage::getSingleton('checkout/session')->getHcdWallet())) {
         $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();
     }
 }
Beispiel #3
0
 public function getAddress()
 {
     if (is_null($this->_address) && !$this->isCustomerLoggedIn()) {
         $address = $this->getQuote()->getShippingAddress();
         if ($address->getId()) {
             $this->_address = $address;
             return $address;
         }
     }
     return parent::getAddress();
 }
Beispiel #4
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/shipping.phtml");
         } else {
             $this->setTemplate("fieldsmanager/checkout/onepage/1700/shipping.phtml");
         }
     }
     return parent::_toHtml();
 }
Beispiel #5
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()->getShippingAddress()) {
             // If the visitor has previously been through the billing step then use that data
             $this->_address = $this->getQuote()->getShippingAddress();
         }
     }
     return $this->_address;
 }
Beispiel #6
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()->getShippingAddress();
             } else {
                 parent::getAddress();
             }
         }
         return $this->_address;
     }
 }
 protected function _construct()
 {
     parent::_construct();
 }
Beispiel #8
0
 public function __construct()
 {
     parent::__construct();
 }
Beispiel #9
0
 /**
  * Initialize shipping address step
  */
 protected function _construct()
 {
     $this->getCheckout()->setStepData('shipping', array('label' => Mage::helper('checkout')->__('Shipping Information'), 'is_show' => $this->isShow()));
     $this->settings = Mage::helper('oscheckout/checkout')->loadSettings();
     parent::_construct();
 }