Author Topic: Personalized topten (top10) / most sold products for loggedin-users  (Read 895 times)

welrachid

  • Jr. Member
  • **
  • Posts: 264
  • 3rd party plugin developer
  • Skype Name: wel.rachid
  • VirtueMart Version: Always LATEST stable
Hi
J!3.9.14
VM3.6

I have a shop that is without prices. My B2B users can order stuff, that will be created in e-conomic and that way get priced.
Since i have "free" products in the shop (no pricing) the only way i can get the topten-feature to work is by commenting out the where part.
./administrator/components/com_virtuemart/models/product.php
Code: [Select]
case 'topten':
$orderBy = 'ORDER BY p.`product_sales` DESC, p.`virtuemart_product_id` DESC'; //LIMIT 0, '.(int)$nbrReturnProducts;  //TODO set limitLIMIT 0, '.(int)$nbrReturnProducts;
$joinPrice = true;
// $where[] = 'pp.`product_price`>"0.001" ';
This will make all products show up as long as they are on product sales.
now..
What i want to achieve is make sure that the most sold products for logged in users are shown instead of the "global" topten.
Can anyone tell me if this is possible in the current settings menu or do i need to make my SQL different to make sure that p.product_sales only contains data from orders that have a certain user_id?

Thanks!
Best regards,
Wel

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4247
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Personalized topten (top10) / most sold products for loggedin-users
« Reply #1 on: February 12, 2020, 15:34:56 pm »
HI,
I have a module https://shop.st42.fr/en/products/products-any-ways.htm that should work in your case.
If not, i can add  the option.

welrachid

  • Jr. Member
  • **
  • Posts: 264
  • 3rd party plugin developer
  • Skype Name: wel.rachid
  • VirtueMart Version: Always LATEST stable
Re: Personalized topten (top10) / most sold products for loggedin-users
« Reply #2 on: February 20, 2020, 10:55:13 am »
Hi.
Ok i'll buy the plugin. Does it support "ordered by this customer" if customer is logged in, else use "top 10 sales".
remmeber that my products are all "0.00" price value.
Is it correct understood that if you need to make updates/changes to the plugin, it does not require extra costs?
Best regards,
Wel

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4247
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Personalized topten (top10) / most sold products for loggedin-users
« Reply #3 on: February 20, 2020, 13:16:38 pm »
The module do not check for price the query use the user ordered items
About display  "top 10 sales" OR "ordered by this customer" ,you have a setting in the module : Access
Select "guest access" for top 10 and "registred access" for "ordered by this customer". (his is a native Joomla feature)

welrachid

  • Jr. Member
  • **
  • Posts: 264
  • 3rd party plugin developer
  • Skype Name: wel.rachid
  • VirtueMart Version: Always LATEST stable
Re: Personalized topten (top10) / most sold products for loggedin-users
« Reply #4 on: February 20, 2020, 14:12:28 pm »
so i male two modules, one for registered and one for guests. correct?
Best regards,
Wel

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 4247
  • Joomla & Virtuemart developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 & 3
Re: Personalized topten (top10) / most sold products for loggedin-users
« Reply #5 on: February 20, 2020, 20:02:36 pm »
so i male two modules, one for registered and one for guests. correct?
YES