Table Sort Javascript Does Not Work In Advanced Search

Basically I want to sorting the product table return by advanced search, the product table have custom column generated in run time so I don't think the cs cart default search will work.



So I try to use table sort javascript to do the job. There are lots of example online. You just need put

and

They all test good in simple HTML. But when I put it into cs-cart, it won't work. Of course, I refresh the cache and can see the new code in the browser debugger.

Please help! Thanks.


David

[quote name='yinyuantao' timestamp='1399628399' post='183194']

Basically I want to sorting the product table return by advanced search, the product table have custom column generated in run time so I don't think the cs cart default search will work.



So I try to use table sort javascript to do the job. There are lots of example online. You just need put

and

They all test good in simple HTML. But when I put it into cs-cart, it won't work. Of course, I refresh the cache and can see the new code in the browser debugger.

Please help! Thanks.


David
[/quote]

Hi David,

Why you do not use php hooks in the fn_get_products function to sort products by custom fields in the database?

[quote name='eComLabs' timestamp='1399879521' post='183316']

Hi David,



Why you do not use php hooks in the fn_get_products function to sort products by custom fields in the database?

[/quote]



It's not a field in the database.



We have many features such as A, B, C, D, each product may contains more than one features. We search products with multiple features check box. Then we create a percentage match column in result data table.

percentage match = (features number used in the search)/(features number for product )

So if I search products with features A, B, the one of result product contains features A, B, C, we will get percentage match = 2/3 .



I don't think [color=#282828][font=arial, verdana, tahoma, sans-serif]fn_get_products is useful here, am I right? [/font][/color]

[quote name='yinyuantao' timestamp='1400512376' post='183807']

It's not a field in the database.



We have many features such as A, B, C, D, each product may contains more than one features. We search products with multiple features check box. Then we create a percentage match column in result data table.

percentage match = (features number used in the search)/(features number for product )

So if I search products with features A, B, the one of result product contains features A, B, C, we will get percentage match = 2/3 .



I don't think [color=#282828][font=arial, verdana, tahoma, sans-serif]fn_get_products is useful here, am I right? [/font][/color]

[/quote]



Thank you for the clarification. You are right, the hook in the php function cannot be used for this functionality.