Rajesh Kumar Yadav Posted August 8, 2013 Share Posted August 8, 2013 I want to use new product in content center as featured is already being displayed. I have coded hook and now it has been transplanted to column center very fine. 2 images and 5 details are being displayed. I want to show 5 images and 5 details. How is this possible? Please find attachement for demo. Link to comment Share on other sites More sharing options...
vekia Posted August 8, 2013 Share Posted August 8, 2013 you have to edit the module .tpl file open the /modules/blocknewproducts/blocknewproducts.tpl you've got there: {foreach from=$new_products item='product' name='newProducts'} {if $smarty.foreach.newProducts.index < 2} <li{if $smarty.foreach.newProducts.first} class="first"{/if}><a href="{$product.link}" title="{$product.legend|escape:html:'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'medium_default')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$product.legend|escape:html:'UTF-8'}" /></a></li> {/if} {/foreach} change the $smarty.foreach.newProducts.index < 2 to $smarty.foreach.newProducts.index < 5 then go to the modules > modules tab in your back office, search for block new products module, click on configure and change "products to display" param to 10: Link to comment Share on other sites More sharing options...
Rajesh Kumar Yadav Posted August 8, 2013 Author Share Posted August 8, 2013 (edited) Thanks for your response. But I had followed the above process, deleted cookies cache of my browser. Now number of description are increased to 7 but still it is showing 2 Images. Edited August 8, 2013 by rajesh.yadav (see edit history) Link to comment Share on other sites More sharing options...
SmartDataSoft Posted August 8, 2013 Share Posted August 8, 2013 Hello, Rajesh you have to edit that from from theme location. i have changed and it woked with 4 image. themes\default\modules\blocknewproducts {foreach from=$new_products item='product' name='newProducts'} {if $smarty.foreach.newProducts.index < 4} <li{if $smarty.foreach.newProducts.first} class="first"{/if}><a href="{$product.link}" title="{$product.legend|escape:html:'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'medium_default')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$product.legend|escape:html:'UTF-8'}" /></a></li> {/if} {/foreach} 1 Link to comment Share on other sites More sharing options...
vekia Posted August 8, 2013 Share Posted August 8, 2013 that's right, sometimes your theme has got "override" files, it mean that if module file exist under the /themes/yourtheme/modules/ path - you have to edit it there. Link to comment Share on other sites More sharing options...
Rajesh Kumar Yadav Posted August 9, 2013 Author Share Posted August 9, 2013 Yes I have gone through your steps and now it is showing 5 images. Thank you very much for your valuable support ! Link to comment Share on other sites More sharing options...
Rajesh Kumar Yadav Posted August 9, 2013 Author Share Posted August 9, 2013 Thank you very much for your previous response. Now I have a query, As you told theme/themename/modules/ modules located here are used to overwrite the existing module located in root folder's module directory. So to over write it we have to change theme folder's module, That's right ! But I want to know if suppose any module doesn't exist in theme/themename/modules/ then should I have to copy and paste in this location to overwrite this or just can overwrite the original module file? I have used the above process in magento... Should I have to use this in prestashop also? Link to comment Share on other sites More sharing options...
SmartDataSoft Posted August 9, 2013 Share Posted August 9, 2013 nice to hear that it help. It is better to overwrite any module files from theme location. so that it work only that that any original file remains same. May be in other theme the original file need. So , if you want to overwrite any module file or edit than copy the folder and inside tpl to theme like themes\mythemes\module\mymnodule\mymodule.tpl this is the best practice , so that original file remain save and unchanged. and easy for future update of the module. If you modified original file in that case future upgrade may loose your old modification. And after future update, if there is any change you can compare original file and your one and adapt new changes. 1 Link to comment Share on other sites More sharing options...
Rajesh Kumar Yadav Posted August 9, 2013 Author Share Posted August 9, 2013 (edited) Thank you very much for your valuable support. Due to this support now new look is as I desired to have : Ok that's good to have a copy of it in theme/module/ and work with that with overwrite. So if i have to change tpl then i will paste here tpl file with new folder as module name as you have mentioned. Now my question is can we also copy and paste css and php along with tpl, means if tpl is being changed i have copied. If i am also changing css files then should i have to copy this one also for overwriting. summary : Is future update affects css and php also? Edited August 9, 2013 by rajesh.yadav (see edit history) Link to comment Share on other sites More sharing options...
SmartDataSoft Posted August 9, 2013 Share Posted August 9, 2013 here is the proces how to overwrite css and js themes\mythemes\js\modules\mymodules\mymodule.js or themes\mythemes\js\modules\mymodules\js\mymodule.js which your module structure. I did in this way copy the original module folder to themes css folder and delete all the files except the css same way do for js and same way do for tpl in this way original file remain same and new file will load from theme's section. Hope you got a better idea how to overwrite the files from themes 1 Link to comment Share on other sites More sharing options...
vekia Posted August 9, 2013 Share Posted August 9, 2013 im going to mark this topic as [solved] dear friends, feel free to continue this awesome discussion here, solved isn't mean closed best regards Link to comment Share on other sites More sharing options...
Rajesh Kumar Yadav Posted August 9, 2013 Author Share Posted August 9, 2013 Hello Team, Once Again thank you very much from the core of my heart. As a magento developer we have used overwrite process and now i am please to know prestashop also supports overwriting ! Regards Rajesh Kumar Yadav Link to comment Share on other sites More sharing options...
vekia Posted August 9, 2013 Share Posted August 9, 2013 check official documentation: http://doc.prestasho...fault+behaviors there are several examples, whole official doc website is very very helpful Link to comment Share on other sites More sharing options...
Recommended Posts