I'm tiring to create shipment for orders using php external script on magento version

But shipment is not create in order and not sending the email, it didn't throw any error info at all. i tried change by codes but nothing happens.

The order item loop also working fine. can someone know about the issue of these code or is there need to do some other codes to create shipment

Thank You


            $comment = 'Hello test';
            $email = true;
            $includeComment = true;                                                    
            $order = Mage::getModel('sales/order')->loadByIncrementId('100000052');

            $convertor = Mage::getModel('sales/convert_order');
            $shipment = $convertor->toShipment($order);

            foreach ($order->getAllItems() as $orderItem)

                $item = $convertor->itemToShipmentItem($orderItem);
//test name show product name which indicate order items retrieve fine
                echo $orderItem->getName();


            Mage::register('current_shipment', $shipment);


            $transactionSave = Mage::getModel('core/resource_transaction')

echo 'this also showing which means script runs without fetal errors';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.