Setting Order Status and adding custom carriers in Magento 1.5.1.0 -
Setting Order Status and adding custom carriers in Magento 1.5.1.0 -
i trying create order , assign shipping no order when order placed. see when have invoice created , shipment added , magento sets order status 'complete' automatically. tried alter status manually wouldn work.
$order = mage::getmodel('sales/order'); $order->loadbyincrementid($orderid); $order->setstate(mage_sales_model_order::state_processing, true); $order->save();
could 1 suggest me how on come this? also, how add together custom carrier ? default ones dhl, fedex , ups.. want add together 1 similar them. how doing it:
$carrier = "dhl"; $title = "dhl"; $tracknumber = '538099'; if (1) { $itemsqty = $order->getitemscollection()->count(); $shipment =mage::getmodel('sales/service_order',$order)->prepareshipment($itemsqty); $shipment = new mage_sales_model_order_shipment_api(); $shipmentid = $shipment->create($orderid); $shipment->addtrack($shipmentid,$carrier,$title,$tracknumber); }
for carrier , title, if give custom name, error invalid carrier in report. how go this? thanks.
you utilize addstatustohistory function. used adding comments.
$order->addstatustohistory('processing', 'order beingness processed', false);
param 1 (string): new status param 2 (string): comment param 3 (boolean): if want send client email notification. magento
Comments
Post a Comment