Community Add-Ons
Optimize also_purchased_products module
for osCommerce Online Merchant v2.2
This module optimizes the also_purchased_products module.
Eliminates the (EXPLAIN) Use temporary, Use filesort.
Increases speed and performance on the product_info pages.
Includes screenshots of the explain query output.
Also, stock osC code is intact in this file and can be switch back and forth by a simple define at the top of the file.
--removed products that are not live--
I have rewritten the way the initial selections are done, this makes mySQL do all of the work and means there is no limit or penalty on very popular products. This now also only returns the number of items you would like to display (MAX_DISPLAY_ALSO_PURCHASED) and you can also change how this selects them by changing line 111&118 which currently selects the most popular products :-
Or
To select the most expensive products :-
111 - SELECT op2.products_id, p2.products_image, p2.products_price
118 - GROUP BY op2.products_id, p2.products_image, p2.products_price
Or
To select by the newest products :-
111 - SELECT op2.products_id, p2.products_image, p2.products_date_added
118 - GROUP BY op2.products_id, p2.products_image, p2.products_date_added
Or
To select by the products you have the most of :-
111 - SELECT op2.products_id, p2.products_image, p2.products_quantity
118 - GROUP BY op2.products_id, p2.products_image, p2.products_quantity
…. And the list goes on ….
The zip should be the complete install.
HTH
Si.
