Author Topic: override price - sort order WRONG  (Read 5738 times)

soura123

  • Beginner
  • *
  • Posts: 19
override price - sort order WRONG
« on: July 16, 2013, 08:24:12 am »
hello...
on my site all of our products has override price .. on the category view i have sort order by price... but virtuemart ordering by final price and not the override price...

see here:
Code: [Select]
http://www.studiotzuliani.gr/gynaikeia-papoutsia.html
see an example of the product with the code 928 wou will understand what i mean... i search the forum for similar issues but i didnt find anything.... does anyone has a fix for this???


thanks in advanced

my joomla version is 2.5.11 and vm version is 2.0.22

soura123

  • Beginner
  • *
  • Posts: 19
Re: override price - sort order WRONG
« Reply #1 on: July 19, 2013, 08:11:17 am »
why anyone is helping????

this thing with the override price is more deep that i thought... if if you want to add a discount price from calculation and you select pmargin price... the discount is going on the final price but if you have an already discount on your product with override price checked the new discount is only going on the final ....

virtuemart even now has serious issues with calculation and override price ... any one from the team??

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10000
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: override price - sort order WRONG
« Reply #2 on: July 19, 2013, 10:46:00 am »
No it has not a serious issue, you just misuse the overwrite price. Also the ordering works, but only for the cost price. There are search plugins available doing it correct, but it can slow down your store.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

soura123

  • Beginner
  • *
  • Posts: 19
Re: override price - sort order WRONG
« Reply #3 on: July 30, 2013, 18:23:24 pm »
i dont think that sth virtuemart core gives as a tool it can be for misuse!!! and yes it is a serious issue for thoose that uses virtuemart on a 100% of it s abilities! beside the order issue... if i put a discount on a category from calculation and prices the discount goes on the cost price not the override... it must be fixed this... maybe to put an "if" the override price is smaller than the cost price then to apply on the override price and not on the cost price...and the same for the sort order...

Torschi

  • Beginner
  • *
  • Posts: 1
Re: override price - sort order WRONG
« Reply #4 on: December 27, 2013, 11:23:48 am »
Hello to everyone,

I like to agree to "soura123".

One of my customers only sells second-hand products. The final price is important to show customers how much the discount is – so this must be displayed.
But when sorting by price, customers want to sort by the cheapest or the most expensive price they have to pay at least – not the price it has been.

Would be nice, if we can choose "Final Price" in the backend "Product Order Settings".
This should not be too much work.

Greetings,
Torschi

fuzzfree

  • Beginner
  • *
  • Posts: 12
    • FuzzFree
Re: override price - sort order WRONG
« Reply #5 on: March 29, 2014, 06:01:02 am »
I also agree... this should be fixed... all other carts sort the products correctly based on final price...

I will have to dig into the code...
FuzzFree :: Managed PHP Applications, Cloud Hosting, Digital Marketing

fuzzfree

  • Beginner
  • *
  • Posts: 12
    • FuzzFree
Re: override price - sort order WRONG
« Reply #6 on: March 29, 2014, 07:03:50 am »
Hello

I read the code and I would like to present a fix for this issue so the front end category listings sort correctly the products based on price (if override price is set e.g. the field `override` in #__virtuemart_product_prices is 1).

administrator/components/com_virtuemart/models/product.php ( vm version 2.0.26d )


part 1 around line 420
Code: [Select]
case 'product_price':
//$filters[] = 'p.`virtuemart_product_id` = p.`virtuemart_product_id`';
$orderBy = ' ORDER BY `ff_final_price`, `product_price` ';


part 2 around line 480
Code: [Select]
$ff_select_price = ' , IF(pp.override, pp.product_override_price, pp.product_price) as ff_final_price ';
if ($joinLang) {
$select = ' l.`virtuemart_product_id` FROM `#__virtuemart_products_' . VMLANG . '` as l';
if ($joinPrice == TRUE) {
$select = ' l.`virtuemart_product_id` ' . $ff_select_price . '  FROM `#__virtuemart_products_' . VMLANG . '` as l';
}
$joinedTables[] = ' JOIN `#__virtuemart_products` AS p using (`virtuemart_product_id`)';
}
else {
$select = ' p.`virtuemart_product_id` FROM `#__virtuemart_products` as p';
if ($joinPrice == TRUE) {
$select = ' p.`virtuemart_product_id` ' . $ff_select_price . ' FROM `#__virtuemart_products` as p';
}
$joinedTables[] = '';
}

Hope it helps. I would like to ask the VM dev team to include this fix in future versions.

* This small fix is compatible with MYSQL (I do not know if VM supports additional databases like Joomla is supposed so like MSSQL, PostgreSQL etc.)

Thank you.


* Reference
http://www.joomla.org/25
Quote
Multi-Database Support
Multiple database support is a new feature that makes it possible to run the Joomla! CMS on many different databases, not just MySQL and MySQLi. This facilitates integration and update management processes. Joomla! now allows different drivers to be written that will support different versions of SQL databases. Current drivers exist for the MySQL and MS SQL databases, with PostgreSQL, Oracle, SQLite and PDO drivers close to being ready.
FuzzFree :: Managed PHP Applications, Cloud Hosting, Digital Marketing

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10000
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: override price - sort order WRONG
« Reply #7 on: March 29, 2014, 09:46:36 am »
Nice idea fuzzfree, but I fear we need an option for that. Furthermore I changed the sql there, so we need a slightly different fix for the vm2.5.5.

VirtueMart sorts by price but it takes the base price, the price which you enter. That means it does not take in consideration the calculation rules, it would cost too much performance.
Usually this does not hurt, because discounts are often done by categories. That means if all products are 20% cheaper the ordering stays the same.
Usually, if someone is using the "override price" option than it is very likely to set the product also on featured. So this does usually not really hurt.
The next problem is that we can have different prices per quantity, date and shoppergroup. So there can exist a lot final prices for one product.
The real solution of this problem is a cached price. Some search extensions do this already.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 10000
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: override price - sort order WRONG
« Reply #8 on: March 30, 2014, 16:50:09 pm »
found out, should not make a big difference by performance,

added modified.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

REandH

  • Beginner
  • *
  • Posts: 3
Re: override price - sort order WRONG
« Reply #9 on: February 08, 2015, 10:29:24 am »
Здравствуйте

2.0.22s
PHP Version 5.4.37
Joomla! 2.5.13 Stable

After editing the file administrator / components / com_virtuemart / models / product.php

Products are sorted well

But the button does not work select the direction of sorting by price (from smallest to largest and largest to smallest)

jenkinhill

  • UK Web Developer & Consultant
  • Global Moderator
  • Super Hero
  • *
  • Posts: 27605
  • Always on vacation
    • Jenkin Hill Internet
Re: override price - sort order WRONG
« Reply #10 on: February 08, 2015, 12:38:51 pm »
VM and Joomla versions are too old and insecure. http://forum.virtuemart.net/index.php?topic=118683.0

I think that sort issue was fixed around version 2.6
Kelvyn

Jenkin Hill Internet,
Lowestoft, Suffolk, UK

Unsolicited PMs/emails will be ignored.

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Currently using VM 3.6.10.10211 on Joomla 3.9.13 PHP 7.0.33