When a user hits the cart/checkout page the order is being created, however the user's products are not being correctly added onto the order.
Inside the uc_cart_checkout_form function the order is being correctly built up, products are being added etc - however at no point is the order actually being saved - so although the user can see on screen that the order has the correct value we have no record in the database of what products are associated with that order.
My quick fix was to just pop a little uc_order_save($order); into the function - but I don't understand how this can be working for anyone else - it seems quite a fundamental issue ...
One thing to note - we have a pretty stripped down checkout page, with not many panes enabled - so it might be that one of the panes are calling the order_save which makes this work in most cases ...
Comments
Comment #1
longwaveThe $order object is kept in $form_state['storage'] during the build and validate steps, then saved in uc_cart_checkout_form_submit(). What panes do you have enabled? I can't reproduce this.
Comment #2
longwaveComment #3
longwavePlease reopen if you can provide more information on how to reproduce this.
Comment #4
tonessss commentedI have the same problem. Steps I have taken to have the problem:
1. As a customer I have went and added a product
2. Go to cart page and checkout.
3. As the admin, I go and view the order that has been created (status = 'In Checkout'), but none of the products appear.
If comments these lines out (uc_cart_pages.inc) lines 122-124 the products appear in the order on the admin side:
db_delete('uc_order_products')
->condition('order_id', $order->order_id)
->execute();
Comment #5
longwaveIf I comment out those three lines, go to checkout, click Review order, click Back, click Review order again, the items in the order are duplicated.
Comment #6
tonessss commentedSo as a customer I add a product, I go to my shopping cart and click checkout. I notice that an order is created and on the admin side I can go view the order. Problem is, there are no products in that order...
Is this how it is suppose to work?
Comment #7
longwaveOh, ok, I see that's happening, and that's a bug - but not a major one, because if the customer gets to the review order screen, the products are correctly saved. It's only if the customer abandons the order on the checkout page itself that this occurs.
However, as described in #5, your fix in #4 is not the correct one.
Comment #8
wodenx commentedI think all we need to do is save the order when the checkout form is built. We're now creating a new order-id anyway, so there's nothing to be lost here (except the cost of the query). See patch at #1351104: Need to clear line items as well as products for cart orders.
Comment #9
longwaveLooks like this was fixed by the above linked issue.