This module was created in order to demonstrate how to use the new hooks introduced with the new "View an Order" back office page in PrestaShop 8.0.0 and below.
It uses the following hooks:
- displayAdminOrderTabContent
- displayAdminOrderTabLink
- displayAdminOrderMain
- displayAdminOrderSide
- displayAdminOrderSideBottom
- displayAdminOrder
- displayAdminOrderTop
- displayOrderPreview
- actionGetAdminOrderButtons
Please note this module is an example only, not a mandatory structure.
- Composer, see Composer to learn more
- Download or clone module into
modules
directory of your PrestaShop installation - Rename the directory to make sure that module directory is named
demovieworderhooks
* cd
into module's directory and run following commands:composer install
- to download dependencies into vendor folder
- Install module from Back Office
Because the name of the directory and the name of the main module file must match.
We use this hook to display scanned customer signature.
We use this hook to display a "Package tracking" tab. The content of this tab is provided in displayAdminOrderTabContent hook.
We use this hook to display an additional listing in the page. The listing displays package tracking informations. It is controlled and linked to displayAdminOrderTabLink tab.
We use this hook to display an additional listing in the page. The listing displays customer delivered orders.
We use this hook to display a widget showing customer's review.
We use this hook to display an additional listing in the page. The listing displays other orders from the same customer.
We use this hook to display blue previous/next order buttons in the top to ease the navigation. Please note Order page already contains these buttons, but we put some additional buttons even easier to spot.
We use this hook on orders list, it's available in quick preview of the order after clicking a little blue arrow next to order ID.
We use this hook to display additional action buttons into the main buttons bar.
In this module, we also demonstrated other usecases that you might find useful for building a module. However they are not mandatory to use in your module.
We put the install/uninstall logic of this module into a dedicated class for a better concerns separation, following SOLID principles/
We used Doctrine ORM to manage the persistence of multiple models, instead of PrestaShop ObjectModel ORM.