I'm using the latest products module on the frontpage of my shop.
But when I don't add products for a few days, there are no new products anymore...
Where can I change the amount of days for a product to be a new product?
its not in configuration, but it is in
models/product.php
case 'latest':
$date = JFactory::getDate( time()-(60*60*24*7) ); //Set on a week, maybe make that configurable
$dateSql = $date->toMySQL();
$where[] = 'p.`modified_on` > "'.$dateSql.'" ';
break;
thx, that will work for me:)
My products in this module is stuck...
looks like it is collected alphabetic so I got my Axxx Axxx products shown at all times... not the last product.
This started happening after I cloned products - at least of what I remember.
If I set the module to different option, then it change but as soon I go back to "latest" option it is stuck again?
Any input would be appreciated.
No cache (and tried to clear it)
Hi Guys,
I would also like to edit the "latest Products" module with respects to how long a product is considered new.
I tried to do this in the above listed code but I really messed up my site.
I had to reinstall the products.php file
how do I alter the date so that a product can remain new for a month or two?
Thank you in advance
Quote from: rustle on February 22, 2012, 05:03:07 AM
Hi Guys,
I would also like to edit the "latest Products" module with respects to how long a product is considered new.
I tried to do this in the above listed code but I really messed up my site.
I had to reinstall the products.php file
how do I alter the date so that a product can remain new for a month or two?
Thank you in advance
What i did whas add a *52 for 52 weeks being a year, if you would like two months it would become like this:
Quote$date = JFactory::getDate( time()-(60*60*24*7*8) );
//Being a * and 8 without spaces (damn smileys :P)
Thank Yo Glasya
This worked like a charm
8)
Quote from: BanquetTables.pro on January 19, 2012, 00:38:35 AM
its not in configuration, but it is in
models/product.php
case 'latest':
$date = JFactory::getDate( time()-(60*60*24*7) ); //Set on a week, maybe make that configurable
$dateSql = $date->toMySQL();
$where[] = 'p.`modified_on` > "'.$dateSql.'" ';
break;
Why you used "modified_on" field ? "created_on" more suitable in this case IMHO.