Jump to content

[solved] How can i display more than 2 Images in New Product?


Recommended Posts

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:

dtwoaNJ.png

Link to comment
Share on other sites

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}

post-460779-0-82177300-1375981785_thumb.png

  • Like 1
Link to comment
Share on other sites

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

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.

  • Like 1
Link to comment
Share on other sites

Thank you very much for your valuable support.

Due to this support now new look is as I desired to have :

ps6.png

 

 

 

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 by rajesh.yadav (see edit history)
Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...