本文整理汇总了PHP中Mage_Sales_Block_Items_Abstract::_beforeToHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Block_Items_Abstract::_beforeToHtml方法的具体用法?PHP Mage_Sales_Block_Items_Abstract::_beforeToHtml怎么用?PHP Mage_Sales_Block_Items_Abstract::_beforeToHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Block_Items_Abstract
的用法示例。
在下文中一共展示了Mage_Sales_Block_Items_Abstract::_beforeToHtml方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _beforeToHtml
/**
* Retrieve required options from parent
*/
protected function _beforeToHtml()
{
if (!$this->getParentBlock()) {
Mage::throwException(Mage::helper('adminhtml')->__('Invalid parent block for this block.'));
}
$this->setSubscription($this->getParentBlock()->getSubscription());
$orderInfos = $this->getSubscription()->getOrderInfo();
$order = Mage::getModel('sales/order')->setData($orderInfos)->setId(null);
$this->setOrder($order);
parent::_beforeToHtml();
}
示例2: _beforeToHtml
/**
* Load all tracks and save it to local cache by shipments
*
* @return Mage_Sales_Block_Order_Print_Shipment
*/
protected function _beforeToHtml()
{
$tracksCollection = $this->getOrder()->getTracksCollection();
foreach ($tracksCollection->getItems() as $track) {
$shipmentId = $track->getParentId();
$this->_tracks[$shipmentId][] = $track;
}
$shipment = Mage::registry('current_shipment');
if ($shipment) {
$this->_shipmentsCollection = array($shipment);
} else {
$this->_shipmentsCollection = $this->getOrder()->getShipmentsCollection();
}
return parent::_beforeToHtml();
}
示例3: _beforeToHtml
/**
* Initialize data and prepare it for output
*/
protected function _beforeToHtml()
{
$this->_prepareLastOrder();
return parent::_beforeToHtml();
}