I'm creating a partial invoice and I'm unable to get the qty invoiced
to send it to the payment gateway.
The code I'd written in my model for capture()
is:
if ($order->hasInvoices()) {
foreach ($order->getInvoiceCollection() as $invoice) {
foreach ($invoice->getAllItems() as $item) {
Mage::log($item->getQtyInvoiced()); // getting qty = 0
}
}
}
also, for the next time I do want to create the invoice then $order->hasInvoices()
returning false
.
Is the above code is right? Any note on debug the invoice items will be appreciated.
if()
block)