mymlondon Posted January 15, 2014 Share Posted January 15, 2014 Hi guys i have a problem with my website. http://bathrooom.co.uk/ the images for the products have disappeared. I have tried, regenerating the pics, i have tried manually uploading new ones. They appear in the backend. I have found poeple who say the solution is to change the homefeatures.php file. but i cant find that file. Please Help Link to comment Share on other sites More sharing options...
Sharak Posted January 15, 2014 Share Posted January 15, 2014 (edited) Edit /themes/your_theme/modules/homefeatured/homefeatured.tpl and search the code for loading product images. In default theme it's something like this: <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'}" /> This one uses 'home_default' type of image. Yours obviously uses 'rect_default' because images load like this : http://bathrooom.co.uk/img/p/3/3/33-rect_default.jpg Now go to Preferences -> Images in admin panel and make sure you have 'rect_default' type here. If the name is different then change .tpl's code accordingly or just use 'home_default' Edited January 15, 2014 by Sharak (see edit history) Link to comment Share on other sites More sharing options...
mymlondon Posted January 15, 2014 Author Share Posted January 15, 2014 Hi Sharak Thanks for the reply and taking the time to check. this is the line in homefeatured.tpl <img class="featured_product_image" src="{$link->getImageLink($product.link_rewrite, $product.id_image, (isset($image_shape) && $image_shape == 'rect_img') ? 'rect_default' : 'home_default')}" alt="{$product.name|escape:html:'UTF-8'}" /> i tried changing the rect_default but it didnt make a difference, plus it seems home_default ( which is what is used in the admin panel) is in there heres the file {* * 2007-2012 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-2012 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 {(isset($image_shape) && $image_shape == 'rect_img') ? 'rect_img' : ' '}"> <h4>{l s='Featured products' mod='homefeatured'}</h4> {if isset($products) AND $products} <div class="grid-container"> {assign var='liHeight' value=250} {assign var='nbItemsPerLine' value=6} {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 class="grid"> {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}"> <div class="featured_product_image_wrapper group"> <a class="featured_product_image_link" href="{$product.link}" title="{$product.name|escape:html:'UTF-8'}"> {if isset($product.new) && $product.new == 1}<span class="new">{l s='New' mod='homefeatured'}</span>{/if} <img class="featured_product_image" src="{$link->getImageLink($product.link_rewrite, $product.id_image, (isset($image_shape) && $image_shape == 'rect_img') ? 'home_default' : 'home_default')}" alt="{$product.name|escape:html:'UTF-8'}" /> </a> </div> <div class="featured_product_details"> <h5><a href="{$product.link|escape:'html'}" title="{$product.name|escape:'htmlall':'UTF-8'}">{$product.name|truncate:28:'...'|escape:'htmlall':'UTF-8'}</a></h5> {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE} <div class="price_container"> <span class="price"> {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} </span> {if isset($product.reduction) && $product.reduction != 0} <span class="old-price">{convertPrice price=$product.price_without_reduction}</span> {/if} {if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE} <span class="on_sale">{l s='On sale!'}</span> {elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE} <span class="discount">{l s='On sale!'}</span> {/if} </div> {/if} </div> </li> {/foreach} </ul> </div> {else} <p>{l s='No featured products' mod='homefeatured'}</p> {/if} </div> <!-- /MODULE Home Featured Products --> Link to comment Share on other sites More sharing options...
vekia Posted January 15, 2014 Share Posted January 15, 2014 it's a homefeatured.tpl file from theme directory? or just from module dir? if this file exists in theme - you have to modify it there Link to comment Share on other sites More sharing options...
mymlondon Posted January 15, 2014 Author Share Posted January 15, 2014 (edited) Hi vekia its from the theme directory, and i did modify it there, Thanks Edited January 15, 2014 by mymlondon (see edit history) Link to comment Share on other sites More sharing options...
Sharak Posted January 15, 2014 Share Posted January 15, 2014 (edited) What's up with that? {(isset($image_shape) && $image_shape == 'rect_img') ? 'rect_img' : ' '} (isset($image_shape) && $image_shape == 'rect_img') ? 'home_default' : What is this for? It's completely messed up in my opinion. I think you should get rid of that and use default file. Edited January 15, 2014 by Sharak (see edit history) Link to comment Share on other sites More sharing options...
mymlondon Posted January 15, 2014 Author Share Posted January 15, 2014 (edited) i tried that before no luck still anyone please??? sorry Edited January 15, 2014 by mymlondon (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted January 16, 2014 Share Posted January 16, 2014 1) can you show how your modified code looks like now? 2) tried to force compile theme? (adv. paramters > performance tab) ? Link to comment Share on other sites More sharing options...
Sharak Posted January 16, 2014 Share Posted January 16, 2014 I can see it's ok now. Is it different theme or you did changes suggested? Link to comment Share on other sites More sharing options...
mymlondon Posted January 16, 2014 Author Share Posted January 16, 2014 (edited) Yea decided to change theme, like you said some of that coding was just crap i found other lines in blocks like contact info with changes which were just unnecessary, anyway trying this one out Would have tried to finish but got a deadline. Thanks to all who gave their time to try and fix the problem really really appreciate it Edited January 16, 2014 by mymlondon (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts