How to decide where module will appear?


Firstly it is necessary to say that module can have two views: one on the back office (its options, or even a configuration screen - as i described in previous steps), and one on the front office. The front office view is how and where the module is displayed within your shop's theme. The position of a module in your theme can be changed, because you might want one module's block to be placed much higher (or lower) in the page that others. In PrestaShop's parlance, this is called "transplanting", and is done using the tool available in the "Positions" page, So if you want to decide about where module will appear you can use this tool. Below you can find informations about this feature in context of Product tag icons module.

Depending on your PrestaShop's version you can go to:

  • PrestaShop 1.6: modules > positions
  • PrestaShop 1.6: desing > positions

At the top of the page, a drop-down menu enables you to only display the module in which you are interested. Select there our module "icons / pictograms on product pages".

icons position prestashop

 


You will see there list of positions where the module is attached. Some of these positions are required. List of required positions I attach below. Please do not remove from these positions - otherwise module will not work properly. If you will remove module from this position - you will be required to re-add module to these positions with "transplant" tool.

  1. displayAdminProductsExtra
  2. displayBackOfficeHeader
  3. actionAdminControllerSetMedia
  4. Header / displayHeader


The rest of positions are related to where module will appear on front of your shop. You can remove module from these positions. For example - if you do not want to display module there.

How to decide where module will appear?

  1. Unhook module
    If you do not want to display module in some positions you need to unhook it from this position.
    To unhook module from selected position - just search for this position on list of positions under "design > positions" section and click on unhook button. For example - we do not want to show module on product's Footer section. hit unhook button on module on list of modules named "displayFooterProduct"
    display footer product - unhook icons module
  2. assign module to hook
    Click the "Transplant a module" button at the top right. The transplanting interface appears. This button is available on "design > positions" page. You will open a form where you can assign module to selected positions in your shop's theme.

    Attaching a module to a hook:
    Transplanting In PrestaShop, "transplanting" is the action of attaching a module to a hook. You can add a module to more than one hook.


    Two things to know before transplanting a module:

    • Some modules are written to only be attached to a given set of hooks. Like our Product tag icons addon
    • Some hooks are written to not accept some specific kinds of modules.

    Therefore, be aware that you cannot always transplant any module to any hook. Below you can find list of hooks where module appear and position of where it will appear whitin "classic" template. Please note that your theme may have a little different position of these hooks. Usually theme developers includes these position in similar sections of the shop.

 

  1. displayAfterProductThumbs
    after thumbs product page

  2. displayLeftColumn + displayLeftColumnProduct
    left column product page

  3. displayproductAdditionalInfo
    additional info product page
  4. displayRightColumn +  displayRightColumnProduct
    right column product page
  5. displayTop
    disply top product page
  6. displayFooterProduct
    footer product page
  7. displayProductDeliveryTime - default hook that appears on list of products in prestashop 1.6. PrestaShop 1.7 does not have it in standard installation but many themes still uses it.
    product list position
  8. displayProductListReviews - this is default hook that appears on product listings in prestashop 1.7. 
    product list position
  9. displayProductPriceBlock
    icons price position icons product price page

 

Special hook ShowIcons - for advanced users only
Module creates own special hook named ShowIcons. Once you will install the module - this hook is automatically created and module is automatically associated with this hook. Thanks to this hook you can run module in any part of product page you want. Just add a hook execution code to your template .tpl files and module will appear there. Hook is applicable to Product pages and to list of products (product's miniature). Hook execution code is:

{hook h='ShowIcons' product=$product}