VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: Twix on February 29, 2012, 13:59:46 PM

Title: [mod_virtuemart_product] Latest products empty
Post by: Twix on February 29, 2012, 13:59:46 PM
Problem:
I have a latest product module with mod_virtuemart_product. This module is empty, since I haven't added products the latest week. However the module title is still shown. Resulting in a "Latets Products" title without latest products to show.

I'm using VM 2.0.2 stable. Joomla 2.5.1. Also updated the VM extensions.
Title: Re: [mod_virtuemart_product] Latest products empty
Post by: Twix on February 29, 2012, 21:03:08 PM
Cause:
File:  administrator\components\com_virtuemart\models\product.php
Line: 343
$date = JFactory::getDate( time()-(60*60*24*7) ); //Set on a week, maybe make that configurable

So for the latest products only the products of the last week are shown. If you didn't added a product the last week, it results in my problem. An empty module which only shows the module title. I think this should be fixed, since only a headline of "Latest Products" without some latest products to shown is incorrectly.
Title: Re: [mod_virtuemart_product] Latest products empty
Post by: Twix on March 05, 2012, 21:05:53 PM
Could you give it a look?
Title: Re: [mod_virtuemart_product] Latest products empty
Post by: glasya on March 06, 2012, 08:15:28 AM
after the *7 add a *52 for the last year that should be enough right? :D
Title: Re: [mod_virtuemart_product] Latest products empty
Post by: Twix on March 06, 2012, 11:17:35 AM
Yes that's true, but it's still a core hack. The VM team should implement a solution to the core. Else it get lost with updates. Also if you set it to 1 year, you'll get the same problem (in the unlikely event) when you didn't update your webshop in a year. This could happen with some users.