Wie kann ich beim programmgesteuerten Erstellen einer Rechnung festlegen, dass das System die Rechnung per E-Mail an den Kunden sendet?
$order=Mage::getModel('sales/order')->load($orderid);
$invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
if (!$invoice->getTotalQty()) {
Mage::throwException(Mage::helper('core')->__('Cannot create an invoice without products.'));
}
$invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
$invoice->register();
$transactionSave = Mage::getModel('core/resource_transaction')
->addObject($invoice)
->addObject($invoice->getOrder());
$transactionSave->save();
magento-1.9
email
invoice
Qaisar Satti
quelle
quelle