Forums / General Questions / Attribute discount when product discount: Database hits

Attribute discount when product discount: Database hits

Locked

Started by lat9 on 12 Jan 2010, 9:31 PM · Views: 928

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
12 Jan 2010, 9:31 PM
#1
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,127
Plugin Contributions:
56

Attribute discount when product discount: Database hits

I'm working on an update to my site that involves a product with a gazillion attributes (i.e. more than 50). For a single product to be added to the cart, upwards of **4000 **database hits were registered.

Fussing around in admin, I found the "attribute is discounted when product is discounted". Turning that off resulted in less than **400 **hits.

The hits are centered on the shopping_cart class's 'calculate' function which is called whenever the cart's weight or current price is needed.

Just a heads-up.

P.S. If the shopping cart class did a calculate whenever the cart was changed, saving the current price and weight in a variable, and then just returned the variable when the weight/price was requested it would be a big savings!