1
我在magento版本> = 1.9中提取問題。發送確認郵件時發生致命錯誤。 致命錯誤:致電第38行的/usr/share/iseeme-magento/app/design/frontend/base/default/template/shopsocially/items.phtml非對象上的成員函數getAllItems() 唯一這個問題本身就是當訂單確認郵件發出時。magento版本> = 1.9在發送確認郵件時報告了致命錯誤
我的模板文件是: -
<?php $_order = $this->getOrder() ?>
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #bebcb7; background:#f8f7f5;">
<thead>
<tr>
<th align="left" bgcolor="#d9e5ee" style="padding:3px 9px"><?php echo $this->__('Item') ?></th>
<th align="left" bgcolor="#d9e5ee" style="padding:3px 9px"><?php echo $this->__('Sku') ?></th>
<th align="center" bgcolor="#d9e5ee" style="padding:3px 9px"><?php echo $this->__('Qty') ?></th>
<th align="right" bgcolor="#d9e5ee" style="padding:3px 9px"><?php echo $this->__('Subtotal') ?>
</th>
</tr>
</thead>
<?php $i=0; foreach ($_order->getAllItems() as $_item): ?>
<?php if($_item->getParentItem()) continue; else $i++; ?>
<tbody<?php echo $i%2 ? ' bgcolor="#eeeded"' : '' ?>>
<?php echo $this->getItemHtml($_item) ?>
</tbody>
<?php endforeach; ?>
<tbody>
<?php echo $this->getChildHtml('order_totals') ?>
</tbody>
</table>
<br />
<p>
<?php echo $this->getChildHtml('shopsocially_email') ?>
</p>
<br />
<br />
<table cellspacing="0" cellpadding="0" border="0" width="100%" style="border:1px solid #bebcb7; background:#f8f7f5;">
<thead>
<tr>
<th align="left" bgcolor="#d9e5ee" style="padding:3px 9px"><strong><?php echo $this->__('Gift Message for this Order') ?></strong> </th>
</tr>
</thead>
<tbody>
<?php if($_order->getGiftMessageId() && $_giftMessage = $this->helper('giftmessage/message')->getGiftMessage($_order->getGiftMessageId())): ?>
<tr>
<td colspan="4" align="left" style="padding:3px 9px">
<strong><?php echo $this->__('From:'); ?></strong> <?php echo $this->htmlEscape($_giftMessage->getSender()) ?>
<br /><strong><?php echo $this->__('To:'); ?></strong> <?php echo $this->htmlEscape($_giftMessage->getRecipient()) ?>
<br /><strong><?php echo $this->__('Message:'); ?></strong><br /> <?php echo $this->htmlEscape($_giftMessage->getMessage()) ?>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
我的塊文件是: -
class ShopSocially_SocialLogin_Block_Email extends Mage_Core_Block_Template {
protected function _toHtml(){
$rez='';
if(Mage::helper('sociallogin')->isActive()){
$site=(Mage::helper('sociallogin')->isUseSandbox()?'go.shopsocially.com':'shopsocially.com');
if(Mage::helper('sociallogin')->getEmail()==1){
$rez.='<a target="_blank" href="http://'.$site.'/merchant/claim_discount?pid='.Mage::helper('sociallogin')->getPartnerId().'"><span style="text-decoration: none;"><img border="0" src="http://'.$site.'/image/'.Mage::helper('sociallogin')->getPartnerId().'/email" /> </span></a>';
}else if(Mage::helper('sociallogin')->getEmail()==2){
$rez.='<a target="_blank" href="http://'.$site.'/merchant/claim_discount?pid='.Mage::helper('sociallogin')->getPartnerId().'">'.Mage::helper('sociallogin')->__('Share your purchase with friends and make them smile').'</a>';
}
}
Mage::log($rez);
return $rez;
}
}
好的。我會查一下。 –
也許你忘了設置'ShopSocially_SocialLogin_Block_Email'塊的'訂單'數據? – Neodan