Hi Community,
yet on vm 3.0.10 and jml 3.4.5 - everybody who wants to have random-ordering (because of many new products) for latest products module on vm-frontpage should use this code for case 'latest' in
/administrator/components/com_virtuemart/models/product.php
case 'latest':
$date = JFactory::getDate (time () - (60 * 60 * 24 * $latest_products_days));
$dateSql = $date->toSQL ();
$where[] = 'p.`' . $latest_products_orderBy . '` > "' . $dateSql . '" ';
//$orderBy = 'ORDER BY p.`' . $latest_products_orderBy . '`';
$orderBy = 'ORDER BY RAND() ';
break;
instead of original code
case 'latest':
/*$date = JFactory::getDate (time () - (60 * 60 * 24 * $latest_products_days));
$dateSql = $date->toSQL ();
$where[] = 'p.`' . $latest_products_orderBy . '` > "' . $dateSql . '" ';*/
//vmdebug('product model ',$latest_products_orderBy);
$orderBy = 'ORDER BY p.`' . $latest_products_orderBy . '` ';
$this->filter_order_Dir = 'DESC';
break;
best regards
jens
lol, you just set back, what was there. The whole time filter is nonsense. If a shopowner is not updating his products for longer time than $latest_products_days, you see no products anylonger.
hey thats right, but if you update your shop with cvs-import as example - all 3 month a hundred products and edit them - this module is static in ordering because it shows always the same products in the same order and if you show as an example 3 lines with 4 products in a row you have 12, but there are eightyeight others which are new too ...
The reason for that rand()
slammy,
but why hack the core though?
mod_virtuemart_product.php
Increase, $max_items
$products = $productModel->getProductListing($Product_group, $max_items, $show_price, true, false,$filter_category, $category_id);
then rand & limit on the front end.
Hey Hutson,
thanks for your hint with mod_virtuemart_product.php, I didn“t knew I can do it this way too.
Always nice here to speak to the pros, my learning curve is always high ... ;)
best regards
jens
Ok,
But I'm not Hutson
Of course, sorry PRO
I'll take the praise - although I have changed my profile name to AH
;)
aaah now I get it - you fooled me man! Today - not mainly but partly - I was thinking about why I thought your username was Hutson and I think it was because of an similiar avatar-image I noticed at the gui-side last years by post from Hutson. Taking a look into the function "search members" offers me the solution :) If I had read your last post yesterday truly you gave me the hint already. Cheers ;)