Hello,
I think i find a bug in the model products when $browseOrderByFields is been produced some content of the array is wrong. After showing the debug information from models/products.php on the BE [line70: vmdebug('$browseOrderByFields',$browseOrderByFields)] returns the following results.
Array
(
- => product_name
[1] => `p`.`created_on`
[2] => `p`.`product_sku`
[3] => product_s_desc
[4] => product_desc
[5] => category_name
[6] => category_description
[7] => mf_name
[8] => product_price
[9] => product_special
[10] => product_sales
[11] => product_availability
[12] => product_available_date
[13] => product_height
[14] => product_width
[15] => product_length
[16] => product_lwh_uom
[17] => product_weight
[18] => product_weight_uom
[19] => product_in_stock
[20] => low_stock_notification
[21] => `p`.`modified_on`
[22] => product_unit
[23] => product_packaging
[24] => `p`.`virtuemart_product_id`
[25] => ordering
)
Its attached a 'p'. ' ' to 4 strings.
After that order strings are created wrong. For example COM_VIRTUEMART_`CREATED_ON` is creating by adding a ' before the pf and after. This is happen to 4 strings. So when accessing from BE Configuration-->Product Order Settings these 4 string are appeared wrong and also if you have selected apeared wrong in the FE on category ordering or available search fields.
Regards,
BL
find the solution after a little bit more searching.
Inside administrator\components\com_virtuemart\helpers\shopfunctions.php in line 1403 the $filterArray was creating wrong string names for the function getValidProductFilterArray by attaching the `p`.`string`. I think by mistake was placed there or the developers wants to use 'p.modified_on' for example instead of '`p`.`modified_on`'.
From line 1403 to line 1410 change the following code from:
$filterArray = array('product_name', '`p`.`created_on`', '`p`.`product_sku`',
'product_s_desc', 'product_desc',
'category_name', 'category_description', 'mf_name',
'product_price', 'product_special', 'product_sales', 'product_availability', 'product_available_date',
'product_height', 'product_width', 'product_length', 'product_lwh_uom',
'product_weight', 'product_weight_uom', 'product_in_stock', 'low_stock_notification',
'`p`.`modified_on`',
'product_unit', 'product_packaging', '`p`.`virtuemart_product_id`', 'ordering');
to this:
$filterArray = array('product_name', 'created_on', 'product_sku',
'product_s_desc', 'product_desc',
'category_name', 'category_description', 'mf_name',
'product_price', 'product_special', 'product_sales', 'product_availability', 'product_available_date',
'product_height', 'product_width', 'product_length', 'product_lwh_uom',
'product_weight', 'product_weight_uom', 'product_in_stock', 'low_stock_notification',
'modified_on',
'product_unit', 'product_packaging', 'virtuemart_product_id', 'ordering');
or to this:
$filterArray = array('product_name', 'p.created_on', 'p.product_sku',
'product_s_desc', 'product_desc',
'category_name', 'category_description', 'mf_name',
'product_price', 'product_special', 'product_sales', 'product_availability', 'product_available_date',
'product_height', 'product_width', 'product_length', 'product_lwh_uom',
'product_weight', 'product_weight_uom', 'product_in_stock', 'low_stock_notification',
'p.modified_on',
'product_unit', 'product_packaging', 'p.virtuemart_product_id', 'ordering');
Hope be corrected by developers.
Thanks
BL
Okey without the ` then
i think there is an issue with editors many times when using `
no the ` is fine. `p`.myfield is imho correct
yes you have right, this should work fine, like '`p`.field' .... without ` on field ...
fixed in 2.0.9a :) thanks Milbo.
Milbo,
working with 209b and seems that the same issue hasn't resolved finally at the front-end. When expand a category and try order the url is wrong, take a look at the shot bellow. The url is creating after all in the fe is
category/by,`p`.created_on
should be by product_created_on, somewhere miss it, i could't find it.
Again the ' issue for FE.
[attachment cleanup by admin]
Reload it and you will see that it is sometimes something else not translated.
sorry, my mistake, the post have no to do with the translation, the ordering is the main issue. The url parameter is by,`p`.created_on instead of product_created_on!
its a bug somewhere, couldn't find it.
Update: Check the shot.
[attachment cleanup by admin]
the issue is coming again from shopfunctions line 1403, when you save ordering from the be, is stored with the `p`, but why adding product (p)? It does not needed it.
the right one for ordering category/by,created_on and not product_created_on.
So i think shopfunctions in line 1403 should change to:
$filterArray = array('product_name', 'created_on', 'product_sku',
'product_s_desc', 'product_desc',
'category_name', 'category_description', 'mf_name',
'product_price', 'product_special', 'product_sales', 'product_availability', 'product_available_date',
'product_height', 'product_width', 'product_length', 'product_lwh_uom',
'product_weight', 'product_weight_uom', 'product_in_stock', 'low_stock_notification',
'modified_on',
'product_unit', 'product_packaging', 'virtuemart_product_id', 'ordering');
With that changes be and fe ordering is working but i don't know is there are side affects.
Can you confirm it?
lol no.
It took a lot of posts and time to add them. They are necessary, when you have a category in the filter. The right answer is to adjust the FE,.. removing the `p` creating the language keys.
simple enough after all ;D
After the first fix at 15-08 works perfect and 'p' are absolute necessary. As we discussed with Milbo was a language issue.
Using a different language on my website front with SEF enabled the COM_VIRTUEMART_CREATED_ON key was missing from my language files, as a result when sef url produced was giving the actually string 'p'.created_on because nothing was found on the translation keys. By mistake, instead i knew that the key was missing, i was trying to blame shopfunctions and searching on the wrong way.
Thanks.
http://forum.virtuemart.net/index.php?topic=110676.msg376561#msg376561