Jump to content

Home feature functions add problem


Recommended Posts

Hello expert brothers,
I need to add new four functions in my new template's feature product area, now they have only name, picture, price and view area. But I need to add with them add to cart, quantity, mini description and red new product sticker in top right corner.

Present look:

post-731304-0-37558500-1401377375_thumb.png

 

But I need this look:

post-731304-0-62005500-1401377408_thumb.png

 

P:S:
I've already applied bro @vekia's these two tutorials in my feature area, but none of them work unfortunately, may be I missed something.
1: http://mypresta.eu/en/art/developer/prestashop-quantity-field-featured-products-module.html
and 2: http://mypresta.eu/en/art/developer/homefeatured-module-add-to-cart.html

 

Check my template's homefeature's TPL file: homefeatured.tpl.zip

 

Or, check TPL file's codes:

<!-- MODULE Home Featured Products -->
<div id="featured_products">
	<h4>{l s='Featured products' mod='homefeatured'}</h4>
	{if isset($products) AND $products}
	<div class="block_content">
		<ul>
			{foreach from=$products item=product name=homeFeaturedProducts}
			<li class="ajax_block_product">
				
					<h5><a class="product_link" href="{$product.link}" title="{$product.name|truncate:32:'...'|escape:'htmlall':'UTF-8'}">{$product.name|truncate:45:'...'|escape:'htmlall':'UTF-8'}</a></h5>
					<a class="product_image" href="{$product.link}" title="{$product.name|escape:html:'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')}" alt="{$product.name|escape:html:'UTF-8'}" /></a>
					<div>
						<div class="price-block">
							{if $product.specific_prices}
								{assign var='specific_prices' value=$product.specific_prices}
								{if $specific_prices.reduction_type == 'percentage' && ($specific_prices.from == $specific_prices.to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $specific_prices.to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $specific_prices.from))}
									<span class="old_price">{displayWtPrice p = ($product.price / (1 - $specific_prices.reduction|floatval))|string_format:"%d"}</span>
								{/if}
							{/if}
							{if $product.specific_prices}
								{assign var='specific_prices' value=$product.specific_prices}
								{if $specific_prices.reduction_type == 'amount' && ($specific_prices.from == $specific_prices.to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $specific_prices.to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $specific_prices.from))}
									<span class="old_price">{displayWtPrice p = ($product.price + $specific_prices.reduction)}</span>
								{/if}
							{/if}
							<span class="price {if $product.specific_prices}sale_price{/if}">{if $product.specific_prices}{l s='Sale ' mod='homefeatured'} {/if}{if !$priceDisplay}{displayWtPrice p=$product.price}{else}{displayWtPrice p=$product.price_tax_exc}{/if}</span>
						</div>
						<a class="button" href="{$product.link}" title="{l s='View' mod='homefeatured'}">{l s='View' mod='homefeatured'}</a>
				</div>
			</li>
			{/foreach}
		</ul>
	</div>
	{else}
	<p>{l s='No featured products' mod='homefeatured'}</p>
	{/if}
</div>
<!-- /MODULE Home Featured Products -->

.........................................

 

Thanks in advance,

Azim

Link to comment
Share on other sites

okay so at the moment you haven't got even add to cart button there

please add this code:
 

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

right after:

						<a class="button" href="{$product.link}" title="{l s='View' mod='homefeatured'}">{l s='View' mod='homefeatured'}</a>

Link to comment
Share on other sites

 

okay so at the moment you haven't got even add to cart button there

please add this code:

 

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

right after:

						<a class="button" href="{$product.link}" title="{l s='View' mod='homefeatured'}">{l s='View' mod='homefeatured'}</a>

 

Not working bro, show nothing in feature area.

Are these changes actually possible in any templates except Prestashop default template? I am confused.

Link to comment
Share on other sites

×
×
  • Create New...