8

Thansk to @Dhrumin. My working code here: app/code/[Vendor]/[Module]/registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, '[Vendor]_[Module]', __DIR__ ); app/code/[Vendor]/[Module]/etc/module.xml <?xml version="1.0" ?> <config xmlns:xsi="http://...


5

Yes i find the solution for my question, open below file for path and override in your o custom module. vendor/magento/module-sales/Block/Adminhtml/Order/Create/Search/Grid.php And add below code in _prepareCollection() function, $collection->joinField( 'qty_in_stock', 'cataloginventory_stock_item', 'qty',...


4

I faced same error while placing order programatically. I have made some changes in your createOrder() function. public function createOrder(Subscriptions $subscription, $originalOrder, $originalOrderItemId) { /** * @var $originalOrder \Magento\Sales\Model\Order * @var $quote \Magento\Quote\Model\Quote * @var $...


4

To get only applicable shipping methods for a given quote (based on the quote id) you can utilize Mage_Checkout_Model_Cart_Shipping_Api's method getShippingMethodsList. This method expects two (one) params: $quoteId $store=null It will return an array of available shipping methods looking like this: array(1) { [0]=> array(9) { ["carrier"]=> ...


4

Creating an order with the actual PayPal payment method is not possible, since you'll need to do an actual payment. That is why PayPal is rejecting the request; you'll also need to send a token (to initiate the request) to PayPal so they can verify it. Since you don't actually need a second payment but need it for record-keeping (as far as I can read) it ...


4

Try this: $shippingprice = 0.9; $orderObj->setShippingAmount($shippingprice); $orderObj->setBaseShippingAmount($shippingprice); $orderObj->setGrandTotal($orderObj->getGrandTotal() + $shippingprice); //adding shipping price to grand total $orderObj->save();


2

I don't think this is a bug. It's rather a limitation on how the admin edit order is implemented. When you hit Edit on and order (and when you create and order from scratch) in the backend the session is involved. See how the Mage_Adminhtml_Sales_Order_EditController and Mage_Adminhtml_Sales_Order_CreateController classes look like and what they do. So ...


2

I have found the solution after long hunt. Just passed products array to productGridAddSelected() method like below order.productGridAddSelected(products); products array must be like products[product_id]= quantity;


2

Update Since you only need to tweak the existing admin order creation you could hook to: sales_order_save_before or adminhtml_sales_order_create_process_data but make sure you add this in to the <adminhtml> node in your config.xml. Once in your Observer.php you can remove the items you wish, I would instead try to hook to a quote event also in the &...


2

did you get this solved? For anyone running into this, you need to set the shipping costs in 2 places. First of all you need to set the shipping method and WITHIN the shipping method you need to set your price. I made my own setShippingMethod function like below: public function setMyShippingMethod($shippingPrice = 0) { $result = Mage::getModel('shipping/...


2

You should collect totals at some point. I'm not sure where did you get the code to create the orders, but this guide is quite useful and worked for me in the past. Anyway try $quote->collectTotals()->save(); after you add your products to cart.


2

I am sharing one link in my answer and please go through it and just copy paste the code in your custom controller then you have to change the payment method inside $this->orderData = array( 'session' => array( 'customer_id' => $this->_sourceCustomer->getId(), 'store_id' => $this->_storeId, ), ...


2

This post helped me when I add to do something similar. First I had to create a module Rewrites_Sales overriding Mage_Sales_Model_Order_Api_V2 with this config.xml : <?xml version="1.0"?> <config> <modules> <Rewrites_Sales> <version>0.2.0</version> </Rewrites_Sales> </modules&...


2

What I think: I think, there might be some sort of asynchronous queueing done in Magento which is causing this issue. Can someone give me an explanation to this and let me know how to fix this issue? You are on the wrong track here. What happens: The product is saved within a transaction. To do something after the change has been commited to the database, ...


2

This is the way I can insert my custom block namespace Exto\StoreCredit\Model\Plugin\Admin\Order\Create; class DataPlugin extends \Magento\Backend\Block\Template { public function beforegetChildHtml($subject, $alias = '', $useCache = true){ if($alias=='totals'){ echo $this->getLayout() ->createBlock('\Magento\Backend\Block\...


2

You can check below blog for create order programmatically, I have given full demo for create order in Magento 2, Check link, Create Order Programmatically You need to skip Customer create step, In above blog, YOu need to replace, if(!$customer->getId()){ //For guest customer create new cusotmer $customer->setWebsiteId($...


2

Magento is known to deliver surprising and unexpected implementations in almost every aspect of the application. But, no, not this. It is too much. The actual code is if($this->_getResource()->isOrderIncrementIdUsed($this->getReservedOrderId())) { $this->setReservedOrderId($this->_getResource()->getReservedOrderId($this)); } Please ...


2

The above answer is correct but the standard way is not to create the Customer in case of Guest Checkout. $cartId = $this->cartManagementInterface->createEmptyCart(); /** @var \Magento\Quote\Model\Quote $quote */ $quote = $this->cartRepositoryInterface->get($cartId); $guest = true; if ...


1

Follow-up on @xhallix's answer: If you use weight-based Table Rate shipping, the shipping rate collection requires the shipping address have a defined free_method_weight. This value is calculated during quote total collection, but not saved persistently. (There's no such column on quote_address.) In other words: If you're hitting Please specify a shipping ...


1

Replace $service = Mage::getModel('sales/service_quote', $quote); with $service = Mage::getModel('sales/service_quote', $this->_quote); in the Ordercreator::create method. the problem is that $quote is not defined anywhere.


1

Create a file in root dir CreateOrder.php require_once 'app/Mage.php'; ini_set('display_startup_errors',1); //error_reporting(1); umask(0); Mage::app('default'); $quote = Mage::getModel('sales/quote') ->setStoreId(Mage::app()->getStore('default')->getId()); $product = Mage::getModel('catalog/product')->load(231); /* your product ID */ $...


1

As long as I know it's not possible. Look here: http://devdocs.magento.com/guides/m1x/api/rest/Resources/Orders/sales_orders.html It says: HTTP Method: POST /orders Description: Not implemented. HTTP Method: PUT /orders Description: Not implemented. HTTP Method: DELETE /orders Description: Not implemented. You should use SOAP instead:


1

Please check your tax calculation settings at "Admin - System - Configuration - Tax": Tax Calculation Method Based On: Total Catalog Prices: depends on your stored product prices Shipping Prices: depends on your stored product prices Apply Customer Tax: After Discount Apply Tax On: Custom price if available Edit:


1

There is actually a reorderAction() in the controller Mage_Adminhtml_Sales_Order_CreateController. That action actually does exactly what you want to do so you can either redirect to that action or copy and adapt the logic within your own custom model.


1

After some heavy investigations, I've found the cause. It was related to a 3rd party extension compatibility patch for SUPEE-6788. This patch was pushed to the preprod environment only and not on both.


1

Call to a member function getStore() on a non-object it means there is some issue with $this->getQuote() function and this->getQuote() return non object result might be because of some issue with table sales_flat_quote_payment


1

Try this $order->setShippingAmount($shippingprice); $order->setBaseShippingAmount($shippingprice); $order->save();


1

You need to do this The Proper Magento Way. Instead of adding some jQuery cruft to admin, simply change the existing validation to get it to work for you. The validation is done with js/prototype/validation.js - a file you can extend in many ways. For instance you could adjust the existing validation for telephone to get it how you want it. Or you could ...


1

In your admin template or block file: echo $this->getUrl('*/sales_order_create', array('customer_id' => 137)); This will land you on store selection page. If you already know store id you can add that as well: echo $this->getUrl('*/sales_order_create', array('customer_id' => 137, 'store_id' => 1)); EDIT Alternative method echo $this->...


1

Download the extension from http://www.freegento.com/ddl-magento-extension.php and remove and compare with this to you current installation an remove all the files associated with the extension. My guess is you have left an xml file of the extension and also check for the form.phtml file in the mentioned directory. If it does not exist there, please copy it ...


Only top voted, non community-wiki answers of a minimum length are eligible