Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Table Sort Javascript Does Not Work In Advanced Search Rate Topic   - - - - -

 
  • yinyuantao
  • Newbie
  • Members
  • Join Date: 26-Jul 13
  • 9 posts

Posted 09 May 2014 - 09:39 AM #1

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
<script src="sorttable.js"></script> and <table id="mytable" border="1" class="sortable">

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

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22015 posts

Posted 12 May 2014 - 07:25 AM #2

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
<script src="sorttable.js"></script> and <table id="mytable" border="1" class="sortable">

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


Hi David,

Why you do not use php hooks in the fn_get_products function to sort products by custom fields in the database?
GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)

 
  • yinyuantao
  • Newbie
  • Members
  • Join Date: 26-Jul 13
  • 9 posts

Posted 19 May 2014 - 03:12 PM #3

Hi David,

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


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 fn_get_products is useful here, am I right?

 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 22015 posts

Posted 20 May 2014 - 08:42 AM #4

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 fn_get_products is useful here, am I right?


Thank you for the clarification. You are right, the hook in the php function cannot be used for this functionality.
GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    Multi-Vendor PLUS           USD 3100 (2775)
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      Multi-Vendor Ultimate       USD 7500 (6000)