Skip to content
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

Merged
merged 1 commit into from Sep 29, 2016

Conversation

CoderMaggie
Copy link
Member

Q A
Doc fix? yes
New docs? yes
BC breaks? no
Related tickets partially #5275
License MIT

@pjedrzejewski pjedrzejewski added the Documentation Documentation related issues and PRs - requests, fixes, proposals. label Aug 5, 2016
@CoderMaggie CoderMaggie force-pushed the docs/orders branch 2 times, most recently from 49d34bf to 8048bef Compare August 12, 2016 11:58

*Order* may not have reference to *User* in case when *Order* was created by guest.
$currency = $currencyRepository->findOneByCode($currencyCode);
Copy link
Contributor

@koemeet koemeet Aug 30, 2016

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.

@CoderMaggie CoderMaggie force-pushed the docs/orders branch 2 times, most recently from 9a17773 to fb9b6a0 Compare September 14, 2016 11:20
@CoderMaggie CoderMaggie changed the title [WIP] [Documentation] Concepts: Orders [Documentation] Concepts: Orders Sep 14, 2016

Shipments
---------
Add the item to the order. And then call the **CompositeOrderProcessor** on the order to ahve everything recalculated.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... order to have ...

@@ -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.
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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).

Copy link
Member Author

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();
Copy link
Contributor

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,
Copy link
Contributor

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


*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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Order => Each Order

@pjedrzejewski
Copy link
Member

Thank you Magda! This chapter will probably grow a bit more, but this is a very good start! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Documentation related issues and PRs - requests, fixes, proposals.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants