I need to create an order programmatically where both the payment method and shipping method will not be coming from the list provided for in Magento. Is this actually possible?
$quote->getBillingAddress()->addData($address); $quote->getShippingAddress()->addData($shippingAddress); $shippingAddress = $quote->getShippingAddress(); $shippingAddress->setCollectShippingRates(true) ->collectShippingRates() ->setShippingMethod('freeshipping_freeshipping'); //shipping method $quote->setPaymentMethod('checkmo'); $quote->setInventoryProcessed(true); $quote->save(); $quote->getPayment()->importData(['method' => 'checkmo']); $quote->collectTotals()->save();
I am tasked with having to create a plugin that "imports" the orders from a non Magento website (just like eBay) and then saving them as Magento orders. Since the non magento website have their own payment method and the fact that the orders has already been paid for in the other site, I just need to reflect on the Magento order the payment of the details and how much the shippment amount is, instead of recomputing them. Is this actually possible?