When I go prepare the invoice using the Checkout Manager (created using the Basket from the MerchelloSurfactController), I am losing all the items against the invoice and the basket clears itself.
Hard to say without code examples. It's used throughout the code base. Could be that the Basket has changed before you are calling it. i.e. Logging in a user after items have been added to cart
Secondly is to do this when you create an instance of the CheckoutManager. I had a helper method that did this for me and called this whenever I needed it:
Cheers Ben and Lee. It looks like the Validate() method was being called and the item I was always testing with in my basket (d'oh) had no stock! Annoyingly there was no message bubbling up to let me know of that fact.
I found (and as Lee said) that the basket can be pretty temperamental so if you change anything, it creates a new instance of the basket and you lose data.
In fact, I ran into so many problems that I ended up writing quite a few of my own helper methods which stored things in sessions and reloaded them into the checkout context when I needed them...
This was a couple of versions back to what you're using so it may have changed.
PrepareInvoice clears basket and loses items
Hi
I am using v2.5.0 along with Umbraco v.7.6.5.
When I go prepare the invoice using the Checkout Manager (created using the Basket from the MerchelloSurfactController), I am losing all the items against the invoice and the basket clears itself.
Does anyone have any ideas what I'm doing wrong?
Thanks in advance, Sam
Hard to say without code examples. It's used throughout the code base. Could be that the Basket has changed before you are calling it. i.e. Logging in a user after items have been added to cart
Hi Sam,
I had a similar problem to this and it confused me also. This is intended behaviour in that the basket empties.
There are a couple of ways around this.
Firstly in the merchello.config (App_Plugins\Merchello\config\merchello.config) set EmptyBasketOnPaymentSuccess key to false.
Secondly is to do this when you create an instance of the CheckoutManager. I had a helper method that did this for me and called this whenever I needed it:
Hope that helps
Ben
Cheers Ben and Lee. It looks like the Validate() method was being called and the item I was always testing with in my basket (d'oh) had no stock! Annoyingly there was no message bubbling up to let me know of that fact.
That helper method sounds good, cheers.
Thanks,
Sam
I found (and as Lee said) that the basket can be pretty temperamental so if you change anything, it creates a new instance of the basket and you lose data.
In fact, I ran into so many problems that I ended up writing quite a few of my own helper methods which stored things in sessions and reloaded them into the checkout context when I needed them...
This was a couple of versions back to what you're using so it may have changed.
is working on a reply...