New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Documentation] Concepts: Orders #5705
Conversation
CoderMaggie
commented
Aug 4, 2016
Q | A |
---|---|
Doc fix? | yes |
New docs? | yes |
BC breaks? | no |
Related tickets | partially #5275 |
License | MIT |
49d34bf
to
8048bef
Compare
|
||
*Order* may not have reference to *User* in case when *Order* was created by guest. | ||
$currency = $currencyRepository->findOneByCode($currencyCode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't it a bit confusing for some people to get the Currency object again through the repository, since you already have it of the context? Then line 41 and 42 could be removed I think.
9a17773
to
fb9b6a0
Compare
|
||
Shipments | ||
--------- | ||
Add the item to the order. And then call the **CompositeOrderProcessor** on the order to ahve everything recalculated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... order to have ...
fb9b6a0
to
ef88fb0
Compare
@@ -4,117 +4,103 @@ | |||
Orders | |||
====== | |||
|
|||
*Order* model is one of the most important in Sylius, it represents the order placed via your store! It has a very consistent and clear API, which allows you to easily manipulate and process orders. | |||
**Order** model is one of the most important in Sylius, where many concepts of e-commerce meet. | |||
It represents an order that can be either placed or in progress. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... or in progress (cart).
Customer Reference | ||
------------------ | ||
**Order** holds a collection of **OrderItem** instances, which represent products from the shop, | ||
as it physical copies, with chosen variants and quantities. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as it
?
|
||
*Order* may not have reference to *User* in case when *Order* was created by guest. | ||
What is more the proper Order instance should also have the **Customer** assigned. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Customer is not mandatory for cart, but is for order. However we always need also currency, locale and exchange rate set for cart and order object. We should create factory method that will accept all these variables and returned properly constructed object. This change is in progress (for more details contact @lchrusciel).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we are describing the concept of Order. Not Cart. That is why we need a Customer.
|
||
*Order* holds a collection of *OrderItem* instances. | ||
$variant = $product->getVariants()->first(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$product->getFirstVariant()
* cancelled | ||
* returned | ||
* cart - before the checkout is completed, | ||
* new - when the order is completed after the whole checkout, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when checkout is completed cart is transformed into "new" order
ef88fb0
to
829fba6
Compare
|
||
*Order* holds a reference to specific *User*, which is available through ``getUser()`` method: | ||
The Order is **assigned to the channel** in which it has been created. Moreover the **language** the customer was using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Order
=> Each Order
829fba6
to
3abd2e8
Compare
Thank you Magda! This chapter will probably grow a bit more, but this is a very good start! :) |