madrid.hqm Posted September 21, 2017 Share Posted September 21, 2017 (edited) Hi, I need to remove some manufactures name from the carousel at Home page. I used the method that was suggested in the old topic and it works but not as I expected. Now the manufactures name is displayed which I need but in place of those that are filtered there are empty spaces. Prestashop 1.6.0.8I´m using Leo Theme Aded line "{if !in_array($manufacturer.id_manufacturer,[ 6, 8, 10, 18, 19, 21, 22, 23, 24, 26, 28, 31, 32, 33, 38, 39, 42, 44, 45, 47, 48, 49, 50, 51, 52, 55, 60, 61 ])}" {if $manufacturers} <div class="widget-manufacture block"> {if isset($widget_heading)&&!empty($widget_heading)} <h4 class="title_block"> {$widget_heading} </h4> {/if} <div class="block_content"> <div class="carousel slide" id="manucarousel"> {if count($manufacturers)>$itemsperpage} <a class="carousel-control left" href="#manucarousel" data-slide="prev">‹</a> <a class="carousel-control right" href="#manucarousel" data-slide="next">›</a> {/if} <div class="carousel-inner"> {$mmanufacturers=array_chunk($manufacturers,$itemsperpage)} {foreach from=$mmanufacturers item=manufacturers name=mypLoop} <div class="item {if $smarty.foreach.mypLoop.first}active{/if}"> {foreach from=$manufacturers item=manufacturer name=manufacturers} {if $manufacturer@iteration%$columnspage==1&&$columnspage>1} <div class="row"> {/if} {if !in_array($manufacturer.id_manufacturer,[ 6, 8, 10, 18, 19, 21, 22, 23, 24, 26, 28, 31, 32, 33, 38, 39, 42, 44, 45, 47, 48, 49, 50, 51, 52, 55, 60, 61 ])} <div class="logo-manu {if $columnspage == 5}col-md-2-4 col-lg-2-4{else}col-md-{$scolumn}{/if} col-xs-12"> <a href="{$link->getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{l s='view products' mod='leomanagewidgets'}"> <img src="{$manufacturer.image|escape:'htmlall':'UTF-8'}" alt=""> </a> </div> {/if} {if ($manufacturer@iteration%$columnspage==0||$smarty.foreach.manufacturers.last)&&$columnspage>1} </div> {/if} {/foreach} </div> {/foreach} </div> </div> </div> </div> {/if} GIF example http://recordit.co/LFe0dG1po1 Edited September 21, 2017 by madrid.hqm (see edit history) Link to comment Share on other sites More sharing options...
catalin.pop Posted September 21, 2017 Share Posted September 21, 2017 Based on the code you provided (because I didn't tested it ) you can include in the verification process the creation of <div class="row"> and as well the closing </div> tag. Like this: let me know if it's working Link to comment Share on other sites More sharing options...
madrid.hqm Posted September 21, 2017 Author Share Posted September 21, 2017 let me know if it's working Thanks for trying to help me, I've already tried to move this and added line, still blank spaces Link to comment Share on other sites More sharing options...
catalin.pop Posted September 21, 2017 Share Posted September 21, 2017 ok. try to move the line one step up( and down). Like this: If it's not working paste the changed code here Link to comment Share on other sites More sharing options...
madrid.hqm Posted September 21, 2017 Author Share Posted September 21, 2017 (edited) If it's not working paste the changed code here {if $manufacturers} <div class="widget-manufacture block"> {if isset($widget_heading)&&!empty($widget_heading)} <h4 class="title_block"> {$widget_heading} </h4> {/if} <div class="block_content"> <div class="carousel slide" id="manucarousel"> {if count($manufacturers)>$itemsperpage} <a class="carousel-control left" href="#manucarousel" data-slide="prev">‹</a> <a class="carousel-control right" href="#manucarousel" data-slide="next">›</a> {/if} <div class="carousel-inner"> {$mmanufacturers=array_chunk($manufacturers,$itemsperpage)} {foreach from=$mmanufacturers item=manufacturers name=mypLoop} {if !in_array($manufacturer.id_manufacturer,[ 6, 8, 10, 18, 19, 21, 22, 23, 24, 26, 28, 31, 32, 33, 38, 39, 42, 44, 45, 47, 48, 49, 50, 51, 52, 55, 60, 61 ])} <div class="item {if $smarty.foreach.mypLoop.first}active{/if}"> {foreach from=$manufacturers item=manufacturer name=manufacturers} {if $manufacturer@iteration%$columnspage==1&&$columnspage>1} <div class="row"> {/if} <div class="logo-manu {if $columnspage == 5}col-md-2-4 col-lg-2-4{else}col-md-{$scolumn}{/if} col-xs-12"> <a href="{$link->getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)|escape:'htmlall':'UTF-8'}" title="{l s='view products' mod='leomanagewidgets'}"> <img src="{$manufacturer.image|escape:'htmlall':'UTF-8'}" alt=""> </a> </div> {if ($manufacturer@iteration%$columnspage==0||$smarty.foreach.manufacturers.last)&&$columnspage>1} </div> {/if} {/foreach} </div> {/if} {/foreach} </div> </div> </div> </div> {/if} Same thing Edited September 21, 2017 by madrid.hqm (see edit history) Link to comment Share on other sites More sharing options...
catalin.pop Posted September 21, 2017 Share Posted September 21, 2017 Can you post your website link? or PM me if you don't want to make it public. Link to comment Share on other sites More sharing options...
catalin.pop Posted September 21, 2017 Share Posted September 21, 2017 I've looked at your website and the best way is to apply filter in controller (php) and not in the template. Can you provide the code(php) where $mmanufacturers variable is set? It's much more clean and much more fast than using the template for filtering. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now