本文整理汇总了PHP中Mage_Sales_Block_Items_Abstract::getItemHtml方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Sales_Block_Items_Abstract::getItemHtml方法的具体用法?PHP Mage_Sales_Block_Items_Abstract::getItemHtml怎么用?PHP Mage_Sales_Block_Items_Abstract::getItemHtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Sales_Block_Items_Abstract
的用法示例。
在下文中一共展示了Mage_Sales_Block_Items_Abstract::getItemHtml方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getItemHtml
public function getItemHtml(Varien_Object $item)
{
$html = parent::getItemHtml($item);
$product = Mage::getModel('catalog/product')->load($item->getProductId());
$show = 0;
if ($item->getProductType() == 'configurable') {
$itemId = $item->getItemId();
$children = Mage::getModel('sales/order_item')->getCollection();
$children->getSelect()->where("main_table.parent_item_id = {$itemId}");
foreach ($children as $child) {
$show = $show || Mage::getModel('catalog/product')->load($child->getProductId())->getSerialCodeShowOrder();
}
}
if ($show || $product->getSerialCodeShowOrder()) {
$sc_model = Mage::getSingleton('serialcodes/serialcodes');
$name = $this->htmlEscape($item->getName());
$codetype = $item->getSerialCodeType();
$codes = explode("\n", $item->getSerialCodes());
$count = count($codes);
$local = '<span style="font-weight:normal;">';
if ($codes[0]) {
$order = Mage::getSingleton('sales/order')->load($item->getOrderId());
$codeids = array_pad(explode(',', $item->getSerialCodeIds()), $count, '');
for ($i = 0; $i < $count; $i++) {
if ($sc_model->hidePendingCodes($order, $item, $product, $codeids[$i], $i)) {
$codes[$i] = Mage::helper('serialcodes')->__('Issued when payment received.');
}
$local .= '</br>' . $codetype . ': ' . $codes[$i];
}
}
$local .= '</span>';
if (strpos($html, $name)) {
$start = strpos($html, $name) + strlen($name);
} else {
$start = strpos($html, '</h3>') + 5;
}
$test = trim(strip_tags($local));
if ($test && $test != ':') {
$html = substr_replace($html, $local, $start, 0);
}
}
return $html;
}