I am working to improve performance (without changing hosts) - by reducing the number of queries performed... So I looked into the query logs to see what was happening.
I have determined that I could return immediately from
function zen_get_products_special_price
without doing any of the operations since we don't have any specials/sales, there is no need to do the work to determine such. This then reduces our query counts by over 50%.
And function attributes_weight helps a bit more.
includes/classes/shopping_cart.php
admin/includes/functions/function_prices.php
includes/classes/shopping_cart.php
Those of you that have spent more time in the code (I have only been looking at this for a week or two) might have an opinion or three that this is a good/bad idea. We don't need Specials/Sales and it seems to work on my testing...
I don't think this is breaking anything else... or is it?...
/includes/functions/function_prices.php
~~line~~#13 (1.3.7 #25 (1.3.8a
admin/includes/functions/function_prices.php
~~line~~#24
Code:
//get specials price or sale price
function zen_get_products_special_price($product_id, $specials_price_only=false) {
// Kevin added - and return false for no special prices
return false;
// Kevin end of added
global $db;
....
========================
I also thought to disable attribute weight checks to help a bit more - as there is no shipping by weight...
includes/classes/shopping_cart.php
~~line~~#1007 (1.3.7 #2013 (1.3.8a
Code:
function attributes_weight($products_id) {
global $db;
$attribute_weight = 0;
// Kevin add - return 0 attribute weight
return $attribute_weight;
// Kevin end add
if (isset($this->contents[$products_id]['attributes'])) {
....
=======================================
If specials/sales are needed then we will take a different strategy - but for now - thoughts? Things missing?..
Thanks...
KevinW
=====
Bookmarks