Jump to content

[SOLVED] Polecane produkty - cena poza blokiem


Recommended Posts

Przekopałem oba "homefeatured.tpl" i nigdzie nie widzę żebym miał na sztywno ustawiony height na 500px. Jedyne miejsce gdzie mam ustawione height to homefeatured.css i tam jest domyślna wartość 240px.

Gdzie leży błąd??

Link to comment
Share on other sites

wartość height ustala zmienna: {$ulHeight}

<ul style="height:{$ulHeight}px;">

jest ona wynikiem działania:

{assign var='liHeight' value=250}
{assign var='nbItemsPerLine' value=4}
{assign var='nbLi' value=$products|@count}

{math equation="nbLines*liHeight" nbLines=$nbLines|ceil liHeight=$liHeight assign=ulHeight}

 

 

rozwiązania są dwa: albo zmieniasz wartość liHeight albo po prostu wpisujesz ręcznie zamiast {$ulHeight} wartość 540

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

To dopytam: jak zmienić kolejność wyświetlania tak by najpierw była cena a później zobacz czy dodaj do koszyka. U mnie jest tak:: www.4video.eu

 

ok zatem korzystasz z niestandardowego rozwiązania,

kolejność elementów w pliku .tpl powinna wyglądać mniejwięcej tak:

{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')}?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}
<a class="lnk_more" href="{$product.link}" title="{l s='View' mod='homefeatured'}">{l s='View' mod='homefeatured'}</a>

kod powyżej pochodzi ze defaultowego homefeatured.tpl

Link to comment
Share on other sites

Nie mam za bardzo pojęcia o kodach, mozna prosić o zamianę tych linijek, to kod z mojego pliku homefeatured.tpl:

 

<!-- MODULE Home Featured Products -->
<div id="featured-products_block_center" class="block clearfix">
<h2>{l s='Featured products' mod='homefeatured'}</h2>
{if isset($products) AND $products}
                     
                        
                        <ul id="product_list" class="products_block grid show_cart clearfix">
{foreach from=$products item=product name=products}
<li class="ajax_block_product {if $smarty.foreach.products.first}first_item{elseif $smarty.foreach.products.last}last_item{/if} {if $smarty.foreach.products.index % 2}alternate_item{else}item{/if} clearfix">
<div class="left_block">
                            {if isset($comparator_max_item) && $comparator_max_item}
<p class="compare">
<input type="checkbox" class="comparator" id="comparator_item_{$product.id_product}" value="comparator_item_{$product.id_product}" {if isset($compareProducts) && in_array($product.id_product, $compareProducts)}checked="checked"{/if} autocomplete="off"/> 
<label for="comparator_item_{$product.id_product}">{l s='Select to compare' mod='homefeatured'}</label>
</p>
{/if}
</div>
<div class="center_block">
<a href="{$product.link|escape:'htmlall':'UTF-8'}" class="product_image" title="{$product.name|escape:'htmlall':'UTF-8'}">
<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html'}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" />
{if isset($product.new) && $product.new == 1}<span class="new">{l s='New' mod='homefeatured'}</span>{/if}
</a>
<h3><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.name|escape:'htmlall':'UTF-8'}">{$product.name|escape:'htmlall':'UTF-8'|truncate:35:'...'}</a></h3>
<p class="product_desc"><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}" >{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}</a></p>
</div>
<div class="right_block">
                            {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE}
{if ($product.allow_oosp || $product.quantity > 0)}
{if isset($static_token)}
<a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}&token={$static_token}", false)|escape:'html'}" title="{l s='Add to cart' mod='homefeatured'}">{l s='Add to cart' mod='homefeatured'}</a>
{else}
<a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}", false)|escape:'html'}" title="{l s='Add to cart' mod='homefeatured'}">{l s='Add to cart' mod='homefeatured'}</a>
{/if}
{else}
<span class="exclusive">{l s='Add to cart' mod='homefeatured'}</span>
{/if}
{/if}
<a class="lnk_more" href="{$product.link|escape:'htmlall':'UTF-8'}" title="{l s='View' mod='homefeatured'}">{l s='View' mod='homefeatured'}</a>
<p class="price_container">
{if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
<div class="content_price">
{if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span><br />{/if}
</div>
{if isset($product.online_only) && $product.online_only}<span class="online_only">{l s='Online only' mod='homefeatured'}</span>{/if}
{/if}
 
                                </p>
</div>
</li>
{/foreach}
</ul>
        
        
        
        
{else}
<p>{l s='No featured products' mod='homefeatured'}</p>
{/if}
</div>
<!-- /MODULE Home Featured Products -->
Link to comment
Share on other sites

w tym przypadku aby wszystko było zgodne ze sztuką trzeba będzie przebudować header.tpl, trochę roboty przy tym będzie.

inną metodą są style css, to co możesz zrobić to dodać style:

width: 800px;
margin-bottom: 40px;
float: right;

do klasy .sf-contener

Link to comment
Share on other sites

×
×
  • Create New...