News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

override price - sort order WRONG

Started by soura123, July 16, 2013, 08:24:12 AM

Previous topic - Next topic

soura123

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: 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

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

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

soura123

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

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

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

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

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

$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
QuoteMulti-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

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.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

found out, should not make a big difference by performance,

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

REandH

ЗSPAMравствуйте

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

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
Lowestoft, Suffolk, UK

Retired from forum life November 2023

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