Zen Cart Logo
Forums / General Questions / Checking - Disabling function zen_get_products_special_price to improve performance

Checking - Disabling function zen_get_products_special_price to improve performance

Locked

Views: 834

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
3 Jun 2009, 7:40 PM
#1
kevinw avatar

kevinw

New Zenner

Join Date:
Mar 2007
Posts:
47
Plugin Contributions:
0

Checking - Disabling function zen_get_products_special_price to improve performance

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

//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**
  

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
=====
3 Jun 2009, 8:19 PM
#2
mprough avatar

mprough

Totally Zenned

Join Date:
Nov 2007
Location:
Woodbine, Georgia, United States
Posts:
4,288
Plugin Contributions:
39

Re: Checking - Disabling function zen_get_products_special_price to improve performance

Have you looked at this option.....

Our results from this module have been phenomenal

http://www.data-diggers.com/query-cache-v1.6-released

~Melanie

3 Jun 2009, 8:31 PM
#3
kevinw avatar

kevinw

New Zenner

Join Date:
Mar 2007
Posts:
47
Plugin Contributions:
0

Re: Checking - Disabling function zen_get_products_special_price to improve performance

I will check out and try query cache and report back.. thanks...