ryanthompson - 2 months ago

I want to open an ecom discussion about the data structure and design around a cart and an order.

Currently the carts are their own namespace/streams. With items / adjustments / etc. The question is:

Should the cart build up cart items or should it build up an order in "cart" mode.

Couple things to consider is abandoned carts, cross over data (carts need far less information than an order). Carts are currently multi-instance so the cart can be saved as a wishlist for example (if desired).

However it means carrying a cart around and then upon checkout - spinning up an order. Or perhaps the order isn't spun up until the checkout is completed? We also have a checkout stream that helps build an order but idk if it's necessary. Perhaps at THAT point we'll start building an order object.

My personal opinion is such that we should keep carts separate from orders.. thoughts?

And I am keen to hear thoughts on the checkout process as far as where that data goes. Does a checkout start (after clicking checkout) start an order or should we use a checkout carrier object?

Let's hear it!

edster - 2 months ago

So the way I have always handled this is an order gets created AFTER the checkout information has been requested.

So you go around with your cart etc, then fill out your order information during checkout, once thats been submitted and saved, it creates an order item and presented in a non editable format for review/confirmation before proceeding to payment.

frednwt - 2 months ago

I agree, the carts should be keep separate from orders.

And also:

For accounting, order information should be statics. If the customer change is name: the order name should not change, same for the products (change info, prices, deleted), and taxe, etc. Also usualy order cannot be deleted (only canceled).

william - 2 months ago

Please fix login

First of all @ryanthompson , i know this isn't a problem for you since you are most likely always logged in. But for us who aren't, and want to help out in the forum - we need a way to more quickly login when accessing a forum post like this one. Instead of having to copy the url, then go to login, login, then paste the url again. It's such a waste of time, and i have found myself dropping off instead of answering it because of it earlier. And i was about to again. (no, too busy for a PR now:))

Now the question.

  • Cart should be cart.
  • An order, to me, is when checkout is completed. This could be once the payment has been successful or other state depending on payment. To me, an order is not an order until the purchase has been completed. Up until then, its just a cart of items. Think of it as a shopping mall. As long as you are in the store, you only carry stuff you can put back. Once you have paid, you get a receipt and the order is made.
  • I would like to se an option in the backend to have the cart as a cookie to make sure we can present it back to the user if he drops off the earth and then comes back.
  • I would like to see an option in the backend for saving the cart state if the user is logged in.
  • I would like to be able to set an option to automatically remind the user (email) of the items added to the cart that he hasn't yet checked out.

ryanthompson - 2 months ago

@william while you're right, this isn't the place for that. It has indeed been "fixed" to where it redirects you back to where you clicked on it from, for a couple months now ;-)

Carts will always bee cookie tied for picking up later. And they'll also automatically follow users as they login. Aaaand lastly that sounds like a nice addon extension to follow up on abandoned carts.

william - 2 months ago

@ryanthompson since this isn't the place for it, let's continue the discussion:) If you are not logged in. We should have a button below all comments saying "post reply". But that brings you to the login route. Since i have totally missed i could click login at the top, login and then be taken back. I always go to https://pyrocms.com/forum to login. And then paste and go back.

Yes, you are right, that could be - as in should be, extensions.