Hello,
I am using opencart 1.5.6.4 and I have journal 2 theme....My discount module is [discount_pack.xml 1.3. Jorim van Hove]
When I add a manufacturer discount for last users it's starting to belowing query. So my host suspend my domain. Because of thousend query working in 10 minute... Any idea and hep for this?
Thank you
SELECT DISTINCT *, pd.name AS name, p.image, a.name AS author, m.name AS manufacturer, (SELECT price FROM oc_product_discount pd2 WHERE pd2.product_id = p.product_id AND pd2.customer_group_id = '1' AND pd2.quantity = '1' AND ((pd2.date_start = '0000-00-00' OR pd2.date_start < NOW()) AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())) ORDER BY pd2.priority ASC, pd2.price ASC LIMIT 1) AS discount, (SELECT price FROM oc_product_special ps WHERE ps.product_id = p.product_id AND ps.customer_group_id = '1' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1) AS special, (SELECT points FROM oc_product_reward pr WHERE pr.product_id = p.product_id AND customer_group_id = '1') AS reward, (SELECT ss.name FROM oc_stock_status ss WHERE ss.stock_status_id = p.stock_status_id AND ss.language_id = '2') AS stock_status, (SELECT wcd.unit FROM oc_weight_class_description wcd WHERE p.weight_class_id = wcd.weight_class_id AND wcd.language_id = '2') AS weight_class, (SELECT lcd.unit FROM oc_length_class_description lcd WHERE p.length_class_id = lcd.length_class_id AND lcd.language_id = '2') AS length_class, (SELECT AVG(rating) AS total FROM oc_review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating, (SELECT COUNT(*) AS total FROM oc_review r2 WHERE r2.product_id = p.product_id AND r2.status = '1' GROUP BY r2.product_id) AS reviews, p.sort_order FROM oc_product p LEFT JOIN oc_product_description pd ON (p.product_id = pd.product_id) LEFT JOIN oc_product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN oc_author a ON (p.author_id = a.author_id) LEFT JOIN oc_manufacturer m ON (p.manufacturer_id = m.manufacturer_id) WHERE p.product_id = '951' AND pd.language_id = '2' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '0'\G
I am using opencart 1.5.6.4 and I have journal 2 theme....My discount module is [discount_pack.xml 1.3. Jorim van Hove]
When I add a manufacturer discount for last users it's starting to belowing query. So my host suspend my domain. Because of thousend query working in 10 minute... Any idea and hep for this?
Thank you
SELECT DISTINCT *, pd.name AS name, p.image, a.name AS author, m.name AS manufacturer, (SELECT price FROM oc_product_discount pd2 WHERE pd2.product_id = p.product_id AND pd2.customer_group_id = '1' AND pd2.quantity = '1' AND ((pd2.date_start = '0000-00-00' OR pd2.date_start < NOW()) AND (pd2.date_end = '0000-00-00' OR pd2.date_end > NOW())) ORDER BY pd2.priority ASC, pd2.price ASC LIMIT 1) AS discount, (SELECT price FROM oc_product_special ps WHERE ps.product_id = p.product_id AND ps.customer_group_id = '1' AND ((ps.date_start = '0000-00-00' OR ps.date_start < NOW()) AND (ps.date_end = '0000-00-00' OR ps.date_end > NOW())) ORDER BY ps.priority ASC, ps.price ASC LIMIT 1) AS special, (SELECT points FROM oc_product_reward pr WHERE pr.product_id = p.product_id AND customer_group_id = '1') AS reward, (SELECT ss.name FROM oc_stock_status ss WHERE ss.stock_status_id = p.stock_status_id AND ss.language_id = '2') AS stock_status, (SELECT wcd.unit FROM oc_weight_class_description wcd WHERE p.weight_class_id = wcd.weight_class_id AND wcd.language_id = '2') AS weight_class, (SELECT lcd.unit FROM oc_length_class_description lcd WHERE p.length_class_id = lcd.length_class_id AND lcd.language_id = '2') AS length_class, (SELECT AVG(rating) AS total FROM oc_review r1 WHERE r1.product_id = p.product_id AND r1.status = '1' GROUP BY r1.product_id) AS rating, (SELECT COUNT(*) AS total FROM oc_review r2 WHERE r2.product_id = p.product_id AND r2.status = '1' GROUP BY r2.product_id) AS reviews, p.sort_order FROM oc_product p LEFT JOIN oc_product_description pd ON (p.product_id = pd.product_id) LEFT JOIN oc_product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN oc_author a ON (p.author_id = a.author_id) LEFT JOIN oc_manufacturer m ON (p.manufacturer_id = m.manufacturer_id) WHERE p.product_id = '951' AND pd.language_id = '2' AND p.status = '1' AND p.date_available <= NOW() AND p2s.store_id = '0'\G
At this point, it would rather be suggested to find an extension on the Marketplace that can resolved this issue or to upgrade your store to a recent OC release to resolved this issue.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Well, this would probably solve your Problem, since your Extension(s) would no... upgrade your store to a recent OC release to resolved this issue
longer be working in the new OC 3.1.x release anyway. Among everything else.
But to settle with something below, means, to soon be confronted with a fast
spreading lack of knowledge, since many do not care much about so-called
'outdated' Versions anymore ... (for free, at least)
But did you ever try to switch to the Default Theme, to find out, if it then works? It
could be easier, compared with starting it all up from scratch again.
Ernie
Last edited by IP_CAM on Fri Jul 27, 2018 2:40 am, edited 1 time in total.
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
To whom does that refer exactly?to soon be confronted with a spreading
lack of knowledge
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Well, to those, looking for assistance, by Nature of things. But I did not countwith a spreading lack of knowledge - To whom does that refer exactly?
the amount of postings, where Posters have been encouraged to upgrade, instead
of getting a useful reply to their matters. It so partly has been left to some, like me, with
a rather limited knowledge on much, trying, to be of help. Otherways, I would probably
be around 3K postings, instead of 9.6 K already
And that's, what I call: a spreading lack of knowledge, how else could it be described?
Ernie
PS: And it will keep, to go on this way, I bet, soon, OC 3.0.x Users will be confronted with
exactly the same arguments, as they have been mentioned, many times already.
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Who is online
Users browsing this forum: No registered users and 44 guests