jeyjoo Posted March 11, 2012 Share Posted March 11, 2012 Hi, I running PS 1.4.6.2. My site sells olive oil cosmetics My "special offer" module (right hand side, just above PAYPAL) only gives one offer a time. If there a way to change this? I tried the admin panel module setting (no option) The template code is below: <!-- MODULE Block specials --> <div id="special_block_right" class="block products_block exclusive blockspecials"> <h4><a href="{$link->getPageLink('prices-drop.php')}" title="{l s='Specials' mod='blockspecials'}">{l s='Specials' mod='blockspecials'}</a></h4> <div class="block_content"> {if $special} <ul class="products"> <li class="product_image"> <a href="{$special.link}" title="{$special.name|escape:html:'UTF-8'}"><img src="{$link->getImageLink($special.link_rewrite, $special.id_image, 'medium')}" alt="{$special.legend|escape:html:'UTF-8'}" height="{$mediumSize.height}" width="{$mediumSize.width}" title="{$special.name|escape:html:'UTF-8'}" /></a> <h5><a href="{$special.link}" title="{$special.name|escape:html:'UTF-8'}">{$special.name|escape:html:'UTF-8'}</a></h5> <span class="price-discount">{if !$priceDisplay}{displayWtPrice p=$special.price_without_reduction}{else}{displayWtPrice p=$priceWithoutReduction_tax_excl}{/if}</span> {if $special.specific_prices} {assign var='specific_prices' value=$special.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="reduction">(-{$specific_prices.reduction*100|floatval}%)</span> {/if} {/if} <span class="price">{if !$priceDisplay}{displayWtPrice p=$special.price}{else}{displayWtPrice p=$special.price_tax_exc}{/if}</span> </li> </ul> <p> <a href="{$link->getPageLink('prices-drop.php')}" title="{l s='All specials' mod='blockspecials'}" class="button_large">{l s='All specials' mod='blockspecials'}</a> </p> {else} <p>{l s='No specials at this time' mod='blockspecials'}</p> {/if} </div> </div> Link to comment Share on other sites More sharing options...
El Patron Posted March 11, 2012 Share Posted March 11, 2012 modules/blockspecials.php calls blockspecials.tpl blockspecials.php uses product.php function getRandomSpecial which is then passed to blockspecials.tpl You would first have to build a new function that obtained x number of products with specials and pass the new smarty array of specials to blockspecials.tpl. You could hard code it to limit the number returned via your mysql call. in blockspecials.tpl you would need to add foreach logic on returned product array where it displays the existing randomt display I think this is why they just have the 'all specials' link after the place the random product. it's fun to write modules...you can start off by patching your files...then write a module that will patch the files with save php repleace...etc... good luck! 1 Link to comment Share on other sites More sharing options...
jeyjoo Posted March 12, 2012 Author Share Posted March 12, 2012 modules/blockspecials.php calls blockspecials.tpl blockspecials.php uses product.php function getRandomSpecial which is then passed to blockspecials.tpl You would first have to build a new function that obtained x number of products with specials and pass the new smarty array of specials to blockspecials.tpl. You could hard code it to limit the number returned via your mysql call. in blockspecials.tpl you would need to add foreach logic on returned product array where it displays the existing randomt display I think this is why they just have the 'all specials' link after the place the random product. it's fun to write modules...you can start off by patching your files...then write a module that will patch the files with save php repleace...etc... good luck! Aaaah. Thats just gone to the bottom of my to do list! Thanks Link to comment Share on other sites More sharing options...
El Patron Posted March 12, 2012 Share Posted March 12, 2012 Aaaah. Thats just gone to the bottom of my to do list! Thanks excellent idea to put at the bottom...I looked at this as a module (to do), a lot of work for very little satisfaction (nice job PS on doing radom!). One should leave their PrestaShop as vanilla as possible so that new modules, themes and releases can be done with little effort. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now