The items aren’t being attached to your order correctly. Make sure they are in stock with a sufficient inventory.
When you call collectTotals() on the quote and order models , it pulls in the subtotal, tax, shipping, and grand total.
I recommend getting familiar with creating an order at the quote level before converting to orders and invoices.
I’m using the code found in the great Yournamespace_Yourmodule_IndexController but i’ve a little problem.
I use this script because I import orders from a partner.
I parse a CSV file and transform it into lots of orders (csv => array => loop on magento session_quote => create order).
But when i use this code, i’m not able to clean the quote correctly.
My orders contains all products from others orders imported before.
Eg :
order 1 - product x * 2
order 2 - product from order 1 and prodcut from 2
order 3 - product from order 1and 2 and from 3… etc
I use this to clean quote at the end of my loop but this doesn’t seems to work well :(
foreach(...) { //create quote //... // use importPostData... //... // createOrder and save //... Mage::getSingleton('adminhtml/session_quote')->clear(); }
I take a look at the code into “Mage::getSingleton(’adminhtml/sales_order_create’)” but it seems to use the session_quote too. I dont find who to make this work
I’m trying to migrate orders from a custom system to Magento for historical purposes. So far, I’ve leveraged the ext_order.create method in the Drupal extension for Magento. From what I can tell, this process essentially uses the code found here: http://www.magentocommerce.com/boards/viewthread/28426/#t96650.
I’ve run into an issue with setting the price for items, since they’ve changed over time. The default process seems to use only the current item price in Magento.
I’m curious to know if anyone has had success migrating historical orders with fluctuating item prices and, if so, what methods they deployed.
Overall, I’m disappointed that this issue of importing orders into Magento has gone on for so long without a formal module to show for it, either from Varien or the community. If I can figure this, it will definitely be offered back up for the community. This feature is a “must have” in order for Magento to realize it’s full potential.
The items aren’t being attached to your order correctly. Make sure they are in stock with a sufficient inventory.
When you call collectTotals() on the quote and order models , it pulls in the subtotal, tax, shipping, and grand total.
I recommend getting familiar with creating an order at the quote level before converting to orders and invoices.
Hello jesse_dev, i’m very pleased with your code, i must say its great code to work with, but i’m having some troubles with the totals showing up properly in my store as well, my functions are as follows
public function makeQuote($customer_id,$products){ //foreach($params as $k=>$v) { $$k=$v; }
i have some renamed variables for my purposes, but this shouldn’t be affecting the code. I’m also getting ready to implement shipping into this as i found possible from another prior post of yours.
Attached are 2 screen shots, I’ve tested the code countless times, and the payment processor the client uses (sage pay) will gets the “total” passed to it, not the amount to charge, so it cannot charge the card at all.
Do you have any suggestions on how to approach this, and if so, what do you recommend as the best course of action.
I appreciate what you’ve done, you’ve taken the complex Magento order system, and turned it into a 75-150 line set of functions that completely handles all orders and relations of that aspect, making the code far more flexible and extensible.
hi there, I wish I could help you more. It would take me a long time to debug your code. A couple of things pop out. The first one is that I think you need to be invoicing the order. Creating the order is 1 step, paying for it is another. I’ve only had to do purchase order payments so far, so I might be wrong there. Another thing that pops out is you have collectTotals commented out towards the bottom, and you mentioned you’re not getting totals. You should be getting a full array of totals. I would focus on that array of totals and look at invoicing the order. The code you need is in the magento code somewhere, I would look at other areas of magento where orders are being created. good luck
Hello i’ve been able to debug my problem, its detecting the special price for some reason, when the special price is changed, you’ll see that it does work, i’ve set the “special price” to end before the current date, now its using the propery information now.
Hello i’ve been able to debug my problem, its detecting the special price for some reason, when the special price is changed, you’ll see that it does work, i’ve set the “special price” to end before the current date, now its using the proper information now. Thank you for the code, its very appreciated.
/// We need set post_index for detect default addresses ///pretty sure index is a 0 or 1 $address->setPostIndex($index); $customer->addAddress($address); $customer->setIsSubscribed(false);
///make sure password is encrypted $customer->setPassword($password); $customer->setForceConfirmed(true);
Thank you very much Jesse for your swift reply. Highly appreciated.
Sorry I wasn’t clear in my post, I want to create an order using guest profile. I have the following fields on my form
title, first name, last name, email address, telephone and address but don’t want to create customer with password. Exactly in the same manner when you place order on the website using the guest profile.