marco-pm / zencart_instantsearch

Instant Search plugin for Zen Cart
GNU General Public License v3.0
2 stars 4 forks source link

Retrieving product names in mysql instead of php function. #10

Closed torvista closed 2 years ago

torvista commented 2 years ago

I note that you are using

$name  = zen_get_products_name($id);

instead of getting it in the original sql query. Do you think that is more efficient?

marco-pm commented 2 years ago

I made the change because of this comment (see second bullet point). I agree that it's less efficient. I'll revert it back, same for zen_get_category_name. The NOTIFY_INSTANT_SEARCH_PRIOR_ADD_RESULT notification can be used to modify the result without changing the code.

torvista commented 2 years ago

No need to revert it if there is a valid reason for someone. I doubt that there is any measurable difference.

marco-pm commented 2 years ago

Actually it does make a tiny difference, it's an additional db call for every product returned by the query (not just for each of the MAX_NUMBER_OF_RESULTS products). Also I don't like the inconsistent behavior (compared to the other fields), so I have reverted it back.