Skip to content

Commit

Permalink
Merge pull request #1744 from thomasnares/figmaHook
Browse files Browse the repository at this point in the history
Figma hook page
kpodemski authored Dec 19, 2023
2 parents 05bd8cc + 2adc70d commit 763e4c3
Showing 17 changed files with 404 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/concepts/hooks/list-of-hooks/_index.md
Original file line number Diff line number Diff line change
@@ -17,6 +17,10 @@ For example, `actionAdminCustomersFormModifier` is documented as `action<AdminCo
A regex based search has been implemented, and generic hooks should be matched. However, when you see a controller name or action in the hook name and you can't find it, try searching for a part of the hook name, like `FormModifier`.
{{% /notice %}}

{{% notice tip %}}
Looking for available hooks in the front office? Check out our [Hook mapping project]({{<relref "/8/themes/hummingbird/hooks">}}), which provides a visual representation of hook availability in the Hummingbird theme.
{{% /notice %}}

## Search for a hook

<div id="hookFilter" class="quickfilter">
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
Title: displayContentWrapperBottom
hidden: true
hookTitle: 'Content wrapper section (bottom)'
files:
-
theme: Classic
url: 'https://github.com/PrestaShop/classic-theme/blob/develop/templates/layouts/layout-both-columns.tpl'
file: 'Classic Theme: templates/layouts/layout-both-columns.tpl'
-
theme: Classic
url: 'https://github.com/PrestaShop/classic-theme/blob/develop/templates/layouts/layout-content-only.tpl'
file: 'Classic Theme: templates/layouts/layout-content-only.tpl'
-
theme: Classic
url: 'https://github.com/PrestaShop/classic-theme/blob/develop/templates/layouts/layout-full-width.tpl'
file: 'Classic Theme: templates/layouts/layout-full-width.tpl'
-
theme: Classic
url: 'https://github.com/PrestaShop/classic-theme/blob/develop/templates/layouts/layout-left-column.tpl'
file: 'Classic Theme: templates/layouts/layout-left-column.tpl'
-
theme: Classic
url: 'https://github.com/PrestaShop/classic-theme/blob/develop/templates/layouts/layout-right-column.tpl'
file: 'Classic Theme: templates/layouts/layout-right-column.tpl'
locations:
- 'front office'
type: display
hookAliases:
origin: theme
array_return: false
check_exceptions: false
chain: false
description: 'This hook displays new elements in the bottom of the content wrapper'

---

{{% hookDescriptor %}}

## Call of the Hook in the origin file

```php
{hook h='displayContentWrapperBottom'}
```
44 changes: 44 additions & 0 deletions modules/concepts/hooks/list-of-hooks/displayContentWrapperTop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
Title: displayContentWrapperTop
hidden: true
hookTitle: 'Content wrapper section (top)'
files:
-
theme: Classic
url: 'https://github.com/PrestaShop/classic-theme/blob/develop/templates/layouts/layout-both-columns.tpl'
file: 'Classic Theme: templates/layouts/layout-both-columns.tpl'
-
theme: Classic
url: 'https://github.com/PrestaShop/classic-theme/blob/develop/templates/layouts/layout-content-only.tpl'
file: 'Classic Theme: templates/layouts/layout-content-only.tpl'
-
theme: Classic
url: 'https://github.com/PrestaShop/classic-theme/blob/develop/templates/layouts/layout-full-width.tpl'
file: 'Classic Theme: templates/layouts/layout-full-width.tpl'
-
theme: Classic
url: 'https://github.com/PrestaShop/classic-theme/blob/develop/templates/layouts/layout-left-column.tpl'
file: 'Classic Theme: templates/layouts/layout-left-column.tpl'
-
theme: Classic
url: 'https://github.com/PrestaShop/classic-theme/blob/develop/templates/layouts/layout-right-column.tpl'
file: 'Classic Theme: templates/layouts/layout-right-column.tpl'
locations:
- 'front office'
type: display
hookAliases:
origin: theme
array_return: false
check_exceptions: false
chain: false
description: 'This hook displays new elements in the top of the content wrapper'

---

{{% hookDescriptor %}}

## Call of the Hook in the origin file

```php
{hook h='displayContentWrapperTop'}
```
69 changes: 69 additions & 0 deletions modules/concepts/hooks/list-of-hooks/displayPDF<Template>.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
Title: displayPDF<Template>
hidden: true
hookTitle: 'Add content to PDF templates'
files:
-
url: 'https://github.com/PrestaShop/PrestaShop/blob/8.1.x/pdf/delivery-slip.tpl'
file: 'pdf/delivery-slip.tpl'
-
url: 'https://github.com/PrestaShop/PrestaShop/blob/8.1.x/pdf/invoice-b2b.tpl'
file: 'pdf/invoice-b2b.tpl'
-
url: 'https://github.com/PrestaShop/PrestaShop/blob/8.1.x/pdf/invoice.tpl'
file: 'pdf/invoice.tpl'
-
url: 'https://github.com/PrestaShop/PrestaShop/blob/8.1.x/pdf/order-return.tpl'
file: 'pdf/order-return.tpl'
-
url: 'https://github.com/PrestaShop/PrestaShop/blob/8.1.x/pdf/order-slip.tpl'
file: 'pdf/order-slip.tpl'
locations:
- 'front office'
- 'back office'
type: display
hookAliases:
origin: theme
array_return: false
check_exceptions: false
chain: false
description: 'Allows to add content in HTML to PDF templates'

---

{{% hookDescriptor %}}

## Call of the Hook in the origin file

```php
<!-- Hook -->
{if isset($HOOK_DISPLAY_PDF)}
<tr>
<td colspan="12" height="30">&nbsp;</td>
</tr>

<tr>
<td colspan="12">
{$HOOK_DISPLAY_PDF}
</td>
</tr>
{/if}
```

This hook is a dynamic hook, generated in `classes/pdf/HTMLTemplate.php`:

```php
$template = ucfirst(str_replace('HTMLTemplate', '', get_class($this)));
$hook_name = 'displayPDF' . $template;

$this->smarty->assign([
'HOOK_DISPLAY_PDF' => Hook::exec(
$hook_name,
[
'object' => $object,
// The smarty instance is a clone that does NOT escape HTML
'smarty' => $this->smarty,
]
),
]);
```
32 changes: 32 additions & 0 deletions modules/concepts/hooks/list-of-hooks/displayWrapperBottom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
Title: displayWrapperBottom
hidden: true
hookTitle: 'Main wrapper section (bottom)'
files:
-
theme: Classic
url: 'https://github.com/PrestaShop/classic-theme/blob/develop/templates/layouts/layout-both-columns.tpl'
file: 'Classic Theme: templates/layouts/layout-both-columns.tpl'
-
theme: Classic
url: 'https://github.com/PrestaShop/classic-theme/blob/develop/templates/checkout/checkout.tpl'
file: 'Classic Theme: templates/checkout/checkout.tpl'
locations:
- 'front office'
type: display
hookAliases:
origin: theme
array_return: false
check_exceptions: false
chain: false
description: 'This hook displays new elements in the bottom of the main wrapper'

---

{{% hookDescriptor %}}

## Call of the Hook in the origin file

```php
{hook h='displayWrapperBottom'}
```
32 changes: 32 additions & 0 deletions modules/concepts/hooks/list-of-hooks/displayWrapperTop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
Title: displayWrapperTop
hidden: true
hookTitle: 'Main wrapper section (top)'
files:
-
theme: Classic
url: 'https://github.com/PrestaShop/classic-theme/blob/develop/templates/layouts/layout-both-columns.tpl'
file: 'Classic Theme: templates/layouts/layout-both-columns.tpl'
-
theme: Classic
url: 'https://github.com/PrestaShop/classic-theme/blob/develop/templates/checkout/checkout.tpl'
file: 'Classic Theme: templates/checkout/checkout.tpl'
locations:
- 'front office'
type: display
hookAliases:
origin: theme
array_return: false
check_exceptions: false
chain: false
description: 'This hook displays new elements in the top of the main wrapper'

---

{{% hookDescriptor %}}

## Call of the Hook in the origin file

```php
{hook h='displayWrapperTop'}
```
4 changes: 4 additions & 0 deletions themes/_index.md
Original file line number Diff line number Diff line change
@@ -15,4 +15,8 @@ The default PrestaShop installation offers the neutral "Classic theme", enabling

Several marketplaces are available to get PrestaShop themes. As a graphic designer/front developer, you can put your themes up for sale on this marketplaces.

{{% notice note %}}
A new theme, Hummingbird, is being developed by the maintainer team. While under develoment, [you can start to discover it here]({{<relref "/8/themes/hummingbird">}}).
{{% /notice %}}

{{% children /%}}
20 changes: 20 additions & 0 deletions themes/hummingbird/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Hummingbird Theme
weight: 5
---

# Hummingbird Theme

Hummingbird is a PrestaShop theme that aims to replace Classic as a new default theme for the PrestaShop.

Read more about Hummingbird [in the announcement of the new theme for PrestaShop](https://build.prestashop-project.org/news/2022/new-theme-announce/).

Want to test it? Want to contribute to the project and share the feedback with the team? See [Hummingbird Github repository](https://github.com/PrestaShop/hummingbird).

{{% notice info %}}
Please note that the Hummingbird theme is still under development and is not considered production-ready.
{{% /notice %}}

## Hook mapping project for the Hummingbird theme

A visual map of hooks for the Hummingbird theme has been created, [find more information about the project here]({{<relref "/8/themes/hummingbird/hooks">}}).
12 changes: 12 additions & 0 deletions themes/hummingbird/hooks/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Hooks on Hummingbird Theme
weight: 3
---

# Hooks on Hummingbird Theme

Hummingbird theme introduced a brand new UI for the PrestaShop front office.

A visual map of hook locations was created by the Product Design team at PrestaShop.

{{% children /%}}
16 changes: 16 additions & 0 deletions themes/hummingbird/hooks/cartpage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: Cart page
weight: 5
---

# Cart page

<iframe style="border: 1px solid rgba(0, 0, 0, 0.1);" width="100%" height="450" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FHKGzVBx5p2JaFrFocGe6p0%2FHook-Cartography%3Ftype%3Ddesign%26node-id%3D128%253A15450%26mode%3Ddev" allowfullscreen></iframe>

| Hook | |
| --- | --- |
| `displayShoppingCart` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayShoppingCart">}}) |
| `displayCartExtraProductActions` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayCartExtraProductActions">}}) |
| `displayReassurance` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayReassurance">}}) |
| `displayShoppingCartFooter` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayShoppingCartFooter">}}) |
| `displayCrossSellingShoppingCart` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayCrossSellingShoppingCart">}}) |
13 changes: 13 additions & 0 deletions themes/hummingbird/hooks/categorypage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Category page
weight: 3
---
# Category page

<iframe style="border: 1px solid rgba(0, 0, 0, 0.1);" width="100%" height="450" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FHKGzVBx5p2JaFrFocGe6p0%2FHook-Cartography%3Ftype%3Ddesign%26node-id%3D128%253A15444%26mode%3Ddev" allowfullscreen></iframe>

| Hook | |
| --- | --- |
| `displayLeftColumn` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayLeftColumn">}}) |
| `displayHeaderCategory` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayHeaderCategory">}}) |
| `displayFooterCategory` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayFooterCategory">}}) |
23 changes: 23 additions & 0 deletions themes/hummingbird/hooks/checkoutflow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Checkout flow
weight: 3
---

# Checkout flow

<iframe style="border: 1px solid rgba(0, 0, 0, 0.1);" width="100%" height="450" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FHKGzVBx5p2JaFrFocGe6p0%2FHook-Cartography%3Ftype%3Ddesign%26node-id%3D128%253A15452%26mode%3Ddev" allowfullscreen></iframe>

| Hook | |
| --- | --- |
| `displayPersonalInformationTop` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayPersonalInformationTop">}}) |
| `displayCustomerAccountForm` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayCustomerAccountForm">}}) |
| `displayCheckoutSummaryTop` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayCheckoutSummaryTop">}}) |
| `displayReassurance` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayReassurance">}}) |
| `displayBeforeCarrier` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayBeforeCarrier">}}) |
| `displayAfterCarrier` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayAfterCarrier">}}) |
| `displayPaymentTop` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayPaymentTop">}}) |
| `displayPaymentByBinaries` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayPaymentByBinaries">}}) |
| `displayPaymentReturn` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayPaymentReturn">}}) |
| `displayOrderConfirmation` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayOrderConfirmation">}}) |
| `displayRightColumn` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayRightColumn">}}) |
| `displayOrderConfirmation2` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayOrderConfirmation2">}}) |
14 changes: 14 additions & 0 deletions themes/hummingbird/hooks/connexionpage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: Connexion page
weight: 3
---

# Connexion page

<iframe style="border: 1px solid rgba(0, 0, 0, 0.1);" width="100%" height="450" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FHKGzVBx5p2JaFrFocGe6p0%2FHook-Cartography%3Ftype%3Ddesign%26node-id%3D128%253A15461%26mode%3Ddev" allowfullscreen></iframe>

| Hook | |
| --- | --- |
| `displayCustomerLoginFormAfter` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayCustomerLoginFormAfter">}}) |
| `displayCustomerAccountFormTop` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayCustomerAccountFormTop">}}) |
| `displayCustomerAccountForm` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayCustomerAccountForm">}}) |
15 changes: 15 additions & 0 deletions themes/hummingbird/hooks/contactpage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Contact page
weight: 3
---

# Contact page

<iframe style="border: 1px solid rgba(0, 0, 0, 0.1);" width="100%" height="450" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FHKGzVBx5p2JaFrFocGe6p0%2FHook-Cartography%3Ftype%3Ddesign%26node-id%3D128%253A15459%26mode%3Ddev" allowfullscreen></iframe>

| Hook | |
| --- | --- |
| `displayContactLeftColumn` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayContactLeftColumn">}}) |
| `displayContactRightColumn` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayContactRightColumn">}}) |
| `displayContactContent` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayContactContent">}}) |
| `displayGDPRContent` | |
27 changes: 27 additions & 0 deletions themes/hummingbird/hooks/homepage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
title: Home page
weight: 3
---

# Home page

<iframe style="border: 1px solid rgba(0, 0, 0, 0);" width="100%" height="450" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FHKGzVBx5p2JaFrFocGe6p0%2FHook-Cartography%3Ftype%3Ddesign%26node-id%3D128%253A15442%26mode%3Ddesign%26t%3DIcCnIO2KXW3WErLh-1" allowfullscreen></iframe>

| Hook | |
| --- | --- |
| `displayAfterTitleTag` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayAfterTitleTag">}}) |
| `displayAfterBodyOpeningTag` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayAfterBodyOpeningTag">}}) |
| `displayBanner` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayBanner">}}) |
| `displayNav1` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayNav1">}}) |
| `displayNav2` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayNav2">}}) |
| `displayTop` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayTop">}}) |
| `displayNavFullWidth` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayNavFullWidth">}}) |
| `displayWrapperTop` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayWrapperTop">}}) |
| `displayContentWrapperTop` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayContentWrapperTop">}}) |
| `displayContentWrapperBottom` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayContentWrapperBottom">}}) |
| `displayWrapperBottom` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayWrapperBottom">}}) |
| `displayFooterBefore` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayFooterBefore">}}) |
| `displayFooter` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayFooter">}}) |
| `displayMyAccountBlock` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayMyAccountBlock">}}) |
| `displayFooterAfter` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayFooterAfter">}}) |
| `displayBeforeBodyClosingTag` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayBeforeBodyClosingTag">}}) |
14 changes: 14 additions & 0 deletions themes/hummingbird/hooks/myaccount.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
title: My account
weight: 3
---

# My account

<iframe style="border: 1px solid rgba(0, 0, 0, 0.1);" width="100%" height="450" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FHKGzVBx5p2JaFrFocGe6p0%2FHook-Cartography%3Ftype%3Ddesign%26node-id%3D128%253A15463%26mode%3Ddev" allowfullscreen></iframe>

| Hook | |
| --- | --- |
| `displayCustomerAccount` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayCustomerAccount">}}) |
| `displayOrderDetail` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayOrderDetail">}}) |
| `displayAdditionalCustomerAddressFields` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayAdditionalCustomerAddressFields">}}) |
21 changes: 21 additions & 0 deletions themes/hummingbird/hooks/productpage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Product page
weight: 3
---

# Product page

<iframe style="border: 1px solid rgba(0, 0, 0, 0.1);" width="100%" height="450" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FHKGzVBx5p2JaFrFocGe6p0%2FHook-Cartography%3Ftype%3Ddesign%26node-id%3D128%253A15447%26mode%3Ddev" allowfullscreen></iframe>

| Hook | |
| --- | --- |
| `displayProductActions` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayProductActions">}}) |
| `displayProductAdditionalInfo` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayProductAdditionalInfo">}}) |
| `displayAfterProductThumbs` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayAfterProductThumbs">}}) |
| `displayReassurance` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayReassurance">}}) |
| `displayLeftColumnProduct` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayLeftColumnProduct">}}) |
| `displayRightColumnProduct` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayRightColumnProduct">}}) |
| `displayFooterProduct` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayFooterProduct">}}) |
| `displayCardModalContent` | |
| `displayCardModalFooter` | |
| `displayProductAdditionalInfo` | [Documentation]({{< relref "/8/modules/concepts/hooks/list-of-hooks/displayProductAdditionalInfo">}}) |

0 comments on commit 763e4c3

Please sign in to comment.