Author Topic: Latest products shows random product (Bug)  (Read 3358 times)

Twix

  • Beginner
  • *
  • Posts: 46
Latest products shows random product (Bug)
« on: April 26, 2012, 16:20:56 pm »
The Latest products module (mod_virtuemart_product) shows random product, in stead of the latest product. Could you fix this please?
Thanks!

Twix

  • Beginner
  • *
  • Posts: 46
Re: Latest products shows random product (Bug)
« Reply #1 on: May 08, 2012, 09:26:44 am »
Kick :)

serapol

  • Beginner
  • *
  • Posts: 43
Re: Latest products shows random product (Bug)
« Reply #2 on: May 08, 2012, 10:20:29 am »
The Latest products module (mod_virtuemart_product) shows random product, in stead of the latest product. Could you fix this please?
Thanks!

It is not a bug and feature writing code. According to the latest product code Considered one in which the change date is the eldest. Accordingly, if you change your old item and save it you will automatically become final.

I have already offered to developers to replace this sample at the output of goods on the latest product ID but they felt that since they did more correctly. Although I do not agree with them.

Can do to fix the file administrator /components/com_virtuemart/models/product.php
Find code

Code: [Select]
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.'" ';
$orderBy = 'ORDER BY p.`modified_on`';
$this->filter_order_Dir = 'DESC';
                                        break;
and change in the

Code: [Select]
case 'latest':
$this->filter_order_Dir = 'DESC';
$orderBy = 'ORDER BY p.`virtuemart_product_id` ';
break;

Twix

  • Beginner
  • *
  • Posts: 46
Re: Latest products shows random product (Bug)
« Reply #3 on: May 08, 2012, 10:30:09 am »
Thanks for your reply. I don't like to edit the core files, but maybe my clients prefer that I do that. Hopefully the developers will edit it. An edited product (which you have for example 2 years in your webshop) is not a new product if you ask me...

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10070
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Latest products shows random product (Bug)
« Reply #4 on: May 08, 2012, 18:27:35 pm »
Serapol that is not fair, read here http://forum.virtuemart.net/index.php?topic=100789.msg333706#msg333706. my last message indicates, that I did not understand you and that I changed the core.

Thanks for your reply. I don't like to edit the core files, but maybe my clients prefer that I do that. Hopefully the developers will edit it. An edited product (which you have for example 2 years in your webshop) is not a new product if you ask me...

That differs from case to case. Others said, uhh, why it is created_on, I just updated my product and it is not latest. So I think we must make it configurable.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

serapol

  • Beginner
  • *
  • Posts: 43
Re: Latest products shows random product (Bug)
« Reply #5 on: May 08, 2012, 18:39:44 pm »
I wrote it without any complaints, just a man had a similar situation and I said that this is not bug but feature and pointed out how you can avoid it in the code.

Can be completely and correctly to make this option configurable. While as for me the last items are the ones that were added last. Well, IMHO it is in my case, can the other in a different way.

By the way on theme modules Mode "topten" does not work at all due to the fact that the order without recording the data in the database field "product_sales". I still did not understand this, posmtrite what it was please, and then on my site now displays items in discord.

Thank you very much for your trouble, I'm sure that eventually turn out a decent product with great functionality.

Twix

  • Beginner
  • *
  • Posts: 46
Re: Latest products shows random product (Bug)
« Reply #6 on: May 08, 2012, 18:45:39 pm »
That differs from case to case. Others said, uhh, why it is created_on, I just updated my product and it is not latest. So I think we must make it configurable.
That would be a very nice solution Milbo!

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10070
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Latest products shows random product (Bug)
« Reply #7 on: May 08, 2012, 19:15:44 pm »
I wrote it without any complaints,
Good then :-)

By the way on theme modules Mode "topten" does not work at all due to the fact that the order without recording the data in the database field "product_sales". I still did not understand this, posmtrite what it was please, and then on my site now displays items in discord.

Sorry, I do not understand you, maybe we use skype and my wife translates for us? lol.  But I wonder, because imho I fixed it. grumble, not?
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/