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

Update sql link, ts extensions, and branch links #1444

Merged
merged 5 commits into from Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion development/database/structure.md
Expand Up @@ -9,7 +9,7 @@ weight: 4

### Global definition

The database structure of PrestaShop can be found in `install/data/db_structure.sql` ([1.7.3.x releases example](https://github.com/PrestaShop/PrestaShop/blob/1.7.3.x/install-dev/data/db_structure.sql)).
The database structure of PrestaShop can be found in `install/data/db_structure.sql` ([1.7.8.x releases example](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/install-dev/data/db_structure.sql)).
kpodemski marked this conversation as resolved.
Show resolved Hide resolved

It is used one time, during the installation of PrestaShop.
It contains the structure of almost all tables. If a table needs to be added or
Expand Down
Expand Up @@ -32,8 +32,8 @@ This page is very specific compared to other BO pages, it has kind of a flow - e

{{% notice %}}

All the javascript code related to this page can be found at `admin-dev/themes/new-theme/js/pages/order/create.js`.
These `.js` files are the `develop` version prior compiling. See ["How to compile assets"]({{< relref "/8/development/compile-assets" >}}) for
All the javascript code related to this page can be found at `admin-dev/themes/new-theme/js/pages/order/create.ts`.
These `.ts` files are the `develop` version prior compiling. See ["How to compile assets"]({{< relref "/8/development/compile-assets" >}}) for
more information.

{{% /notice %}}
Expand Down
46 changes: 23 additions & 23 deletions development/page-reference/back-office/order/view-order/_index.md
Expand Up @@ -9,11 +9,11 @@ title: Order view
{{% /notice %}}

This page can be reached by visiting `Sell -> Orders -> Orders -> View (grid row action)`. It allows the Back Office user to view the details of selected order and edit it. The **related code can be found in following locations**:
- Main **twig template** [src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/view.html.twig](https://github.com/PrestaShop/PrestaShop/tree/1.7.8.x/src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/view.html.twig).
- **Javascript** ([pre-compiled]({{< relref "/8/development/compile-assets" >}})) [admin-dev/themes/new-theme/js/pages/order/view](https://github.com/PrestaShop/PrestaShop/tree/1.7.8.x/admin-dev/themes/new-theme/js/pages/order/view).
- **OrderController** [src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php) (other domain controllers are used as well, those will be mentioned in related block references bellow)
- **Commands** & **Queries** at [src/Core/Domain/Order](https://github.com/PrestaShop/PrestaShop/tree/1.7.8.x/src/Core/Domain/Order) in `Command`, `Query` directories.
- Most **handlers** or **domain services implementations** can be found in `Adapter` namespace [src/Adapter/Order](https://github.com/PrestaShop/PrestaShop/tree/1.7.8.x/src/Adapter/Order)
- Main **twig template** [src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/view.html.twig](https://github.com/PrestaShop/PrestaShop/tree/8.0.x/src/PrestaShopBundle/Resources/views/Admin/Sell/Order/Order/view.html.twig).
- **Javascript** ([pre-compiled]({{< relref "/8/development/compile-assets" >}})) [admin-dev/themes/new-theme/js/pages/order/view](https://github.com/PrestaShop/PrestaShop/tree/8.0.x/admin-dev/themes/new-theme/js/pages/order/view).
- **OrderController** [src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php) (other domain controllers are used as well, those will be mentioned in related block references bellow)
- **Commands** & **Queries** at [src/Core/Domain/Order](https://github.com/PrestaShop/PrestaShop/tree/8.0.x/src/Core/Domain/Order) in `Command`, `Query` directories.
- Most **handlers** or **domain services implementations** can be found in `Adapter` namespace [src/Adapter/Order](https://github.com/PrestaShop/PrestaShop/tree/8.0.x/src/Adapter/Order)

Once opened, the page will show following blocks:

Expand All @@ -30,34 +30,34 @@ Once opened, the page will show following blocks:
{{< figure src="./img/actions-block.png" title="Order actions block" >}}

This block contains following actions:
- Status update - new order status can be selected from a dropdown. See [OrderController::updateStatusAction](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
- View invoice - generates invoice PDF. See [OrderController::generateInvoicePdfAction](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
- Print order - prepares and shows modified page layout for printing. This action is performed by javascript in [admin-dev/themes/new-theme/js/pages/order/view](https://github.com/PrestaShop/PrestaShop/tree/1.7.8.x/admin-dev/themes/new-theme/js/pages/order/view)
- Status update - new order status can be selected from a dropdown. See [OrderController::updateStatusAction](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
- View invoice - generates invoice PDF. See [OrderController::generateInvoicePdfAction](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
- Print order - prepares and shows modified page layout for printing. This action is performed by javascript in [admin-dev/themes/new-theme/js/pages/order/view](https://github.com/PrestaShop/PrestaShop/tree/8.0.x/admin-dev/themes/new-theme/js/pages/order/view)
- Refund - read about refunds [here]({{< relref "./refunds" >}}).
- Next/Previous - allows to quickly jump to next or previous order in the list (simple `href` buttons redirecting to another `View order` page).

### Customer block
{{< figure src="./img/customer-block.png" title="Order customer block" >}}

Contains information like customer `email`, `addresses`, `orders count`, `total spent sum`. Click the `View full details` link to see more information about the customer (it redirects to `Customers -> Customers -> View customer` page). This block also allows following actions:
- Editing and selecting new customer shipping and/or invoice addresses (both of these actions opens a modal with a `Customers -> Addresses -> Edit` page inside an `iframe` using the `Lite display` mode of the Back Office). See [OrderController::changeCustomerAddressAction](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
- Adding a private note (`Customer->note`). See [CustomerController::setPrivateNoteAction](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/src/PrestaShopBundle/Controller/Admin/Sell/Customer/CustomerController.php).
- Editing and selecting new customer shipping and/or invoice addresses (both of these actions opens a modal with a `Customers -> Addresses -> Edit` page inside an `iframe` using the `Lite display` mode of the Back Office). See [OrderController::changeCustomerAddressAction](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
- Adding a private note (`Customer->note`). See [CustomerController::setPrivateNoteAction](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Controller/Admin/Sell/Customer/CustomerController.php).

### Products block
{{< figure src="./img/products-block.png" title="Order products block" >}}

Contains a list of ordered products and prices summary. The list is rendered using javascript `ajax` by calling [OrderController::getProductsListAction](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php) in [order-view-page.js](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/admin-dev/themes/new-theme/js/pages/order/view/order-view-page.js). **The response of this action is not a `json`, but a rendered template**.
Contains a list of ordered products and prices summary. The list is rendered using javascript `ajax` by calling [OrderController::getProductsListAction](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php) in [order-view-page.ts](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/admin-dev/themes/new-theme/js/pages/order/view/order-view-page.ts). **The response of this action is not a `json`, but a rendered template**.

{{% notice %}}
The product list has a pagination feature, but it is **only a front-end pagination** (not the database level) - all the products are loaded into the memory and handled by javascript. See [admin-dev/themes/new-theme/js/pages/order/view/order-product-renderer.js](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/admin-dev/themes/new-theme/js/pages/order/view/order-product-renderer.js).
The product list has a pagination feature, but it is **only a front-end pagination** (not the database level) - all the products are loaded into the memory and handled by javascript. See [admin-dev/themes/new-theme/js/pages/order/view/order-product-renderer.ts](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/admin-dev/themes/new-theme/js/pages/order/view/order-product-renderer.ts).
{{% /notice %}}

The following actions can be done in this block (most of these actions are related to [OrderDetail](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/classes/order/OrderDetail.php) - one `OrderDetail` is equivalent to one row in a products list):
- Add a product - create additional `OrderDetail` for the `Order`. See [OrderController::addProductAction](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
- Remove product - remove the `OrderDetail` related to the selected product. See [OrderController::deleteProductAction](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
- Edit product price - modify the base price of the `OrderDetail` related to the selected product. See [OrderController::updateProductAction](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
- Edit product quantity - modify the quantity of the `OrderDetail` related to the selected product. See [OrderController::updateProductAction](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
- Add discount - create a new `CartRule` and assign it to this order. See [OrderController::addCartRuleAction](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
The following actions can be done in this block (most of these actions are related to [OrderDetail](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/classes/order/OrderDetail.php) - one `OrderDetail` is equivalent to one row in a products list):
- Add a product - create additional `OrderDetail` for the `Order`. See [OrderController::addProductAction](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
- Remove product - remove the `OrderDetail` related to the selected product. See [OrderController::deleteProductAction](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
- Edit product price - modify the base price of the `OrderDetail` related to the selected product. See [OrderController::updateProductAction](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
- Edit product quantity - modify the quantity of the `OrderDetail` related to the selected product. See [OrderController::updateProductAction](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
- Add discount - create a new `CartRule` and assign it to this order. See [OrderController::addCartRuleAction](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).

{{% notice %}}
It is possible to have multiple invoices related to same order, therefore when editing a product or adding a discount you can select which invoice to use.
Expand All @@ -67,23 +67,23 @@ It is possible to have multiple invoices related to same order, therefore when e
### Messages block
{{< figure src="./img/order-messages-bo.png" title="Order messages in Back Office" >}}

This block shows order messages (relies on [OrderMessage](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/classes/order/OrderMessage.php)). These messages can be visible for the customer in Front Office order details or can stay hidden - that depends on the checkbox `Display to customer`.
This block shows order messages (relies on [OrderMessage](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/classes/order/OrderMessage.php)). These messages can be visible for the customer in Front Office order details or can stay hidden - that depends on the checkbox `Display to customer`.
{{< figure src="./img/order-messages-fo.png" title="Order messages in Front Office" >}}
Predefined message can be chosen in a dropdown which contains a list of message templates from `Sell -> Customer service -> Order messages`. This page can be quickly reached by clicking a shortcut link `Configure predefined messages`. Message sending is handled by [OrderController::sendMessageAction](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php), while the related javascript code is located in [order-view-page-messages-handler.js](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/admin-dev/themes/new-theme/js/pages/order/message/order-view-page-messages-handler.js).
Predefined message can be chosen in a dropdown which contains a list of message templates from `Sell -> Customer service -> Order messages`. This page can be quickly reached by clicking a shortcut link `Configure predefined messages`. Message sending is handled by [OrderController::sendMessageAction](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php), while the related javascript code is located in [order-view-page-messages-handler.ts](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/admin-dev/themes/new-theme/js/pages/order/message/order-view-page-messages-handler.ts).

### History block
{{< figure src="./img/history-block.png" title="Order history block" >}}

This block doesn't have an actual title like others, but let's just call it "History block" for now - it's the one containing following tabs:
- Status - you can see transitions of this order statuses and update the status, you can also add an Order note in this tab. (`Order->note`). See [OrderController::setInternalNoteAction](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
- Status - you can see transitions of this order statuses and update the status, you can also add an Order note in this tab. (`Order->note`). See [OrderController::setInternalNoteAction](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
- Documents - this tab contains invoices list.
- Carriers - contains carriers information. You can change the current carrier and add a tracking number. See [OrderController::updateShippingAction](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
- Carriers - contains carriers information. You can change the current carrier and add a tracking number. See [OrderController::updateShippingAction](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
- Merchandise returns - information about refunds history.

### Payments block
{{< figure src="./img/payments-block.png" title="Order payments block" >}}

Shows a list of payments done for this order and allows manually adding a payment. See [OrderController::addPaymentAction](https://github.com/PrestaShop/PrestaShop/blob/1.7.8.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).
Shows a list of payments done for this order and allows manually adding a payment. See [OrderController::addPaymentAction](https://github.com/PrestaShop/PrestaShop/blob/8.0.x/src/PrestaShopBundle/Controller/Admin/Sell/Order/OrderController.php).

{{% notice %}}
If order total and payments amount sum differs, then a warning in this block will notify the Back Office user about the difference.
Expand Down