Jump to content
jijaybajay

Latest Modified Product Module?

Recommended Posts

Hi,

 

I need a module to show the latest modified products.

 

Is it possible to make some code modification on the existing 'New Product Module'?

 

How to do it?

 

Thanks a lot for reading.

Share this post


Link to post
Share on other sites

It's possible to create a new function by copying the new product function and specify the modifed date instead of the creation date.

Share this post


Link to post
Share on other sites

I've found my own solution.

 

Go to .../classes/Product.php

 

in getNewProducts function, find:

if (empty($order_by) || $order_by == 'position') $order_by = 'date_add';

change $order_by = 'date_add' to $order_by = 'date_upd'

if (empty($order_by) || $order_by == 'position') $order_by = 'date_upd';

Save it as a new file Product.php in .../override/classes/Product.php.

This will help you keeping the original core file untouched.

 

 

Don't forget to also change the product controller.

Go to .../controllers/front/NewProductsController.php

 

in initContent() function, find

 

$this->orderBy = 'date_add'; change it to $this->orderBy = 'date_upd';

 

Save it as a new file NewProductsController.php in .../override/controllers/front/NewProductsController.php

 

 

Remember, always delete your class_index.php file in .../cache folder when you create a new overriden file

 

:)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More