我正在尝试部分捕获捆绑产品,为此,我正在尝试使用事件来检索它
$observer->getEvent()->getInvoice();
我无法拿到儿童用品
foreach($invoice->getAllItems() as $item){}
请帮助我使用sales_order_payment_capture
事件
config.xml
<observers>
<ValitorOmni_hooksystem_invoice_about_to_be_captured>
<type>singleton</type>
<class>ValitorOmnipayment/observer</class>
<method>salesOrderPaymentCapture</method>
</ValitorOmni_hooksystem_invoice_about_to_be_captured>
</observers>
</sales_order_payment_capture>```
observer.php
``` public function salesOrderPaymentCapture($event)
{
self::$invoiceBeingPayedFor = $event->getInvoice();
}```
abstract.php
```foreach($invoice->getAllItems() as $item) /* @var $item Mage_Sales_Model_Order_Invoice_Item */
{
$data = $item->__toArray();
$orderLines[] = array(
'description'=>$data['name'],
'itemId'=>$data['sku'],
'quantity'=>$data['qty']
);
}```