Introduction

This module adds custom fields for a product page in back office. It allows to define extra size (2x,3x) for product miniature and override it's URL and image to inject advertising banners right into the product listing.

Module General Settings

Promokit Extended Product 01


Allowed Pages - You can select on which pages to apply your custom product configuration. There is a list of all Prestashop product listing pages.


Miniature Class - This is a class of element that is a parent for all product miniature elements (html tags). It must be equal to ".js-product-miniature", exactly the same like in Classic theme.


Parent Miniature Class - Some themes (like Classic one) has parent element for "Product Miniature". If so, you have to define it's class, if there is no parent element just leave the field empty.

Here is an example of Classic theme markup where Parent element (class="product") is present.

          
  {block name='product_miniature_item'}
<div class="product"><!-- Parent Miniature Class "product" -->
<article class="product-miniature" ...><!-- Product Miniature Class "product-miniature" -->
<div class="thumbnail-container"><!-- Product Miniature Element -->
...<!-- Other Product Miniature Elements -->


Add content method

  • JS Method: If you have selected this method, the module will inject your custom product configuration into the product listing automatically using javascript code. You have to define classes for essential elements as described above. The module already has default classes adjusted to the Classic Prestashop theme.
  • Smarty Method: This is more efficient and correct way to implement the module functionality into your theme. Copy and paste following code snippet into the file /themes/YOUR_THEME/templates/catalog/_partials/miniatures/product.tpl
                    
    {assign var='miniatureClasses' value=''}
    {if isset($pkproducts[$product.id_product])}
      {if isset($pkproducts[$product.id_product]['sizeh']) && !empty($pkproducts[$product.id_product]['sizeh'])}
          {append var='miniatureClasses' value="miniature-size-x-{$pkproducts[$product.id_product]['sizeh']}"}
      {/if}
      {if isset($pkproducts[$product.id_product]['sizev']) && !empty($pkproducts[$product.id_product]['sizev'])}
          {append var='miniatureClasses' value="miniature-size-y-{$pkproducts[$product.id_product]['sizev']}"}
      {/if}
    {/if}
    
    
    and then add necessary classes to the Product Miniature element
    ... class="product-miniature {' '|implode:$miniatureClasses}"...

Product Settings

Promokit Extended Product 01

Horizontal Size — Make a product miniature wider in 2x or 3x
Promokit Extended Product 01

Vertical Size — Make a product miniature higher in 2x or 3x
Promokit Extended Product 01

Custom Link — This option allows to override a link of current product to point to another page

Custom Image — Override whole product miniature with a custom image

Used Hooks

  • displayHeader - inject module styles
  • displayBackOfficeHeader - inject necessary scripts to back office
  • displayAdminProductsMainStepleftColumnBottom - display form in the Product Settings Page
  • actionAdminProductsControllerSaveAfter - process data after click on Save button in Product Settings Page