Kazi Azim Posted May 29, 2014 Share Posted May 29, 2014 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: But I need this look: 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.htmland 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 More sharing options...
Kazi Azim Posted June 1, 2014 Author Share Posted June 1, 2014 Hellloooo.... anybody here?! Link to comment Share on other sites More sharing options...
vekia Posted June 1, 2014 Share Posted June 1, 2014 share url, at the moment is hard to say whats going on there without possibility to check your website. Link to comment Share on other sites More sharing options...
Kazi Azim Posted June 1, 2014 Author Share Posted June 1, 2014 share url, at the moment is hard to say whats going on there without possibility to check your website. Extremely sorry bro, please this site: http://mystarmax.com/ Link to comment Share on other sites More sharing options...
vekia Posted June 1, 2014 Share Posted June 1, 2014 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 More sharing options...
Kazi Azim Posted June 1, 2014 Author Share Posted June 1, 2014 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 More sharing options...
Recommended Posts