Mage_Checkout_Block_Multishipping_Addresses Class Reference

Inheritance diagram for Mage_Checkout_Block_Multishipping_Addresses:

Mage_Sales_Block_Items_Abstract Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 getCheckout ()
 getItems ()
 getAddressesHtmlSelect ($item, $index)
 getAddressOptions ()
 getCustomer ()
 getItemUrl ($item)
 getItemDeleteUrl ($item)
 getPostActionUrl ()
 getNewAddressUrl ()
 getBackUrl ()
 isContinueDisabled ()

Protected Member Functions

 _prepareLayout ()


Detailed Description

Definition at line 34 of file Addresses.php.


Member Function Documentation

_prepareLayout (  )  [protected]

Preparing global layout

You can redefine this method in child classes for changin layout

Returns:
Mage_Core_Block_Abstract

Reimplemented from Mage_Core_Block_Abstract.

Definition at line 46 of file Addresses.php.

00047     {
00048         if ($headBlock = $this->getLayout()->getBlock('head')) {
00049             $headBlock->setTitle(Mage::helper('checkout')->__('Ship to Multiple Addresses') . ' - ' . $headBlock->getDefaultTitle());
00050         }
00051         return parent::_prepareLayout();
00052     }

getAddressesHtmlSelect ( item,
index 
)

Retrieve HTML for addresses dropdown

Parameters:
$item 
Returns:
string

Definition at line 68 of file Addresses.php.

00069     {
00070         $select = $this->getLayout()->createBlock('core/html_select')
00071             ->setName('ship['.$index.']['.$item->getQuoteItemId().'][address]')
00072             ->setId('ship_'.$index.'_'.$item->getQuoteItemId().'_address')
00073             ->setValue($item->getCustomerAddressId())
00074             ->setOptions($this->getAddressOptions());
00075 
00076         return $select->getHtml();
00077     }

getAddressOptions (  ) 

Retrieve options for addresses dropdown

Returns:
array

Definition at line 84 of file Addresses.php.

00085     {
00086         $options = $this->getData('address_options');
00087         if (is_null($options)) {
00088             $options = array();
00089             foreach ($this->getCustomer()->getAddresses() as $address) {
00090                 $options[] = array(
00091                     'value'=>$address->getId(),
00092                     'label'=>$address->format('oneline')
00093                 );
00094             }
00095             $this->setData('address_options', $options);
00096         }
00097         return $options;
00098     }

getBackUrl (  ) 

Definition at line 125 of file Addresses.php.

00126     {
00127         return Mage::getUrl('*/cart/');
00128     }

getCheckout (  ) 

Retrieve multishipping checkout model

Returns:
Mage_Checkout_Model_Type_Multishipping

Definition at line 41 of file Addresses.php.

00042     {
00043         return Mage::getSingleton('checkout/type_multishipping');
00044     }

getCustomer (  ) 

Definition at line 100 of file Addresses.php.

00101     {
00102         return $this->getCheckout()->getCustomerSession()->getCustomer();
00103     }

getItemDeleteUrl ( item  ) 

Definition at line 110 of file Addresses.php.

00111     {
00112         return $this->getUrl('*/*/removeItem', array('address'=>$item->getQuoteAddressId(), 'id'=>$item->getId()));
00113     }

getItems (  ) 

Definition at line 54 of file Addresses.php.

00055     {
00056         $items = $this->getCheckout()->getQuoteShippingAddressesItems();
00057         $itemsFilter = new Varien_Filter_Object_Grid();
00058         $itemsFilter->addFilter(new Varien_Filter_Sprintf('%d'), 'qty');
00059         return $itemsFilter->filter($items);
00060     }

getItemUrl ( item  ) 

Definition at line 105 of file Addresses.php.

00106     {
00107         return $this->getUrl('catalog/product/view/id/'.$item->getProductId());
00108     }

getNewAddressUrl (  ) 

Definition at line 120 of file Addresses.php.

00121     {
00122         return Mage::getUrl('*/multishipping_address/newShipping');
00123     }

getPostActionUrl (  ) 

Definition at line 115 of file Addresses.php.

00116     {
00117         return $this->getUrl('*/*/addressesPost');
00118     }

isContinueDisabled (  ) 

Definition at line 130 of file Addresses.php.

00131     {
00132         return !$this->getCheckout()->validateMinimumAmount();
00133     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:50 2009 for Magento by  doxygen 1.5.8