"show all pictures" in PrestaShop 1.7

Hello,

I very enjoyed Your CombinationsTabPro plugin so I have a question about another one.
Maybe You have/know the plugin for showing all the photos even if there are combinations in the product? As I know, there was that functionality in prestashop 1.6 "Display All Photos", but in the 1.7 anymore. 

Would very appreciate help!


PrestaShop expert answer about "show all pictures" button


Hello
i do not have a module like this but there are some possibilities to change it.
if you want to change it you can do it easily with minor prestashop's core change. It is required to alter file: /src/adapter/image/imageRetriever.php
You can find there a code like (somewhere near line ~46):
    public function getProductImages(array $product, Language $language)
    {
        $productAttributeId = $product['id_product_attribute'];
        $productInstance = new Product(
            $product['id_product'],
            false,
            $language->id
        );

alter it to:
    public function getProductImages(array $product, Language $language)
    {
       if (Tools::getValue('showAllPics',0) != 0) {    
            $productAttributeId = 0; } else {
        $productAttributeId = $product['id_product_attribute'];
}
        $productInstance = new Product(
            $product['id_product'],
            false,
            $language->id
        );

+ right after line:
namespace PrestaShop\PrestaShop\Adapter\Image;
add code:
use Tools;


Then in your theme template file: /themes/your-theme/templates/catalog/_partials/product-cover-thumbnails.tpl
add code like:
      {if Tools::getValue('showAllPics',0) != 0}
        <a href="{$urls.current_url}?showAllPics=1">{l s='Show All pictures'}</a>       
      {/if}
so you will have "show all pictures" button that will dispaly all product's' pictures :)

Share on Google Plus

About VEKIA

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment

0 comments:

Post a Comment