Jump to content

Problema con homefeatured y modulo añadir mas categorias


Recommended Posts

Muy buenas a todos.

 

Mi caso es el siguiente, quiero mostrar mas categorías en la pagina de inicio, aparte de las del homefeatured.

 

El caso es que me he gastado el dinero en un modulo que sirve realmente para lo que quiero, pero al instalarlo no me respeta el estilo del homefeatured de mi tema, los productos salen con otro diseño.

 

Una vez descartado este modulo he probado a duplicar en el archivo homefeatued.php el código para repetir lineas de 3 productos y me aparece tal como yo quiero, pero solo me muestra los productos de la categoria de inicio y los va repitiendo, he editado el archivo homefeatued.php del modulo original de prestashop y puedo cambiar facilmente la categoria a mostrar pero solo me muestra esa.

 

Por si no me he explicado bien: basicamente lo que quiero 3 lineas de productos que muestren los productos de 3 categorias diferentes.

 

No se ya que cambiar del archivo homefeatued.php de mi tema para poder mostrar diferentes categorias manteniendo el diseño de las cajas de mi tema.

 

Os dejo aqui el codigo por si podeis ayudarme en algo, muchas gracias a todos.

{*
* 2007-2010 PrestaShop 
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 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/osl-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-2010 Prestashop SA
*  @version  Release: $Revision: 1.4 $
*  @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
*  International Registred Trademark & Property of PrestaShop SA
*}
{literal}
<script>
$(document).ready(function() {
$('.hft img').each(function() {
$(this).hover(function() {
$(this).stop().animate({ opacity: 0.6 }, 800);
$('.hft').addClass("no_bg");
},
function() {
$(this).stop().animate({ opacity: 1.0 }, 800);
});
});

});
$(document).ready(function () {
style = 'easeOutQuart';		
$('.hft').hover(
function() {
$(this).children('div:last').stop(false,true).animate({bottom:0},{duration:800, easing: style});
},
function() {
$(this).children('div:last').stop(false,true).animate({bottom:-150},{duration:800, easing: style});
}
);
});
</script>
{/literal}
<!-- MODULE Home Featured Products -->
<h3>Destacados de la semana</h3>
<div id="featured-products_block_center" class="block products_block">
	{if isset($products) AND $products}
		<div class="block_content">
			{assign var='liHeight' value=220}
			{assign var='nbItemsPerLine' value=3}
			{assign var='nbLi' value=$products|@count}
			{assign var='nbLines' value=$nbLi/$nbItemsPerLine|ceil}
			{assign var='ulHeight' value=$nbLines*$liHeight}
			<ul style="height:{$ulHeight}px;margin-bottom:30px;">
			{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 == 2}deuxcenter{/if}






 {if $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 0}last_item_of_line{elseif $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 1}clear{/if} {if $smarty.foreach.homeFeaturedProducts.iteration > ($smarty.foreach.homeFeaturedProducts.total - ($smarty.foreach.homeFeaturedProducts.total % $nbItemsPerLine))}last_line{/if}">
                           <div class="r_cont">
                           <div class="r_top"></div>
                           <div class="clear"></div> 
 <div class="hft">
<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="220" width="220" alt="{$product.name|escape:html:'UTF-8'}" /></a>
					    <div class="caption">
                        <span class="{if !$PS_CATALOG_MODE}title_container{else}title_container-c{/if}"><a href="{$product.link}" title="{$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:27:'...'|escape:'htmlall':'UTF-8'}</a></span>
                        {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<span class="price_container">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span>{else}<div style="height:{if !$PS_CATALOG_MODE}21{else}0{/if}px;"></div>{/if}

						<a class="{if !$PS_CATALOG_MODE}view_effect{else}view_effect-c{/if}" href="{$product.link}" title="{l s='View' mod='homefeatured'}">{l s='View' mod='homefeatured'}</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="cart_effect 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='Add to cart' mod='homefeatured'}">{l s='Add to cart' mod='homefeatured'}</a>
							{else}
<a class="cart_effect 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='Add to cart' mod='homefeatured'}">{l s='Add to cart' mod='homefeatured'}</a>
                       
							{/if}
{else}
							<div style="height:23px;"></div>
						{/if}
                        
                        
                        </div>
                        </div>
             <div class="r_footer"></div> 
    
					</div>
				</li>
			{/foreach}
			</ul>
		</div>
	{else}
		<p>{l s='No featured products' mod='homefeatured'}</p>
	{/if}
</div>
<!-- /MODULE Home Featured Products -->

<br>

<!-- MODULE Home Featured Products -->
<h3>Destacados del mes</h3>
<div id="featured-products_block_center" class="block products_block">
	{if isset($products) AND $products}
		<div class="block_content">
			{assign var='liHeight' value=220}
			{assign var='nbItemsPerLine' value=3}
			{assign var='nbLi' value=$products|@count}
			{assign var='nbLines' value=$nbLi/$nbItemsPerLine|ceil}
			{assign var='ulHeight' value=$nbLines*$liHeight}
			<ul style="height:{$ulHeight}px;margin-bottom:30px;">
			{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 == 2}deuxcenter{/if}






 {if $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 0}last_item_of_line{elseif $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 1}clear{/if} {if $smarty.foreach.homeFeaturedProducts.iteration > ($smarty.foreach.homeFeaturedProducts.total - ($smarty.foreach.homeFeaturedProducts.total % $nbItemsPerLine))}last_line{/if}">
                           <div class="r_cont">
                           <div class="r_top"></div>
                           <div class="clear"></div> 
 <div class="hft">
<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="220" width="220" alt="{$product.name|escape:html:'UTF-8'}" /></a>
					    <div class="caption">
                        <span class="{if !$PS_CATALOG_MODE}title_container{else}title_container-c{/if}"><a href="{$product.link}" title="{$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:27:'...'|escape:'htmlall':'UTF-8'}</a></span>
                        {if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<span class="price_container">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span>{else}<div style="height:{if !$PS_CATALOG_MODE}21{else}0{/if}px;"></div>{/if}

						<a class="{if !$PS_CATALOG_MODE}view_effect{else}view_effect-c{/if}" href="{$product.link}" title="{l s='View' mod='homefeatured2'}">{l s='View' mod='homefeatured2'}</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="cart_effect 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='Add to cart' mod='homefeatured'}">{l s='Add to cart' mod='homefeatured'}</a>
							{else}
<a class="cart_effect 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='Add to cart' mod='homefeatured'}">{l s='Add to cart' mod='homefeatured'}</a>
                       
							{/if}
{else}
							<div style="height:23px;"></div>
						{/if}
                        
                        
                        </div>
                        </div>
             <div class="r_footer"></div> 
    
					</div>
				</li>
			{/foreach}
			</ul>
		</div>
	{else}
		<p>{l s='No featured products' mod='homefeatured2'}</p>
	{/if}
</div>
<!-- /MODULE Home Featured Products -->
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...