Skip to content

Commit

Permalink
feature #11134 Adding documentation of the order processor (mamazu, l…
Browse files Browse the repository at this point in the history
…chrusciel)

This PR was merged into the 1.8-dev branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         | 1.6
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | no
| Deprecations?   | no
| Related tickets | none
| License         | MIT

Adding documentation of the order processor visualization.

![image](https://user-images.githubusercontent.com/6213903/75117215-d26def00-566f-11ea-8de0-e779f608d2ad.png)
![image](https://user-images.githubusercontent.com/6213903/75117223-d732a300-566f-11ea-888b-f4c38a689f38.png)


Commits
-------

b202d68 Adding documentation of the order processor
221e9f4 Updated the image to make it clearer
89aebb4 Update docs/book/orders/orders.rst
ffd62ae [Docs] Fixed image display, code structure and semantics
c2e7d1c Better image
23a7d14 [Docs] Add missing tab
f676568 Better image
  • Loading branch information
lchrusciel committed Feb 23, 2020
2 parents 6e18023 + f676568 commit 9b3885c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Binary file added docs/_images/sylius_order_processor.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion docs/book/orders/orders.rst
Expand Up @@ -85,14 +85,23 @@ In order to change the amount of items use the **OrderItemQuantityModifier**.
$this->container->get('sylius.order_item_quantity_modifier')->modify($orderItem, 3);
Add the item to the order. And then call the **CompositeOrderProcessor** on the order to have everything recalculated.
Add the item to the order. And then call the **CompositeOrderProcessor** on the order to have
everything recalculated.

.. code-block:: php
$order->addItem($orderItem);
$this->container->get('sylius.order_processing.order_processor')->process($order);
.. note::

This **CompositeOrderProcessor** is one of the most powerful concepts. It handles whole order calculation logic and allows
for really granular operations over the order. It is called multiple times in the checkout process, and internally it works like this:

.. image:: ../../_images/sylius_order_processor.png
:align: center

Finally you have to save your order using the repository.

.. code-block:: php
Expand Down

0 comments on commit 9b3885c

Please sign in to comment.