2013-12-18 5 views
0

아래 코드는 이 아닌 "item"어레이를 제공합니다. productname을받는 방법을 모르겠습니다. 이것은 완전한 코드입니다. 모두 작동하지 않는처리 순서 Magento 제품보기

$product = Mage::getModel('catalog/product')->setStoreId($order->getStoreId())->load($item->getProductId()); 
$name = $product->getName(); 

답변

0

함께 시도

$item->getProduct()->getName() 

으로 봅니다. 마지막으로 얻습니다 : 치명적인 오류 : /home/gaveaktie/domains/gaveactie.nl/public_html/magazijnplanning.php 13 행의 객체가 아닌 getProductId() 멤버 함수를 호출하십시오.

+0

: 문제가 해결되지 않으면

<?php require_once('app/Mage.php'); Mage::app(); $orders = Mage::getModel('sales/order')->getCollection() ->addFieldToFilter('status', 'processing') ->addAttributeToSelect('customer_email') ->addAttributeToSelect('status') ; foreach ($orders as $order) { $email = $order->getCustomerEmail(); $customername = $order->getCustomerName(); $product = Mage::getModel('sales/order')->loadByIncrementID($order_id); $items = $order->getAllItems(); $itemcount=count($items); $name=array(); $sku=array(); $ids=array(); $qty=array(); foreach ($items as $itemId => $item) { $name[]=$item->getName(); $sku[]=$item->getSku(); $ids[]=$item->getProductId(); $qty[]=$item->getQtyToInvoice(); } echo $order->getId() . ": " . $order->getStatus() . ": " . $email . ": " . $customername . ": " . $name . "<br />"; } ?> 

+0

코드를 내부에 넣었습니까? foreach 루프? – Marius

관련 문제