Skip to content

Commit c0c2dcd

Browse files
authored
Merge pull request #2083 from kpodemski/improvment/9.0.x-improvements
Improvements for 9.0.x docs
2 parents 34f68e3 + 82696d4 commit c0c2dcd

File tree

5 files changed

+213
-11
lines changed

5 files changed

+213
-11
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
Title: actionGetPdfRenderer
3+
hidden: true
4+
hookTitle: 'Allows modules to provide a custom PDF renderer'
5+
files:
6+
-
7+
url: 'https://github.com/PrestaShop/PrestaShop/blob/9.0.x/classes/pdf/PDF.php'
8+
file: classes/pdf/PDF.php
9+
locations:
10+
- 'back office'
11+
type: action
12+
hookAliases:
13+
array_return: true
14+
check_exceptions: false
15+
chain: false
16+
origin: core
17+
description: 'This hook allows modules to provide a custom PDF renderer (PDFGenerator) for generating PDF documents like invoices, delivery slips, and order returns.'
18+
19+
---
20+
21+
{{% hookDescriptor %}}
22+
23+
## Parameters
24+
25+
```php
26+
[
27+
'template' => $template, // Template type string (e.g., 'Invoice', 'OrderReturn')
28+
'orientation' => $orientation, // Page orientation ('P' for portrait, 'L' for landscape)
29+
]
30+
```
31+
32+
## Expected return value
33+
34+
Return a `PDFGenerator` instance to use a custom renderer, or `null` to use the default TCPDF-based renderer.
35+
36+
## Call of the Hook in the origin file
37+
38+
```php
39+
$renderers = Hook::exec(
40+
'actionGetPdfRenderer',
41+
[
42+
'template' => $template,
43+
'orientation' => $orientation,
44+
],
45+
null,
46+
true
47+
);
48+
```
49+
50+
## Example usage
51+
52+
```php
53+
public function hookActionGetPdfRenderer($params)
54+
{
55+
// Use a custom PDF library for all templates
56+
return new MyCustomPdfGenerator($params['orientation']);
57+
}
58+
```
59+
60+
## Use cases
61+
62+
This hook is useful when you need to:
63+
64+
- Use a different PDF library (e.g., Dompdf, mPDF) instead of the default TCPDF
65+
- Apply custom PDF settings globally (fonts, margins, headers)
66+
- Implement PDF/A compliance for archiving
67+
- Add watermarks or security features to all generated PDFs
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
Title: actionGetPdfTemplateObject
3+
hidden: true
4+
hookTitle: 'Allows modules to provide custom PDF template objects'
5+
files:
6+
-
7+
url: 'https://github.com/PrestaShop/PrestaShop/blob/9.0.x/classes/pdf/PDF.php'
8+
file: classes/pdf/PDF.php
9+
locations:
10+
- 'back office'
11+
type: action
12+
hookAliases:
13+
array_return: true
14+
check_exceptions: false
15+
chain: false
16+
origin: core
17+
description: 'This hook allows modules to override the default PDF template object used for generating PDFs like invoices, delivery slips, and order returns.'
18+
19+
---
20+
21+
{{% hookDescriptor %}}
22+
23+
## Parameters
24+
25+
```php
26+
[
27+
'object' => $object, // The source object (Order, OrderReturn, etc.)
28+
'smarty' => $smarty, // Smarty template engine instance
29+
'send_bulk_flag' => $send_bulk_flag, // Boolean indicating bulk PDF generation
30+
'template' => $template, // Template type string (e.g., 'Invoice', 'OrderReturn')
31+
]
32+
```
33+
34+
## Expected return value
35+
36+
Return an `HTMLTemplate` instance to override the default template, or `false` to use the default behavior.
37+
38+
## Call of the Hook in the origin file
39+
40+
```php
41+
$templateObjects = Hook::exec(
42+
'actionGetPdfTemplateObject',
43+
[
44+
'object' => $object,
45+
'smarty' => $smarty,
46+
'send_bulk_flag' => $send_bulk_flag,
47+
'template' => $template,
48+
],
49+
null,
50+
true
51+
);
52+
```
53+
54+
## Example usage
55+
56+
```php
57+
public function hookActionGetPdfTemplateObject($params)
58+
{
59+
// Only handle invoices
60+
if ($params['template'] !== 'Invoice') {
61+
return false;
62+
}
63+
64+
// Return a custom template object
65+
return new MyCustomInvoiceTemplate(
66+
$params['object'],
67+
$params['smarty'],
68+
$params['send_bulk_flag']
69+
);
70+
}
71+
```

modules/core-updates/8.0.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Changes in PrestaShop 8.0
3-
menuTitle: Changes in 8.0
2+
title: Changes in PrestaShop 8.0.x
3+
menuTitle: Changes in 8.0.x
44
---
55

66
<style>
@@ -11,7 +11,7 @@ menuTitle: Changes in 8.0
1111
#body-inner depre::before {content: ''}
1212
</style>
1313

14-
# Notable changes in PrestaShop 8.0
14+
# Notable changes in PrestaShop 8.0.x
1515

1616
## PHP support
1717

modules/core-updates/8.1.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Changes in PrestaShop 8.1
3-
menuTitle: Changes in 8.1
2+
title: Changes in PrestaShop 8.1.x
3+
menuTitle: Changes in 8.1.x
44
---
55

66
<style>
@@ -11,7 +11,7 @@ menuTitle: Changes in 8.1
1111
#body-inner depre::before {content: ''}
1212
</style>
1313

14-
# Notable changes in PrestaShop 8.1
14+
# Notable changes in PrestaShop 8.1.x
1515

1616
## PHP support
1717

modules/core-updates/9.0.md

Lines changed: 69 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Changes in PrestaShop 9.0
3-
menuTitle: Changes in 9.0
2+
title: Changes in PrestaShop 9.0.x
3+
menuTitle: Changes in 9.0.x
44
useMermaid: true
55
---
66

@@ -12,9 +12,14 @@ useMermaid: true
1212
#body-inner depre::before {content: ''}
1313
</style>
1414

15-
# Notable changes in PrestaShop 9.0
15+
# Notable changes in PrestaShop 9.0.x
1616

17-
This section provides a list of the most significant changes in PrestaShop 9.0. While this list is not exhaustive, it aims to give developers a clear overview of the important updates. If you notice any missing or incorrect information, please help us improve by creating an issue on our [GitHub repository](https://github.com/PrestaShop/docs/issues/new).
17+
This section provides a list of the most significant changes in PrestaShop 9.0.x. While this list is not exhaustive, it aims to give developers a clear overview of the important updates. If you notice any missing or incorrect information, please help us improve by creating an issue on our [GitHub repository](https://github.com/PrestaShop/docs/issues/new).
18+
19+
{{% notice tip %}}
20+
**Quick links to patch releases:**
21+
[PrestaShop 9.0.1](#prestashop-901) | [PrestaShop 9.0.2](#prestashop-902)
22+
{{% /notice %}}
1823

1924
## PHP support
2025

@@ -797,4 +802,63 @@ The PrestaShop back office consists of [two themes][bo-themes]. Both themes have
797802
- [You can now use `{categories}` inside category URL pattern](https://github.com/PrestaShop/PrestaShop/pull/38527)
798803
- [Default category of the product is now removed from the URL](https://github.com/PrestaShop/PrestaShop/pull/37467)
799804
- [Meta keywords are no longer used in PrestaShop 9. You need to adjust your solutions not to rely on "meta_keywords" since the field is no longer available](https://github.com/PrestaShop/PrestaShop/pull/36873)
800-
- [You can now manage FeatureFlags settings in a different storage than the database](https://github.com/PrestaShop/PrestaShop/pull/32923)
805+
- [You can now manage FeatureFlags settings in a different storage than the database](https://github.com/PrestaShop/PrestaShop/pull/32923)
806+
807+
## Patch releases
808+
809+
### PrestaShop 9.0.1
810+
811+
Released on October 13, 2025. This patch release includes bug fixes and several improvements for module developers.
812+
813+
#### New hooks
814+
815+
The following hooks were added in 9.0.1:
816+
817+
| Hook | Description |
818+
|------|-------------|
819+
| [`actionOrderHasBeenShipped`]({{< relref "/9/modules/concepts/hooks/list-of-hooks/actionOrderHasBeenShipped" >}}) | Triggered when an order status changes to "shipped" |
820+
| [`actionOrderHasBeenDelivered`]({{< relref "/9/modules/concepts/hooks/list-of-hooks/actionOrderHasBeenDelivered" >}}) | Triggered when an order status changes to "delivered" |
821+
| [`actionPaymentModuleProductVarTplAfter`]({{< relref "/9/modules/concepts/hooks/list-of-hooks/actionPaymentModuleProductVarTplAfter" >}}) | Allows modification of product variables in payment module templates |
822+
| [`actionGetPdfTemplateObject`]({{< relref "/9/modules/concepts/hooks/list-of-hooks/actionGetPdfTemplateObject" >}}) | Customize PDF template objects before rendering |
823+
| [`actionCheckoutStepRenderTemplate`]({{< relref "/9/modules/concepts/hooks/list-of-hooks/actionCheckoutStepRenderTemplate" >}}) | Triggered when rendering a checkout step template |
824+
825+
#### Notable improvements
826+
827+
- [**TinyMCE Editor extensibility**](https://github.com/PrestaShop/PrestaShop/pull/39277): The TinyMCE Editor is now more flexible for module extensions
828+
- [**Enhanced `Tools::unSerialize` security**](https://github.com/PrestaShop/PrestaShop/pull/38822): Additional security measures were added to prevent potential deserialization vulnerabilities
829+
- [**Text email auto-generation**](https://github.com/PrestaShop/PrestaShop/pull/39063): New option to automatically generate text versions of email templates
830+
- [**Symfony components updated to 6.4.25**](https://github.com/PrestaShop/PrestaShop/pull/39466)
831+
832+
---
833+
834+
### PrestaShop 9.0.2
835+
836+
Released on December 10, 2025. This patch release includes important fixes and a breaking change for Admin API resources.
837+
838+
#### Breaking change
839+
840+
{{% notice warning %}}
841+
**[Module API resources updated to version 0.2.0](https://github.com/PrestaShop/PrestaShop/pull/40212)**
842+
843+
If your module uses the Admin API resources, you may need to update your implementation. The API normalization mapper indexes have been enhanced, which could affect how your module interacts with the API.
844+
{{% /notice %}}
845+
846+
#### New hooks
847+
848+
The following hooks were added in 9.0.2 for stock and quantity management:
849+
850+
| Hook | Description |
851+
|------|-------------|
852+
| [`actionOverrideQuantityAvailableByProduct`]({{< relref "/9/modules/concepts/hooks/list-of-hooks/actionOverrideQuantityAvailableByProduct" >}}) | Override the available quantity for a product |
853+
| [`actionCheckAttributeQuantity`]({{< relref "/9/modules/concepts/hooks/list-of-hooks/actionCheckAttributeQuantity" >}}) | Check attribute quantity during cart operations |
854+
| [`actionOverrideProductQuantity`]({{< relref "/9/modules/concepts/hooks/list-of-hooks/actionOverrideProductQuantity" >}}) | Override product quantity calculations |
855+
856+
These hooks are particularly useful for modules that manage stock across multiple warehouses or implement custom inventory logic.
857+
858+
#### Hook fix
859+
860+
{{% notice info %}}
861+
**[`actionAttributeCombinationSave` now works correctly](https://github.com/PrestaShop/PrestaShop/pull/38617)**
862+
863+
The `actionAttributeCombinationSave` hook was never being triggered in PrestaShop 9.0.0. This has been fixed in 9.0.2. If you have modules that rely on this hook, they will now function as expected.
864+
{{% /notice %}}

0 commit comments

Comments
 (0)