Post by tarikaone » Fri Mar 07, 2014 6:33 pm

Hey everyone, this is my first post so please be lenient :) I recently built an OpenCart site for a customer, though when I imported their catalog (a custom importer I built) which contained 14,000 listings I found that the product list in admin would lock up telling me that the header was corrupt.

After a fair bit of digging around and shouting at the screen, I realised something. This page calls getProducts() in the product model. The first query (line 335) unnecessarily selects the description column from the _product_descriptions table.

For stores with small product counts or products with short descriptions this is not an issue, but in my case the customer has descriptions that exceed 10kb per product some times. To fix this I wrote the following solution:

On line 335 (OC version 1.5.6.1)

Code: Select all

		$sql = "SELECT * FROM " . DB_PREFIX . "product p LEFT JOIN " ...
change to:

Code: Select all

		$sql = "SELECT p.*, pd.name FROM " . DB_PREFIX . "product p LEFT JOIN " ...
I know that the wildcard is useful in allowing the function to process filters, but there is no filter implemented to check the description so I am not sure why this has not been implemented yet. Finally is there a way to submit this as a possible bug fix? I think it would benefit others who have not discovered this issue who may in the future.

Thanks, and happy coding!

Steve

Newbie

Posts

Joined
Fri Mar 07, 2014 6:01 pm
Who is online

Users browsing this forum: No registered users and 2 guests