Jump to content

[Solved] Featured products; how to show 3 products per row?


Recommended Posts

Hi,

I want to show 3 products per row in Featured products.

I've edited the homefeatured.tpl and changed the number 4 to 3 in this code {assign var='nbItemsPerLine' value=3} and uploaded the file,but nothing changes in front office, it's always showing 4 products per row.

Thank you for any input

Edited by bruce-rez (see edit history)
Link to comment
Share on other sites

It seems you also need to change your css. I believe it's global.css but I can't tell the line since you're compressing css.

 

here is the entry, loook for it in global

 

#featured-products_block_center li {
margin-right: 10px;
padding: 10px 0;
width: 126px;
height: 240px;
}

  • Like 1
Link to comment
Share on other sites

sometimes it is necessary to turn force compilation on. Moreover, you have to be sure that you edit correct file. What does it mean? It mean that sometimes module .css and .tpl files are located in the theme directory (modules/ directory and /css/ directory) - if so - you should edit them there

  • Like 1
Link to comment
Share on other sites

Nemo1, smartdatasoft

I cannot find this css code in global.css. I did Find/Replace in Dreamweaver without positive result even though I can see it in Firebug and modified the codes and working correctly.

bruce-rez,

as this featured product so you have to find on homefeatured product css file. if your theme overwrite that then first search on theme\yourtheme\css\module\homefeatured or modules\homefeatured\homefeatured.css the file name my be little wrong but you understnad which module i am telling. if you face the problem inform me i will try to help, also after edite do not forgot to force compile enable to generate new changes bruce-rebruce-rez

  • Like 1
Link to comment
Share on other sites

Ok I could find this code and I modified it, now it works.

It was located in root directory / modules / homefeatured / homefeatured.css.

Question:

Shouldn't be this file in themes > my theme > modules > homefeatured > homefeatured.css?

In my case this file was not there, it was in root directory / modules / homefeatured / homefeatured.css.

 

Thank you guys for excellent support.

Edited by bruce-rez (see edit history)
Link to comment
Share on other sites

Ok I could find this code and I modified it, now it works.

It was located in root directory / modules / homefeatured / homefeatured.css.

Question:

Shouldn't be this file in themes > my theme > modules > homefeatured > homefeatured.css?

In my case this file was not there, it was in root directory / modules / homefeatured / homefeatured.css.

 

I would appreciate if you can take a look at my other topic:

http://www.prestasho...80#entry1232180

 

Thank you guys for excellent support.

yes you are right that is either on module folder or theme folder themes\mythemes\css\mymodule\mymodule.css

as you find that and solve your issue. good :)

Link to comment
Share on other sites

  • 2 weeks later...

I went through all of the modules and disabled and enabled each of them to see which ones were loading the pages. By disabling the "New Products" module, my page loaded 4 seconds faster. On the Home page, by disabling the "Featured Products" module, I saved about 1 second. If the manufactures module seems to be holding you up then just disable it and hard code a link along with a handful of popular manufacturers or just disable the drop-down list. My page load time went from 17 to 20 seconds down to 3 to 5.5 seconds.

Edited by PartsTrader (see edit history)
Link to comment
Share on other sites

Parts Trader,

I want to increase my website speed too so I disabled the "New Products" module but it's still showing in Front-Office, in the Footer > Information > New Products.

Please see the screen shot, I want to make sure if this is module you've disableed.

post-154019-0-01252400-1370459803_thumb.jpg

Link to comment
Share on other sites

link to the new products arent related to the module configuration page. you have to remove it manually by editing this file:

 

modules/blockcms/blockcms.tpl

( or of course if exist in your theme/YOUR_THEME/blockcms/blockcms.tpl )

 

 

you've got there:

<li class="{if $PS_CATALOG_MODE}first_{/if}item"><a href="{$link->getPageLink('new-products')}" title="{l s='New products' mod='blockcms'}">{l s='New products' mod='blockcms'}</a></li>

 

just remove this line or comment it with {* *} signs:

 

{* <li class="{if $PS_CATALOG_MODE}first_{/if}item"><a href="{$link->getPageLink('new-products')}" title="{l s='New products' mod='blockcms'}">{l s='New products' mod='blockcms'}</a></li> *}

Link to comment
Share on other sites

I commented out the "New Product" in blockcms.tpl in both locations route folder and my theme.

Result:

It works fine and it's gone in the Footer.

Problem:

"New Product" is showing here (see Footer > Information): link removed

"New Product" is not showing here (see Footer > Information): link removed

 

Basic troublshooting are done:

  • Enabling Force compilation
  • Disabling Cache
  • Clearing Browser cache

Edited by bruce-rez (see edit history)
Link to comment
Share on other sites

sorry, I should be more clear

 

this is how smarty directory looks like: ("Nazwa" in polish means Name)

 

svaPzgB.png

 

so:

  • open the cache directory and remove all files (files + subdirectories)
  • then open compile directory and remove all files (files + subdirectories)

Link to comment
Share on other sites

vekia,

:D Ok, it's done.

But "New products" is still showing on Footer and Sitemap here by clicking on the Logo:

 

I have 2 more modifications/changes in Top Horizontal Menu and Footer that suffer from the similar issue, that means that are not showing by clicking on the Logo with same above link.

 

Top Horizontal Menu

I removed "Secure payment" in back office but it's still showing.

 

Footer

I added the text "Designed by BR",

The same problem, it's not showing when I click on the Logo

 

Thanks.

Edited by bruce-rez (see edit history)
Link to comment
Share on other sites

  • 3 months later...

make sure that you haven't got homefeatured.tpl file in yout theme/default/modules/homefeatured/homefeatuerd.pl path

if so  - if you have it there - this is file  where you have to append changes.

 

moreover - it is possible to share url of your website? if so - please share it - it will be very helpful in this case

Link to comment
Share on other sites

{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <[email protected]>
*  @copyright  2007-2013 PrestaShop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*}

<!-- MODULE Home Featured Products -->
<div id="featured-products_block_center" class="block products_block clearfix">
    <p class="title_block">{l s='Featured products' mod='homefeatured'}</p>
    {if isset($products) AND $products}
        <div class="block_content">
            {assign var='liHeight' value=250}
            {assign var='nbItemsPerLine' value=3}
            {assign var='nbLi' value=$products|@count}
            {math equation="nbLi/nbItemsPerLine" nbLi=$nbLi nbItemsPerLine=$nbItemsPerLine assign=nbLines}
            {math equation="nbLines*liHeight" nbLines=$nbLines|ceil liHeight=$liHeight assign=ulHeight}
            <ul style="height:{$ulHeight}px;">
            {foreach from=$products item=product name=homeFeaturedProducts}
                {math equation="(total%perLine)" total=$smarty.foreach.homeFeaturedProducts.total perLine=$nbItemsPerLine assign=totModulo}
                {if $totModulo == 0}{assign var='totModulo' value=$nbItemsPerLine}{/if}
                <li class="ajax_block_product {if $smarty.foreach.homeFeaturedProducts.first}first_item{elseif $smarty.foreach.homeFeaturedProducts.last}last_item{else}item{/if} {if $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 0}last_item_of_line{elseif $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 1} {/if} {if $smarty.foreach.homeFeaturedProducts.iteration > ($smarty.foreach.homeFeaturedProducts.total - $totModulo)}last_line{/if}">
                    <a href="{$product.link|escape:'html'}" title="{$product.name|escape:html:'UTF-8'}" class="product_image"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html'}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product.name|escape:html:'UTF-8'}" />{if isset($product.new) && $product.new == 1}<span class="new">{l s='New' mod='homefeatured'}</span>{/if}</a>
                    <p class="s_title_block"><a href="{$product.link|escape:'html'}" title="{$product.name|truncate:50:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a></p>
                    <div class="product_desc"><a href="{$product.link|escape:'html'}" title="{l s='More' mod='homefeatured'}">{$product.description_short|strip_tags|truncate:65:'...'}</a></div>
                    <div>
                        <a class="lnk_more" href="{$product.link|escape:'html'}" title="{l s='View' mod='homefeatured'}">{l s='View' mod='homefeatured'}</a>
                        {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<p class="price_container"><span class="price">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span></p>{else}<div style="height:21px;"></div>{/if}
                        
                        {if ($product.id_product_attribute == 0 OR (isset($add_prod_display) AND ($add_prod_display == 1))) AND $product.available_for_order AND !isset($restricted_country_mode) AND $product.minimal_quantity == 1 AND $product.customizable != 2 AND !$PS_CATALOG_MODE}
                            {if ($product.quantity > 0 OR $product.allow_oosp)}
                            <a class="exclusive ajax_add_to_cart_button" rel="ajax_id_product_{$product.id_product}" href="{$link->getPageLink('cart')|escape:'html'}?qty=1&id_product={$product.id_product}&token={$static_token}&add" title="{l s='Add to cart' mod='homefeatured'}">{l s='Add to cart' mod='homefeatured'}</a>
                            {else}
                            <span class="exclusive">{l s='Add to cart' mod='homefeatured'}</span>
                            {/if}
                        {else}
                            <div style="height:23px;"></div>
                        {/if}
                    </div>
                </li>
            {/foreach}
            </ul>
        </div>
    {else}
        <p>{l s='No featured products' mod='homefeatured'}</p>
    {/if}
</div>
<!-- /MODULE Home Featured Products -->

 

 

 

 

 

is my homefeatured.tpl file

Link to comment
Share on other sites

×
×
  • Create New...