kmalcherczyk Posted June 14, 2013 Share Posted June 14, 2013 Posiadam na stronie moduł Homefeatured który wyświetla polecane produkty jeśli wejde w konfiguracje modułu mam tylko opcję ilości wyświetlanych produktów niestety jest ona ograniczona w jakiś sposób do 10 bo mimo iż wpiszę większą wartość to nadal wyświetla 10 produktów na stronie. Chciałbym również zmienić wielkość wyświetlanych produktów na większe żeby w jednej lini mieściły się 4 i były większe. Chciałbym też żeby wyświetlało się ich 16 a nie tylko 10. Link do strony: http://serwer1374283...etowe/index.php homefeatured.tpl {* * 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.or...ses/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 * @version Release: $Revision: 6594 $ * @license http://opensource.or...ses/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"> <h4> {$lof_title = {l s='Polecane produkty' mod='homefeatured'[spam-filter] <span class="lof_title">{$lof_title|mb_substr:0:8:utf8}</span>{$lof_title|mb_substr:8:1000:utf8} </h4> {if isset($products) AND $products} <div class="block_content"> {assign var='liHeight' value=250} {assign var='nbItemsPerLine' value=5} {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> {foreach from=$products item=product name=homeFeaturedProducts} <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 - ($smarty.foreach.homeFeaturedProducts.total % $nbItemsPerLine))}last_line{/if}"> <div class="product_block"> <a href="{$product.link}" title="{$product.name|escape:html:'UTF-8'}" class="product_image"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_leoshoe')}" 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> <h5><a href="{$product.link}" title="{$product.name|truncate:50:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a></h5> <div class="product_desc"><a href="{$product.link}" title="{l s='Więcej' mod='homefeatured'}">{$product.description_short|strip_tags|truncate:65:'...'}</a> {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.php')}?qty=1&id_product={$product.id_product}&token={$static_token}&add" title="{l s='Dodaj do koszyka' mod='homefeatured'}">{l s='Kup Teraz' mod='homefeatured'}</a> {else} <span class="exclusive">{l s='Kup Teraz' mod='homefeatured'}</span> {/if} </div> <div> <a class="lnk_more" href="{$product.link}" title="{l s='Wyświetl' mod='homefeatured'}">{l s='Wyświetl' 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} {else} <div style="height:23px;"></div> {/if} </div> </div> </li> {/foreach} </ul> </div> {else} <p>{l s='Brak polecanych produktów' mod='homefeatured'}</p> {/if} </div> <!-- /MODULE Home Featured Products --> Które wartości powinienem zmienić i jak by działało właściwie, proszę o pomoc. Jeśli potrzebny jest jakiś inny plik to również go umieszczę. Pozdrawiam Link to comment Share on other sites More sharing options...
Krisso Posted June 14, 2013 Share Posted June 14, 2013 {assign var='liHeight' value=250} - zwieksz do 300 {assign var='nbItemsPerLine' value=5} - zmien na 4 - ilosc w 1 linii {$products} - foreach wskazuje ze tylko tyle ich pobierasz z bazy. Skoro zmieniłeś w systemie z 10 na więcej to zainteresuj się czy nie masz cały czas cachowania włączonego i to nie powód, że nie widzisz zmian. Link to comment Share on other sites More sharing options...
kmalcherczyk Posted June 15, 2013 Author Share Posted June 15, 2013 (edited) Niestety to chyba nie wystarczy... Strona po zmianach wygląda następująco: http://serwer1374283.home.pl/Outletowe/index.php Zmieniłem na taki kod: {assign var='liHeight' value=400} {assign var='nbItemsPerLine' value=4} Wielkość się w ogóle nie zmieniła a gdy zmieniam ilość w lini to się dziwnie przesuwa? Macie może inny pomysł? EDIT: Zauważyłem że jak w stylach zmieniam też to coś się zmienia, spróbuje i dam znać. Edited June 15, 2013 by kmalcherczyk (see edit history) Link to comment Share on other sites More sharing options...
kmalcherczyk Posted June 15, 2013 Author Share Posted June 15, 2013 (edited) Dobra sprawa wygląda tak, wszystko da się zrobić ale nie mogę zrobić żeby obrazek zrobił się na całą wielkość okna produktu i jakość zdjęcia jest jakaś dziwna również nie wiem czemu skoro zdjęcie które tam udostępniłem było wielkie. Strona: http://serwer1374283...etowe/index.php Plik CSS: #featured-products_block_center li { border-width: 1px 1px 2px 1px; border-style: solid ; border-color: #e5e5e5 #e5e5e5 #b22222 #e5e5e5; border-radius: 5px; margin: 0 17px 20px; width: 300px; height: 400px; padding: 2px; background-color: #fff; float: left; } #featured-products_block_center li.first_item { margin: 0 10px 0 0; } #featured-products_block_center li.last_item_of_line {margin-right:0;} #featured-products_block_center h5 { padding: 2px 0; color:#222; text-transform: uppercase; text-align: center; font-weight: 500; border-bottom: 1px dotted #CCCCCC; margin: 0 10px; } #featured-products_block_center h5 a { overflow: hidden; height: 25px; } .product_block { position: relative; border: 1px solid #e5e5e5; border-radius: 3px; background-color: #fff; } #featured-products_block_center .product_image { display:block; position:relative; overflow:hidden; height: 342px; margin-left: 10px; margin-right: 10px; } #featured-products_block_center .product_image img { height: 320px; width: auto; } #featured-products_block_center .product_image span.new { display: none; position: absolute; top: 15px; right:-30px; padding: 1px 4px; width: 140px; height: 140px; font-size:10px; color: #fff; text-align: center; text-transform: uppercase; -moz-transform: rotate(45deg); -webkit-transform: rotate(45deg); -o-transform:rotate(45deg); -ms-transform: rotate(45deg); background-color: #990000 } #featured-products_block_center .product_desc { height:45px; display: none; } #featured-products_block_center .product_desc, #featured-products_block_center .product_desc a { color: #fff; } #featured-products_block_center .lnk_more { display:inline; padding-right:10px; font-weight:bold; font-size:10px; color:#0088cc; background:url(img/arrow_right_1.png) no-repeat 100% 3px; display: none; } #featured-products_block_center .price_container { margin-top:10px; padding:0; } #featured-products_block_center .price { font-weight:bold; font-size: 18px; color: #990000; text-align: center; display: block; border-top: 1px dotted #CCCCCC; margin: -9px 10px 0; } #featured-products_block_center li .ajax_add_to_cart_button { background: url("img/pict_cart.png") no-repeat scroll -4px -2px #FFFFFF; border-radius: 100px 100px 100px 100px; color: #000000; font-weight: normal; left: 14px; padding: 8px 0; position: relative; text-align: center; text-indent: 19px; text-transform: uppercase; top: 35px; width: 120px; border: none; } #featured-products_block_center li .ajax_add_to_cart_button:hover { background: url("img/pict_cart_hover.png") no-repeat scroll -4px -2px #FFFFFF; } #featured-products_block_center li span.exclusive {display:none;} li.ajax_block_product > div.product_desc { position: absolute; } .product_desc { padding: 10px; background: url('img/background.png'); position: absolute; z-index: 50; } .product_desc a { font-size: 14px; color: #fff; position: relative; z-index: 100; } Edytując plik głównie skupiałem się na tych fragmentach: #featured-products_block_center li { border-width: 1px 1px 2px 1px; border-style: solid ; border-color: #e5e5e5 #e5e5e5 #b22222 #e5e5e5; border-radius: 5px; margin: 0 17px 20px; width: 300px; height: 400px; padding: 2px; background-color: #fff; float: left; } #featured-products_block_center .product_image { display:block; position:relative; overflow:hidden; height: 342px; margin-left: 10px; margin-right: 10px; } #featured-products_block_center .product_image img { height: 320px; width: auto; } #featured-products_block_center .product_image span.new { display: none; position: absolute; top: 15px; right:-30px; padding: 1px 4px; width: 140px; height: 140px; font-size:10px; color: #fff; text-align: center; text-transform: uppercase; -moz-transform: rotate(45deg); -webkit-transform: rotate(45deg); -o-transform:rotate(45deg); -ms-transform: rotate(45deg); background-color: #990000 } Mimo wielu prób i błędów nie działa... EDIT. Działa, miniaturki zmieniłem :/ Edited June 15, 2013 by kmalcherczyk (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts