Hi! Here´s a challenge for you guys... I just gave up!
Well, I´m trying to order my featured products on Virtuemart´s front. I commented this 'ORDER BY RAND' so now, every time I open the shop, products don´t change position as it was happening till now. Here is the code:
// 'featured' case
switch ($this->filter_order) {
case 'product_special':
$where[] = ' p.`product_special`="1" ';// TODO Change to a individual button
$orderBy = 'ORDER BY RAND()';
break;
http://www2.encinardecabezon.com/index.php/es/tienda-online (http://www2.encinardecabezon.com/index.php/es/tienda-online)
But the thing now is that all the products are mixed and I want them in an specific order: Maybe by category or date of creation or SKU. Is there any option that allows me to modify the date of creation of the product in the backend? This way I can order products by latest...
case 'latest':
$date = JFactory::getDate (time () - (60 * 60 * 24 * $latest_products_days));
$dateSql = $date->toMySQL ();
$where[] = 'p.`' . $latest_products_orderBy . '` > "' . $dateSql . '" ';
$orderBy = 'ORDER BY p.`' . $latest_products_orderBy . '`';
$this->filter_order_Dir = 'DESC';
break;
Obviously this is not working if I don´t modify the creation date of my products...
ORDER BY SKU would be a good solution also but I don´t know what code should I write above...
I tried installing this CCquery component and going to the database, but can´t find products and all the tables all non-writtable.
Thanks in advance!
Help will be appreciated (a lot) ;)