Jump to content

[SOLVED] All product views showing products in irregular manner, not all rows have products


Recommended Posts

Hi Rocky,

I'm not sure where to make these changes. The following is my product list tpl code. Please help.

   {include file=$tpl_dir./pagination.tpl}
   {if $products}
       {include file=$tpl_dir./product-sort.tpl}
   {/if}



{if isset($products) AND $products}
 {assign var='liHeight' value=360}
 {assign var='nbItemsPerLine' value=4}
 {assign var='nbLi' value=$products|@count}
 {assign var='nbLines' value=$nbLi/$nbItemsPerLine|ceil}
 {assign var='ulHeight' value=$nbLines*$liHeight}
{foreach from=$products item=product name=products}
{assign var='productLink' value=$link->getProductLink($product.id_product, $product.link_rewrite, $product.category)}




         {if $product.on_sale}

{l s='On sale!'}
         {elseif ($product.reduction_price != 0 || $product.reduction_percent != 0) && ($product.reduction_from == $product.reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product.reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product.reduction_from))}

{l s='Price lowered!'}
         {/if}

{if $product.new == 1}{l s='new'}{/if}

{$product.name|escape:htmlall:'UTF-8'|truncate:1000}


{$product.description_short|strip_tags|truncate:100:'...'}


{displayWtPrice p=$product.price}

 
 

{if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2}

            {else}
{l s='Add to cart'}
           {/if}


{/foreach}
{else}

{l s='No products'}
{/if}


Link to comment
Share on other sites

I also get the following problem if I add quantity discounts or customization. I don't know how to make them align properly.

Screenshots shows how quantity discount is not aligned, when both discounts & customization are offered together, and when only customization is allowed. It's all appearing in the wrong place.

Please do help with this. Thanks

32538_BhL07Nsi4rk3xshhijhh_t

32539_XD80zWWxyZQ092KO0zUd_t

32540_EDuIfMOYAMLt2Uen1k6j_t

Link to comment
Share on other sites

It looks like all your problems are caused by elements not being cleared of previous floated elements. You just need to add code to clear them. For example, add the following to global.css:

ul#product_list li.first_item_of_line, ul.idTabs { clear: left }

Link to comment
Share on other sites

You are using a third-party theme that I'm not familiar with. It seems that theme doesn't use ul#product_list like the default PrestaShop theme. Try the following instead:

div.products_block ul li.first_item_of_line, ul.idTabs { clear: left }



If that doesn't work, you will need to set the product name and description to fixed sizes like in the default PrestaShop theme. For some reason, your theme has them on auto instead, which is causing your problem.

Link to comment
Share on other sites

Hi Rocky,

I tried that but it's not working. However, I think this piece of code is the trouble coz if I change clear: none to clear: left then only one product per row is shown.

/* Special style for block products in center column */

#center_column .products_block  {color: #595a5e; border: none;}
#center_column .products_block h4 a {color:#ff6600; float:left }
#center_column .products_block h3 {font-size:12px; color:black; padding:0.6em 0 0.6em 0.6em; margin:0 0 0.2em 0; width:645px; background:white; font-family:Century Gothic, Arial, Sans-Serif}
#center_column .products_block h3 span a{float:right; background:url('../img/plus-detail.gif') left no-repeat; padding-left:1.2em; font-size:10px; text-transform:uppercase; margin-right:0.8em; color:#c74815; font-family:'Lucida Grande',Arial,sans-serif;}
#center_column .products_block  span{ color: #999; line-height:20px}
#center_column .products_block  p a {color:#666; font-weight:normal; font-size:11px}
#center_column .products_block  .pprice {color:black; padding:0.2em;}
#center_column .products_block  .price_span {color:black; font-weight:bold; padding:0.5em 0;}
#center_column .products_block  .nav { float:right;}
#center_column .products_block  b { padding:0.1em 0.7em 0 0.7em}
#center_column .products_block  .view_it { background:url('../img/view_it.gif') no-repeat; width:17px; height:15px;}
#center_column .products_block  .add_it { background:url('../img/add_it.gif') no-repeat; width:17px; height:15px}
#center_column .products_block ul li {float: left; clear: none; width:138px; margin:0.5em 1em 0.8em 0; background:white; padding:1em;}
#center_column .products_block .new  {background:#98cb00; padding:0 0.3em 0 0.3em; position:absolute; text-align:center}
#center_column .products_block .new span  {color:white;}
#center_column .products_block .on_sale  {background:#E34514; padding:0 0.3em 0 0.3em; position:absolute; margin-top:2.7em; text-align:center}
#center_column .products_block .on_sale span  {color:white;}




I'm using the 'Element' theme.

Link to comment
Share on other sites

I think the below code (part of my product list tpl code listed above) calculates how much the height should be for the boxes, I'm not sure. Perhaps thats where my problem lies.



{if isset($products) AND $products}
 {assign var='liHeight' value=360}
 {assign var='nbItemsPerLine' value=4}
 {assign var='nbLi' value=$products|@count}
 {assign var='nbLines' value=$nbLi/$nbItemsPerLine|ceil}
 {assign var='ulHeight' value=$nbLines*$liHeight}
{foreach from=$products item=product name=products}
{assign var='productLink' value=$link->getProductLink($product.id_product, $product.link_rewrite, $product.category)}



Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...