Jump to content

Products page like featured page


Recommended Posts

Hi,

Not sure if this is possible, in the Front Office is it possible to display the products like in the Featured page without the descriptions. Basically I would like to show the image and if they click the "View" button the further details such as the description can be shown. Let me know where I can configure this

Link to comment
Share on other sites

To remove the featured product descriptions, change line 15 of modules/homefeatured/homefeatured.tpl (in PrestaShop v1.3.1) from:


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



to:

{*
{$product.description_short|strip_tags|truncate:130:'...'}*}



and reduce the liHeight value on line 6 of modules/homefeatured/homefeatured.tpl until there is no more grey at the bottom of the featured products block:

{assign var='liHeight' value=342}

Link to comment
Share on other sites

Make a backup of your product-list.tpl, then replace the contents of the file with the following:

{if isset($products) AND $products}

{assign var='liHeight' value=342}
{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=homeFeaturedProducts}

<a href="{$product.link}" title="{$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:27:'...'|escape:'htmlall':'UTF-8'}

{$product.description_short|strip_tags|truncate:130:'...'}
           <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')}" height="128" width="128" alt="{$product.name|escape:html:'UTF-8'}" />


{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}
               <a class="button" href="{$product.link}" title="{l s='View' mod='homefeatured'}">{l s='View' mod='homefeatured'}
               {if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2}
               <a class="exclusive ajax_add_to_cart_button" rel="ajax_id_product_{$product.id_product}" href="{$base_dir}cart.php?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'}
               {else}
{l s='Add to cart' mod='homefeatured'}
               {/if}


   {/foreach}


{/if}

Link to comment
Share on other sites

Hi,

Thanks it works now but something new. Is there some place to limit the number being shown. Also I do not want the descriptions too, so that will save space. The description can come in the "View" link

Notice in the image the top part is not aligning correctly and the bottom part the pagination does not align at the bottom of all images

29231_sLa891o6DyvL9kTlo6j6_t

29232_7iOS5cVxNpVXS7GmGVsD_t

Link to comment
Share on other sites

To change the number of products per page, go to Preferences > Products and change the "Products per page" field, then click Save at the bottom.

To remove the description, change line 12 from:


<a href="{$product.link}" title="{l s='More' mod='homefeatured'}">{$product.description_short|strip_tags|truncate:130:'...'}



to:

{*
<a href="{$product.link}" title="{l s='More' mod='homefeatured'}">{$product.description_short|strip_tags|truncate:130:'...'}*}



and reduce the height on line 3 until the background lines up at the bottom:

{assign var='liHeight' value=342}



To fix the alignment at the top, change line 2 from:



to:



To fix the pagination alignment, you will need to change line 16 of pagination.tpl (in PrestaShop v1.3.1) from:



to:





Link to comment
Share on other sites

Hi

Thanks a ton. It work. Something else new not related to the changes you asked me to make.

1. After I click check out and and give the login details. Click next at the address section I get logged out see the screenshot and the cart gets empty. This does not happen all the time.

2. I would like to move the search towards the right instead of where it is now.

I tried to look at the code in header.tpl but i get {$HOOK_TOP} where do I find that to look at how it is done to change the code?

Thanks

29338_1FGzihmJntlhfVYuOlBy_t

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...