異なる注文の複数の商品を同じ配送ボックスに入れることを検討しています。理想的には、注文を発送するときに、その注文のアイテムセクションに、その顧客のすべての未決済アイテムが表示されます。アイテムを生成するコードを次のように分離しました。
app / design / adminhtml / default / mytemplate / template / sales / order / shipment / create / items.phtml
そして、そのファイルのコード行は次のようになります。
$ _items = $ this-> getShipment()-> getAllItems();
getAllItems関数に、次のコードを追加しました。
$cust_orders = Mage::getModel('sales/order')->getCollection()
->addAttributeToSelect('*')
->addAttributeToSelect('entity_id')
->addFieldToFilter('customer_id',$this->getCustomerId());
foreach ($cust_orders as $order) {
$order_id = $order->getEntityId();
$cust_items = Mage::getModel('sales/order_item')
->getCollection()
->addAttributeToSelect('*')
->addFieldToFilter('order_id', $order_id);
foreach ($cust_items as $cust_item) {
{ help! }
}
私は助けが必要です!部。新しい配列($ cust_items)を配列$itemsに正しく入れようとしています。しかし、私はその部分を理解できないようです...オブジェクトはgetItemsCollection関数を使用して入力されているようです。私がしていることが漂流してしまった…。
新しいアイデアがあれば教えてください。ありがとう。