Jump to content

help with featured products module


zee28

Recommended Posts

yeah so basically it takes up the centre, left and right column. I also want to increase the size of the image and text on it

 

You have to exclude all the modules from the slider to show on the home page and then make the width of the module 100% in order to take all the width and then fix the size of the images

Link to comment
Share on other sites

Text size : themes/youtheme/css/modules/homefeatured/homefeatured.css (If something in that path doesn't exist, create it, if the css doesn't exist, copy the one from the module (modules/homefeatured/homefeatured.css)

 

Image size : I think it takes the "home_default" size, I don't have the code in fornt of me, but you can trust me I'm a genius and a jedi, go in your backend and edit it under preferences->images, don't forget to regenerate the images after for home.

 

Remove the column : That's a funny part, just edit all the modules' position you have in your columns to except the homepage

 

Martin

Link to comment
Share on other sites

hello

 

in this case you have to modify template a bit, you need to change the header.tpl and footer.tpl file located in your theme directory

additional informations you can find in the url posted by perfumeskunk above

Link to comment
Share on other sites

I'm quite unsure which solution I would use. I'm a purist in Programmation: affectation is better than condition on server side Performance. We have a body with a unique ID here.

body#index #center-column.grid5

would by pass the CSS instruction for width. THat would make the application more performant, but I still know the performance difference is minimal. But we'Re talking about affecting all pages' performance with 3 conditions for 1 page display. Display is a CSS matter, not PHP or HTML.

 

On an other perspective : We don't need the column on the index page, the data for these column is still loaded, the module will still be affected on the hook and loaded. Only the display will be affected by your solution, server side will still need to "use" the hook.

 

Still, I might be wrong somewhere...

 

Martin

Edited by Martin Uker K (see edit history)
Link to comment
Share on other sites

thanks guys.. if you look at the link i have made the columns disappear, but some of the product grids are stuck together. also at the bottom of the page there is an indent ( <) that i have tried to locate but i can find in the code.

Link to comment
Share on other sites

i hav posted homefeatured for u sorry late reply i was at office

have seen ur site..

there is huge gap in home slider bottom cos of 250 height in homefeatured.tpl

it has to auto

located in themes/modules/homfeatured.tpl

 

i have already created and fixed for u just see ur previous post

Edited by Jiten rash (see edit history)
Link to comment
Share on other sites

thanks guys i fixed it... i noticed that there is a problem with the width of the columns, on the right hand side there is a bigger gap than the left side, which is why i think some products are sticking together.. any ideas on how to change it?

Link to comment
Share on other sites

ok replace with default css

#featured-products_block_center {width:980px; padding:5px 10px 12px 10px; background: #fff;}

#featured-products_block_center li {

 

width: 157px;

height: 253px;

border: 1px solid rgb(204, 204, 204);

padding: 3px 2px 11px 17px;

margin: 20px 5px 5px 5px;

}

#featured-products_block_center li.last_item_of_line {margin-right:0;}

#featured-products_block_center .s_title_block, #featured-products_block_center h5 {

padding-top:5px;

height:30px;

font-size:12px;

color:#222;

padding-bottom: 0;

font-weight:bold;

}

 

#featured-products_block_center .product_image {

display:block;

position:relative;

overflow:hidden

}

#featured-products_block_center .product_image span.new {

display: block;

position: absolute;

top: 15px;

right:-30px;

padding: 1px 4px;

width: 101px;

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;

transform: rotate(45deg); /* Newer browsers */

filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476); /* IE6,IE7 */

-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)"; /* IE8 */

}

 

.ie9 #featured-products_block_center .product_image span.new{top:-18px;right:-38px}

.ie8 #featured-products_block_center .product_image span.new{top:-21px;right:-38px}

.lt-ie6 #featured-products_block_center .product_image span.new {top:-30px;right:-25px}

 

#featured-products_block_center .product_desc {height:45px;}

#featured-products_block_center .product_desc,

#featured-products_block_center .product_desc a {

color:#666

}

#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;

}

#featured-products_block_center .price_container {

margin-top:10px;

padding:0;

}

#featured-products_block_center .price {

font-weight:bold;

font-size:14px;

color:#990000

}

#featured-products_block_center li .ajax_add_to_cart_button {display:none;}

#featured-products_block_center li span.exclusive {display:none;}

Edited by Jiten rash (see edit history)
Link to comment
Share on other sites

to remove that use this

#featured-products_block_center {width:980px;padding:5px 3px 5px 0px; ; background: #fff;}

 

#featured-products_block_center li {

 

width: 157px;

height: 253px;

border: 1px solid rgb(204, 204, 204);

padding: 3px 2px 11px 17px;

20px 5px 5px 13px;

perfect

Edited by Jiten rash (see edit history)
Link to comment
Share on other sites

ok copy all and paste below

#featured-products_block_center {width:980px;padding:5px 3px 5px 0px; ; background: #fff;}

 

#featured-products_block_center li {

margin:

20px 5px 5px 13px;

 

width: 157px;

height: 253px;

border: 1px solid rgb(204, 204, 204);

padding: 3px 2px 11px 17px;

}

#featured-products_block_center li.last_item_of_line {margin-right:0;}

#featured-products_block_center .s_title_block, #featured-products_block_center h5 {

padding-top:5px;

height:30px;

font-size:12px;

color:#222;

padding-bottom: 0;

font-weight:bold;

}

#featured-products_block_center .product_image {

display:block;

position:relative;

overflow:hidden

}

#featured-products_block_center .product_image span.new {

display: block;

position: absolute;

top: 15px;

right:-30px;

padding: 1px 4px;

width: 101px;

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;

transform: rotate(45deg); /* Newer browsers */

filter: progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476); /* IE6,IE7 */

-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand', M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476)"; /* IE8 */

}

 

.ie9 #featured-products_block_center .product_image span.new{top:-18px;right:-38px}

.ie8 #featured-products_block_center .product_image span.new{top:-21px;right:-38px}

.lt-ie6 #featured-products_block_center .product_image span.new {top:-30px;right:-25px}

 

#featured-products_block_center .product_desc {height:45px;}

#featured-products_block_center .product_desc,

#featured-products_block_center .product_desc a {

color:#666

}

#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;

}

#featured-products_block_center .price_container {

margin-top:10px;

padding:0;

}

#featured-products_block_center .price {

font-weight:bold;

font-size:14px;

color:#990000

}

#featured-products_block_center li .ajax_add_to_cart_button {display:none;}

#featured-products_block_center li span.exclusive {display:none;}

Link to comment
Share on other sites

<!-- MODULE Home Featured Products -->

<div id="featured-products_block_center" class="block products_block clearfix">

<p class="title_block">{l s='Featured products' mod='homefeatured'}</p>

{if isset($products) AND $products}

<div class="block_content">

{assign var='liHeight' value=auto}

{assign var='nbItemsPerLine' value=auto}

{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 style="height:{$ulHeight}px;">

{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} {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 - $totModulo)}last_line{/if}">

<p class="s_title_block"><a href="{$product.link}" title="{$product.name|truncate:50:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a></p>

<a href="{$product.link}" title="{$product.name|escape:html:'UTF-8'}" class="product_image"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'large_default')}" 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='' mod='homefeatured'}{/if}</a>

Link to comment
Share on other sites

u need to cut <p class="s_title_block"><a href="{$product.link}" title="{$product.name|truncate:50:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a></p>

and move in the top

below here

<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 - $totModulo)}last_line{/if}">

if u need bigger image change home default to large_default

or create new image

Link to comment
Share on other sites

{*

* 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">

<p class="title_block">{l s='Featured products' mod='homefeatured'}</p>

{if isset($products) AND $products}

<div class="block_content">

{assign var='liHeight' value=auto}

{assign var='nbItemsPerLine' value=4}

{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 style="height:{$ulHeight}px;">

{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} {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 - $totModulo)}last_line{/if}">

<p class="s_title_block"><a href="{$product.link}" title="{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:35:'...'|escape:'htmlall':'UTF-8'}</a></p>

<a href="{$product.link}" title="{$product.name|escape:html:'UTF-8'}" class="product_image"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'large_default')}" 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>

 

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

<div>

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

 

{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}

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

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