Jump to content



* - - - - 3 votes

Quantity Price Breaks


  • Please log in to reply
885 replies to this topic

#41   zzzzz

zzzzz
  • Members
  • 3 posts
  • Real Name:Andy

Posted 02 November 2006 - 09:35 PM

Hi guys,
I very need your help!
I'm bulding my commercial website and know almost nothing about php programming.
I added this mod to my site (the 1.2 version) and everything it looked Ok, except one BIG THING!
When I search a product from the search bar it says (note that the word inserted was "pc":

1054 - Unknown column 'p.products_id' in 'on clause'

select count(distinct p.products_id) as total from products p left join manufacturers m using(manufacturers_id), products_description pd left join specials s on p.products_id = s.products_id, categories c, products_to_categories p2c where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and ((pd.products_name like '%pc%' or p.products_model like '%pc%' or m.manufacturers_name like '%pc%') )

I can tell you that my site is on a Linux server using a Mysql 5.0 or more, and that I update it using the post. Infact it worked well for the product description that had the same problem, but not with the search bar.
I hope that I was clear in this my description, and that somebody can solve my problem.

Thanks.
Bye

#42   Velvet Hammer

Velvet Hammer
  • Members
  • 5 posts
  • Real Name:Kristy

Posted 09 November 2006 - 06:05 PM

Hello everyone.  I'm new to osCommerce and pretty unfamiliar with working with templates in general on websites.  I've downloaded Discountplus, as it's supposed to do exactly what I need:
~ I need one product to have a price break.  If a customer buys one of the product, he pays $23 for it.  If he orders 2 or more, he gets them for $20 each.  There is just this one product I need this feature for.
By the looks of the searching I've done thru the forums and contributions, Discountplus is what I need.  Perhaps it's just me, but the instructions seem confusing.
Could anyone give me some direction as to what to do with these files once I've got them?  I appreciate any assistance.  taifun89343, How did you get this to work?  Thanks!

#43   Velvet Hammer

Velvet Hammer
  • Members
  • 5 posts
  • Real Name:Kristy

Posted 10 November 2006 - 12:33 AM

Never mind.  I got it working perfectly.

#44   dcross02

dcross02
  • Members
  • 49 posts
  • Real Name:David Ross

Posted 15 November 2006 - 06:13 PM

Does anyone know how to get Quantity Price Breaks to work with Simple Template System STS? I can't figure out how to make a placeholder.

#45   Melinda Odom

Melinda Odom
  • Members
  • 1,212 posts
  • Real Name:Melinda Odom
  • Gender:Female
  • Location:United States

Posted 23 November 2006 - 09:45 PM

I had this contribution installed but when you enabled the price column in the store admin under config/product listing all the prices showed "0" zero.  Yes the prices were listed when you clicked the product to read further information but the prices said zero on the product listing page.

Can someone please help?

Thank you!

#46   Spyros

Spyros
  • Members
  • 19 posts
  • Real Name:Spyros Vlachopoulos
  • Location:Greece

Posted 28 November 2006 - 02:04 PM

View Postdcross02, on Nov 15 2006, 06:13 PM, said:

Does anyone know how to get Quantity Price Breaks to work with Simple Template System STS? I can't figure out how to make a placeholder.

I think I do  :P

go to:
catalog/includes/sts_product_info.php

find:
$template['regularprice'] = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
replace with:
// $template['regularprice'] = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
$template['regularprice'] = $products_price=$pf->getPriceString();

find:
// See if any product reviews
above add:
$template['changequantity'] = TEXT_ENTER_QUANTITY . ":" . tep_draw_input_field('cart_quantity', $pf->adjustQty(1), 'size="6"');


Now the box with muliple prices will show on your product info sts template
Also you can add:
$changequantity
wherever you want the quantity input field would like to appear!

Everything else is working out of the box!

Good luck!
Spyros

#47   echo242372

echo242372
  • Members
  • 5 posts
  • Real Name:Wayne Lynn

Posted 10 December 2006 - 04:54 AM

I install Quantity Price Breaks Per Product contribution successfully (version 1.11.2 correction I believe). It works as it is supposed to, and up to my expectations. I didn't notice any problems until a customer brought one to my attention. As a result I installed chemo's "Output Queries Debug" contribution to aid me in find the cause.

The problem I am having is when I add multiple products to the shopping cart, the MySQL server gets taxed hard. For every single product I add to the shopping cart, it adds 7 new MySQL queries, and with every new product added the page parse time increases.

As an example I added 10 products to my shopping cart, after I added the 10th product, the number of MySQL queries was up to 91, and the page parse time was at 133 seconds.

I've copied and pasted the QUERY DEBUG OUTPUT below:

[code]
Current Parse Time: 133.796 s with 91 queries
QUERY DEBUG:

Array
(
[QUERIES] => Array
(
[0] => select value from sessions where sesskey = '4274e13ca3d65d35a0028d0120c4c407' and expiry > '1165719990'
[1] => select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from currencies
[2] => delete from whos_online where time_last_click < '1165719090'
[3] => select count(*) as count from whos_online where session_id = '4274e13ca3d65d35a0028d0120c4c407'
[4] => update whos_online set customer_id = '0', full_name = 'Guest', ip_address = '207.40.146.116', time_last_click = '1165719990', last_page_url = '/~opamp/catalog/shopping_cart.php?sort=3a' where session_id = '4274e13ca3d65d35a0028d0120c4c407'
[5] => select banners_id, date_scheduled from banners where date_scheduled != ''
[6] => select b.banners_id, b.expires_date, b.expires_impressions, sum(bh.banners_shown) as banners_shown from banners b, banners_history bh where b.status = '1' and b.banners_id = bh.banners_id group by b.banners_id
[7] => select specials_id from specials where status = '1' and now() >= expires_date and expires_date > 0
[8] => select products_id, products_image, products_tax_class_id, products_price from products where products_status = '1' order by products_date_added desc limit 20
[9] => select products_name from products_description where products_id = '1019' and language_id = '1'
[10] => select specials_new_products_price from specials where products_id = '1019' and status
[11] => select sum(tax_rate) as tax_rate from tax_rates tr left join zones_to_geo_zones za on (tr.tax_zone_id = za.geo_zone_id) left join geo_zones tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '223') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '57') and tr.tax_class_id = '1' group by tr.tax_priority
[12] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '1016'   and pd.products_id = '1016'   and pd.language_id = '1'
[13] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '1015'   and pd.products_id = '1015'   and pd.language_id = '1'
[14] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '150'   and pd.products_id = '150'   and pd.language_id = '1'
[15] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '154'   and pd.products_id = '154'   and pd.language_id = '1'
[16] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '155'   and pd.products_id = '155'   and pd.language_id = '1'
[17] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '165'   and pd.products_id = '165'   and pd.language_id = '1'
[18] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '900'   and pd.products_id = '900'   and pd.language_id = '1'
[19] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '904'   and pd.products_id = '904'   and pd.language_id = '1'
[20] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '973'   and pd.products_id = '973'   and pd.language_id = '1'
[21] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '756'   and pd.products_id = '756'   and pd.language_id = '1'
[22] => select products_quantity from products where products_id = '1016'
[23] => select products_quantity from products where products_id = '1015'
[24] => select products_quantity from products where products_id = '150'
[25] => select products_quantity from products where products_id = '154'
[26] => select products_quantity from products where products_id = '155'
[27] => select products_quantity from products where products_id = '165'
[28] => select products_quantity from products where products_id = '900'
[29] => select products_quantity from products where products_id = '904'
[30] => select products_quantity from products where products_id = '973'
[31] => select products_quantity from products where products_id = '756'
[32] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '1016'   and pd.products_id = '1016'   and pd.language_id = '1'
[33] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '1015'   and pd.products_id = '1015'   and pd.language_id = '1'
[34] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '150'   and pd.products_id = '150'   and pd.language_id = '1'
[35] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '154'   and pd.products_id = '154'   and pd.language_id = '1'
[36] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '155'   and pd.products_id = '155'   and pd.language_id = '1'
[37] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '165'   and pd.products_id = '165'   and pd.language_id = '1'
[38] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '900'   and pd.products_id = '900'   and pd.language_id = '1'
[39] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '904'   and pd.products_id = '904'   and pd.language_id = '1'
[40] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '973'   and pd.products_id = '973'   and pd.language_id = '1'
[41] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '756'   and pd.products_id = '756'   and pd.language_id = '1'
[42] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '1016'   and pd.products_id = '1016'   and pd.language_id = '1'
[43] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '1015'   and pd.products_id = '1015'   and pd.language_id = '1'
[44] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '150'   and pd.products_id = '150'   and pd.language_id = '1'
[45] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '154'   and pd.products_id = '154'   and pd.language_id = '1'
[46] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '155'   and pd.products_id = '155'   and pd.language_id = '1'
[47] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '165'   and pd.products_id = '165'   and pd.language_id = '1'
[48] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '900'   and pd.products_id = '900'   and pd.language_id = '1'
[49] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '904'   and pd.products_id = '904'   and pd.language_id = '1'
[50] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '973'   and pd.products_id = '973'   and pd.language_id = '1'
[51] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '756'   and pd.products_id = '756'   and pd.language_id = '1'
[52] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '1016'   and pd.products_id = '1016'   and pd.language_id = '1'
[53] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '1015'   and pd.products_id = '1015'   and pd.language_id = '1'
[54] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '150'   and pd.products_id = '150'   and pd.language_id = '1'
[55] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '154'   and pd.products_id = '154'   and pd.language_id = '1'
[56] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '155'   and pd.products_id = '155'   and pd.language_id = '1'
[57] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '165'   and pd.products_id = '165'   and pd.language_id = '1'
[58] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '900'   and pd.products_id = '900'   and pd.language_id = '1'
[59] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '904'   and pd.products_id = '904'   and pd.language_id = '1'
[60] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '973'   and pd.products_id = '973'   and pd.language_id = '1'
[61] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '756'   and pd.products_id = '756'   and pd.language_id = '1'
[62] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '1016'   and pd.products_id = '1016'   and pd.language_id = '1'
[63] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '1015'   and pd.products_id = '1015'   and pd.language_id = '1'
[64] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '150'   and pd.products_id = '150'   and pd.language_id = '1'
[65] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '154'   and pd.products_id = '154'   and pd.language_id = '1'
[66] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '155'   and pd.products_id = '155'   and pd.language_id = '1'
[67] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '165'   and pd.products_id = '165'   and pd.language_id = '1'
[68] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '900'   and pd.products_id = '900'   and pd.language_id = '1'
[69] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '904'   and pd.products_id = '904'   and pd.language_id = '1'
[70] => select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8, p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from products_description pd,   products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id,   products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1'   and p.products_id = '973'   and pd.products_id = &#

#48   echo242372

echo242372
  • Members
  • 5 posts
  • Real Name:Wayne Lynn

Posted 10 December 2006 - 04:58 AM

I install Quantity Price Breaks Per Product contribution successfully (version 1.11.2 correction I believe). It works as it is supposed to, and up to my expectations. I didn't notice any problems until a customer brought one to my attention. As a result I installed chemo's "Output Queries Debug" contribution to aid me in find the cause.

The problem I am having is when I add multiple products to the shopping cart, the MySQL server gets taxed hard. For every single product I add to the shopping cart, it adds 7 new MySQL queries, and with every new product added the page parse time increases.

As an example I added 10 products to my shopping cart, after I added the 10th product, the number of MySQL queries was up to 91, and the page parse time was at 133 seconds.

I've copied and pasted the QUERY DEBUG OUTPUT below:

edited to added: tried posting the debug report, but the forums cut my post off midway through.. I've added a link to a txt document in my profile under interest.

If you look at where all the time is going to parse the page, it pretty much all taken by queries to pull the product pages in the MySQL database including price breaks 1 through 8

My store has around 820 products, is hosted on a virtual dedicated server running apache/Linux and MySQL 4.1.21-standard.

For the type of types of products I sell, it wouldn't be uncommon for a customer to add dozens of different products to their shopping, but with each product they add, the page load time get longer and longer, and eventually to the point where it's ridiculous. I think this problem is creating a bad shopping experience and is costing me both customers and orders.

I would like to know if anyone else experiences this same problem. Is there a solution to my problem? If so, what? If you need any additional information, please just ask.. Any help would be appreciated. Thank you.

Best Regards,
Wayne

#49 ONLINE   Jan Zonjee

Jan Zonjee

    Governor of Peace

  • Core Team
  • 7,086 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 10 December 2006 - 10:56 AM

View Postecho242372, on Dec 10 2006, 05:58 AM, said:

If you look at where all the time is going to parse the page, it pretty much all taken by queries to pull the product pages in the MySQL database including price breaks 1 through 8.
From the debug it looks like the same information is queried 5 times so it would definetely help if that info was stored in some additional PriceBreakStore class and the info taken from that class instead of doing it 5 times. The shopping cart class is probably responsible for that. The function get_products calls PriceFormatter for every product and then calculate (to get the total price) does it again.

Part of the problem you have is that some of these queries take exceptionally long (up to 12 seconds). Now the function loadProduct in PriceFormatter IMHO contains a lot of crud with which nothing is done (adding the tables products_to_categories, manucturers and products_description in the query where no information is taken from it doesn't help).

Can  you try replacing that function with this one:
function loadProduct($product_id, $language_id=1)
{
// get rid of all the extra info this query was getting, we are only interested in prices!
$sql = "select p.products_id, p.products_price, " .
" p.products_price1,p.products_price2,p.products_price3,p.products_price4, " . 
" p.products_price5,p.products_price6,p.products_price7,p.products_price8," .
" p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty," .
" p.products_qty_blocks, p.products_tax_class_id," .
" IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price," .
" from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s using(products_id) " .
" where p.products_status = '1' and p.products_id = '" . (int)$product_id . "' ";

$product_info_query = tep_db_query($sql);
$product_info = tep_db_fetch_array($product_info_query);
$this->parse($product_info);

return $product_info;
}
Make sure there are no "expired" specials still around together with valid specials for a certain product_id.
I remember from posts that people find that having specials slowed down their shop a lot, so if this is still a slow query it can be split in two. That makes a lot of queries but if they are fast the customer suffers less.

#50 ONLINE   Jan Zonjee

Jan Zonjee

    Governor of Peace

  • Core Team
  • 7,086 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 10 December 2006 - 10:57 PM

View Postecho242372, on Dec 10 2006, 05:58 AM, said:

Is there a solution to my problem?
Perhaps this works. Instead of the function loadProduct shown above try the one below (keeps backups of changed files!). First save the following code as a file called PriceFormatterStore.php in catalog/includes/classes:
<?php
/* $Id: PriceFormatterStore.php v 1.0 2006/12/10
   an object to store the price breaks of a product once queried by the class PriceFormatter.php
	 to avoid it being queried more than once
	 
   osCommerce, Open Source E-Commerce Solutions
   http://www.oscommerce.com

   Copyright (c) 2006 osCommerce

  Released under the GNU General Public License
*/

class PriceFormatterStore {
	var $pricebreaks = array();

	function addPriceBreakData ($products_id, $productinfo) {
			$this->pricebreaks[$products_id] = array('products_id' => tep_get_prid($productinfo['products_id']),
				'products_price' => $productinfo['products_price'],
				'products_name' => $productinfo['products_name'],
				'products_model' => $productinfo['products_model'],
				'products_weight' => $productinfo['products_weight'],
				'products_tax_class_id' => $productinfo['products_tax_class_id'],
				'products_image' => $productinfo['products_image'],
				'products_qty_blocks' => $productinfo['products_qty_blocks'],
				'specials_new_products_price' => $productinfo['specials_new_products_price'],
				'products_price1_qty' => $productinfo['products_price1_qty'],
				'products_price2_qty' => $productinfo['products_price2_qty'],
				'products_price3_qty' => $productinfo['products_price3_qty'],
				'products_price4_qty'=> $productinfo['products_price4_qty'],
				'products_price5_qty'=> $productinfo['products_price5_qty'],
				'products_price6_qty'=> $productinfo['products_price6_qty'],
				'products_price7_qty' => $productinfo['products_price7_qty'],
				'products_price8_qty' => $productinfo['products_price8_qty'],
				'products_price1' => $productinfo['products_price1'],
				'products_price2' => $productinfo['products_price2'],
				'products_price3'=> $productinfo['products_price3'],
				'products_price4' => $productinfo['products_price4'],
				'products_price5'=> $productinfo['products_price5'],
				'products_price6' => $productinfo['products_price6'],
				'products_price7' => $productinfo['products_price7'],
				'products_price8' => $productinfo['products_price8']);
	}
	
  function getPriceBreak($product_id) {
		$products_id = tep_get_prid($product_id);
		if(isset($this->pricebreaks[$products_id]) && tep_not_null($this->pricebreaks[$products_id])) {
			return $this->pricebreaks[$products_id];
			}	else {
				return false;
		}
	}
}
?>
Then change application_top.php where the class PriceFormatter.php is included to:
  // include the price formatter for the price breaks contribution
  require(DIR_WS_CLASSES . 'PriceFormatter.php');
  $pf = new PriceFormatter;
	require(DIR_WS_CLASSES . 'PriceFormatterStore.php');
  $pfs = new PriceFormatterStore;
Then change the function loadProduct in the class PriceFormatter.php to:
function loadProduct($product_id, $language_id=1)
  {
	global $pfs;
		
	$pricebreak = $pfs->getPriceBreak($product_id);
	// returns false if the price break information is not yet stored
	if ($pricebreak != false) {
		$product_info = $pricebreak;
	} else {		
   $sql="select pd.products_name, p.products_model, p.products_image, p.products_id," .
   " p.manufacturers_id, p.products_price, p.products_weight," .
   " p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8," .
   " p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty," .
   " p.products_qty_blocks," .
   " p.products_tax_class_id," .
   " IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price," .
   " from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " using(products_id), " .
   " " . TABLE_PRODUCTS_DESCRIPTION . " pd " .
   " where p.products_status = '1'" .
   " and pd.products_id = p.products_id " .
   " and p.manufacturers_id = m.manufacturers_id " .
   " and p.products_id = '" . (int)$product_id . "'" .
   " and pd.language_id = '". (int)$language_id ."'";

   $product_info_query = tep_db_query($sql);
   $product_info = tep_db_fetch_array($product_info_query);
	 $pfs->addPriceBreakData(tep_get_prid($product_id), $product_info);
	}
$this->parse($product_info);

return $product_info;
}
The idea is to simplify the query in PriceFormatter (and hopefully make it quicker) and then only query the information once.

#51   echo242372

echo242372
  • Members
  • 5 posts
  • Real Name:Wayne Lynn

Posted 14 December 2006 - 05:34 AM

Thank you JanZ..

I applied your fix in your last post to my store, and ran into a few problems with MySQL errors, but I was able to muddle my way through the errors, and I was finally able to get it to work. Boy its one heck of an improvement.

After I applied the fix, I repeated my test of adding 10 products to my shopping cart, and by the end of the 10th product, MySQL queries was at 43 queries, and the page loaded at 15.42 seconds. For each product I added, it added only 2 MySQL queries.

When compared with the previous test where each product I added to my shopping cart added 6 new MySQL queries it's great.

In summary:

MySQL queries decreased by 52% (From 91 to 43 queries)
Page load time decreased by 88% (From 133 to 15.42 seconds)
Number of MySQL queries added per product added to the shopping cart decreased by 66% (From 6 to 2 queries)

I uploaded a new copy of the QUERY DEBUG OUTPUT report in my profile under interest for your reference.

As far as the MySQL errors I was getting with your fix, the error was in your changes to the loadProduct function in PriceFormatter.php

I'm not great with PHP, so I don't know exactly what I did to get it to work, but essentially what I did was incrementally revert the loadProduct function back to it's original state (before your fix) until it worked. Like throwing pasta against the wall until you find one that sticks.

Anyways, here's a copy of the LoadProduct function I got to work:


 function loadProduct($product_id, $language_id=1)
  {
	global $pfs;
		
	$pricebreak = $pfs->getPriceBreak($product_id);
	// returns false if the price break information is not yet stored
	if ($pricebreak != false) {
		$product_info = $pricebreak;
	} else {		
   $sql="select pd.products_name, p.products_model, p.products_image, p.products_id," .
   " p.manufacturers_id, p.products_price, p.products_weight," .
   " p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8," .
   " p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty," .
   " p.products_qty_blocks," .
   " p.products_tax_class_id," .
   " IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price," .
   " IF(s.status, s.specials_new_products_price, p.products_price) as final_price" .
   " from " . TABLE_PRODUCTS_DESCRIPTION . " pd," .
		"	  " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id," .
		"	  " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id" .
		" where p.products_status = '1'" .
		"   and p.products_id = '" . (int)$product_id . "'" .
		"   and pd.products_id = '" . (int)$product_id . "'" .
		"   and pd.language_id = '". (int)$language_id ."'";

   $product_info_query = tep_db_query($sql);
   $product_info = tep_db_fetch_array($product_info_query);
	 $pfs->addPriceBreakData(tep_get_prid($product_id), $product_info);
	}
$this->parse($product_info);

return $product_info;
}

Thank you once again for your help.

Best Regards,
Wayne

#52 ONLINE   Jan Zonjee

Jan Zonjee

    Governor of Peace

  • Core Team
  • 7,086 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 14 December 2006 - 12:15 PM

View Postecho242372, on Dec 14 2006, 06:34 AM, said:

I applied your fix in your last post to my store, and ran into a few problems with MySQL errors
I used the PriceBreak for SPPC so I did not test this query really. My fault. I see I left a comma in (in the line with specials) and I forgot to remove one line. Replacing this part should work better:
   " IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price " .
   " from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " using(products_id), " .
   " " . TABLE_PRODUCTS_DESCRIPTION . " pd " .
   " where p.products_status = '1'" .
   " and pd.products_id = p.products_id " .
   " and p.products_id = '" . (int)$product_id . "'" .
   " and pd.language_id = '". (int)$language_id ."'";

Quote

After I applied the fix, I repeated my test of adding 10 products to my shopping cart, and by the end of the 10th product, MySQL queries was at 43 queries, and the page loaded at 15.42 seconds. For each product I added, it added only 2 MySQL queries.
And no double ones: one for the quantity and one for the PriceFormatter. The last one is by far the slowest in the queries (1-2 seconds). Therefore the interest to speed up this particular query by removing the joints to tables from which no information is queried (products_to_categories and manufacturers).

#53   echo242372

echo242372
  • Members
  • 5 posts
  • Real Name:Wayne Lynn

Posted 15 December 2006 - 12:21 AM

OMFG Janz, that's incredible!

Pages are loading incredibly fast now. Under 3 seconds 98% of the time, and mostly under 1 or 2 seconds regardless of the number of products added to the shopping cart.

Testing it out, I added 42 products to the shopping cart, and page parse time came in at 1.397 seconds. Blazing fast compared to the 133 seconds I was getting with only 10 products added to the cart just a few days ago.

I've included the latest query debug report in my profile under interests.

As far as the code you provided I had to make a small change because MySQL was complaining about an "Unknown table 's' in field list". Turns out it was this field


TABLE_SPECIALS . " using(products_id), " .[quote]

I just replaced it with:

[/quote]TABLE_SPECIALS . " s on p.products_id = s.products_id, " .

The final loadProduct function in PriceFormatter.php I used looks like this:

function loadProduct($product_id, $language_id=1)
  {
	global $pfs;
		
	$pricebreak = $pfs->getPriceBreak($product_id);
	// returns false if the price break information is not yet stored
	if ($pricebreak != false) {
		$product_info = $pricebreak;
	} else {		
   $sql="select pd.products_name, p.products_model, p.products_image, p.products_id," .
   " p.manufacturers_id, p.products_price, p.products_weight," .
   " p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8," .
   " p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty," .
   " p.products_qty_blocks," .
   " p.products_tax_class_id," .
   " IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price " .
   " from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " .
   " " . TABLE_PRODUCTS_DESCRIPTION . " pd " .
   " where p.products_status = '1'" .
   " and pd.products_id = p.products_id " .
   " and p.products_id = '" . (int)$product_id . "'" .
   " and pd.language_id = '". (int)$language_id ."'";

   $product_info_query = tep_db_query($sql);
   $product_info = tep_db_fetch_array($product_info_query);
	 $pfs->addPriceBreakData(tep_get_prid($product_id), $product_info);
	}
$this->parse($product_info);

return $product_info;
}

Thanks you so much for your help. I can't even express how grateful I am. I'm ecstatic about how fast everything is loading now...

Best Regards,
Wayne

#54 ONLINE   Jan Zonjee

Jan Zonjee

    Governor of Peace

  • Core Team
  • 7,086 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 16 December 2006 - 12:26 PM

View Postecho242372, on Dec 15 2006, 01:21 AM, said:

I'm ecstatic about how fast everything is loading now...
OK, sorry about the foul-up with specials s, I'm testing this on a SPPC installation so can't test the actual query.

Let's take it one more step further, to bring it down to 1 query for all products in the shopping cart instead of (number of products) * 2. For this we add products_quantity to the loadProduct function and add the function PriceFormatterStore to the class PriceFormatterStore and change tep_get_tep_get_products_stock.

The new class PriceFormatterStore:
<?php
/* $Id: PriceFormatterStore.php v 1.0 2006/12/10
   an object to store the price breaks and products_quantity of a product once queried by the 
	 class PriceFormatter.php to avoid it being queried more than once and tep_get_stock to be executed
	 for each product on the page shopping_cart.php
	 
   osCommerce, Open Source E-Commerce Solutions
   http://www.oscommerce.com

   Copyright (c) 2006 osCommerce

  Released under the GNU General Public License
*/

class PriceFormatterStore {
	var $pricebreaks = array();
	
	function PriceFormatterStore() {
		global $cart;
		if (isset($_SESSION['languages_id'])) {
		$language_id = $_SESSION['languages_id'];
		} else {
			$language_id = 1;
		}
		if (is_object($cart)) {
			$product_id_list = $cart->get_product_id_list();
			if (tep_not_null($product_id_list)) {
				// get rid of attributes first
				$product_id_list_array = array();
				$product_id_list_temp_array = explode(",", $product_id_list);
				foreach ($product_id_list_temp_array as $key => $value) {
					$product_id_list_array[] = tep_get_prid($value);
				}
				unset($product_id_list);
				$product_id_list = implode(",", $product_id_list_array);
				// now do one query for all products in the shopping basket
   $sql="select pd.products_name, p.products_model, p.products_image, p.products_id," .
   " p.manufacturers_id, p.products_price, p.products_weight, p.products_quantity, " .
   " p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8," .
   " p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty," .
   " p.products_qty_blocks," .
   " p.products_tax_class_id," .
   " IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price " .
   " from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " .
   " " . TABLE_PRODUCTS_DESCRIPTION . " pd " .
   " where p.products_status = '1'" .
   " and pd.products_id = p.products_id " .
   "   and p.products_id in (" . $product_id_list . ")" .
   " and pd.language_id = '". (int)$language_id ."'";
					$product_info_query = tep_db_query($sql);
						while ($product_info = tep_db_fetch_array($product_info_query)) {
							$this->addPriceBreakData($product_info['products_id'], $product_info);
						}
			} // end if tep_not_null($product_id_list)
		} // end if (is_object($cart)
	}

	function addPriceBreakData ($products_id, $productinfo) {
			$this->pricebreaks[$products_id] = array('products_id' => tep_get_prid($productinfo['products_id']),
				'products_price' => $productinfo['products_price'],
				'products_name' => $productinfo['products_name'],
				'products_model' => $productinfo['products_model'],
				'products_weight' => $productinfo['products_weight'],
				'products_quantity' => $productinfo['products_quantity'],
				'products_tax_class_id' => $productinfo['products_tax_class_id'],
				'products_image' => $productinfo['products_image'],
				'products_qty_blocks' => $productinfo['products_qty_blocks'],
				'specials_new_products_price' => $productinfo['specials_new_products_price'],
				'products_price1_qty' => $productinfo['products_price1_qty'],
				'products_price2_qty' => $productinfo['products_price2_qty'],
				'products_price3_qty' => $productinfo['products_price3_qty'],
				'products_price4_qty'=> $productinfo['products_price4_qty'],
				'products_price5_qty'=> $productinfo['products_price5_qty'],
				'products_price6_qty'=> $productinfo['products_price6_qty'],
				'products_price7_qty' => $productinfo['products_price7_qty'],
				'products_price8_qty' => $productinfo['products_price8_qty'],
				'products_price1' => $productinfo['products_price1'],
				'products_price2' => $productinfo['products_price2'],
				'products_price3'=> $productinfo['products_price3'],
				'products_price4' => $productinfo['products_price4'],
				'products_price5'=> $productinfo['products_price5'],
				'products_price6' => $productinfo['products_price6'],
				'products_price7' => $productinfo['products_price7'],
				'products_price8' => $productinfo['products_price8']);
	}
	
  function getPriceBreak($product_id) {
		$products_id = tep_get_prid($product_id);
		if(isset($this->pricebreaks[$products_id]) && tep_not_null($this->pricebreaks[$products_id])) {
			return $this->pricebreaks[$products_id];
			}	else {
				return false;
		}
	}
	
  function getStock($product_id) {
		$products_id = tep_get_prid($product_id);
		if(isset($this->pricebreaks[$products_id]) && tep_not_null($this->pricebreaks[$products_id])) {
			return $this->pricebreaks[$products_id]['products_quantity'];
			}	else {
				return false;
		}
	}
}
?>
In application_top.php it is still:
  // include the price formatter for the price breaks contribution
  require(DIR_WS_CLASSES . 'PriceFormatter.php');
  $pf = new PriceFormatter;
	require(DIR_WS_CLASSES . 'PriceFormatterStore.php');
  $pfs = new PriceFormatterStore;
In the function loadProduct in PriceFormatter.php products_quantity is added to the sql:
function loadProduct($product_id, $language_id=1)
  {
	global $pfs;
		
	$pricebreak = $pfs->getPriceBreak($product_id);
	// returns false if the price break information is not yet stored
	if ($pricebreak != false) {
		$product_info = $pricebreak;
	} else {		
   $sql="select pd.products_name, p.products_model, p.products_image, p.products_id," .
   " p.manufacturers_id, p.products_price, p.products_weight, p.products_quantity, " .
   " p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8," .
   " p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty," .
   " p.products_qty_blocks," .
   " p.products_tax_class_id," .
   " IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price " .
   " from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " .
   " " . TABLE_PRODUCTS_DESCRIPTION . " pd " .
   " where p.products_status = '1'" .
   " and pd.products_id = p.products_id " .
   " and p.products_id = '" . (int)$product_id . "'" .
   " and pd.language_id = '". (int)$language_id ."'";

   $product_info_query = tep_db_query($sql);
   $product_info = tep_db_fetch_array($product_info_query);
	 $pfs->addPriceBreakData(tep_get_prid($product_id), $product_info);
	}
$this->parse($product_info);

return $product_info;
}
And last, the function tep_get_products_stock (somewhere around line 124 or there about in includes/functions/general.php) is changed to:
// Return a product's stock
// TABLES: products
// adapted to take advantage of $pfs (instance of PriceFormatterStore)
  function tep_get_products_stock($products_id) {
		global $pfs;
		$stock = false;
		if (is_object($pfs)) {
			$stock = $pfs->getStock($products_id); 
		}
		if ($stock !== false) {
			return $stock;
		} else {
	$products_id = tep_get_prid($products_id);
	$stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
	$stock_values = tep_db_fetch_array($stock_query);
	return $stock_values['products_quantity'];
		} // end if/else $stock !== false
  }


#55 ONLINE   Jan Zonjee

Jan Zonjee

    Governor of Peace

  • Core Team
  • 7,086 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 16 December 2006 - 06:11 PM

Correction regarding the language id: (should be global $languages_id)

The corrected class PriceFormatterStore:
<?php
/* $Id: PriceFormatterStore.php v 1.0 2006/12/16
   an object to store the price breaks and products_quantity of a product once queried by the 
	 class PriceFormatter.php to avoid it being queried more than once and tep_get_stock to be executed
	 for each product on the page shopping_cart.php
	 
   osCommerce, Open Source E-Commerce Solutions
   http://www.oscommerce.com

   Copyright (c) 2006 osCommerce

  Released under the GNU General Public License
*/

class PriceFormatterStore {
	var $pricebreaks = array();
	
	function PriceFormatterStore() {
		global $cart, $languages_id;

		if (is_object($cart)) {
			$product_id_list = $cart->get_product_id_list();
			if (tep_not_null($product_id_list)) {
				// get rid of attributes first
				$product_id_list_array = array();
				$product_id_list_temp_array = explode(",", $product_id_list);
				foreach ($product_id_list_temp_array as $key => $value) {
					$product_id_list_array[] = tep_get_prid($value);
				}
				unset($product_id_list);
				$product_id_list = implode(",", $product_id_list_array);
				// now do one query for all products in the shopping basket
   $sql="select pd.products_name, p.products_model, p.products_image, p.products_id," .
   " p.manufacturers_id, p.products_price, p.products_weight, p.products_quantity, " .
   " p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8," .
   " p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty," .
   " p.products_qty_blocks," .
   " p.products_tax_class_id," .
   " IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price " .
   " from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " .
   " " . TABLE_PRODUCTS_DESCRIPTION . " pd " .
   " where p.products_status = '1'" .
   " and pd.products_id = p.products_id " .
   "   and p.products_id in (" . $product_id_list . ")" .
   " and pd.language_id = '". (int)$languages_id ."'";
					$product_info_query = tep_db_query($sql);
						while ($product_info = tep_db_fetch_array($product_info_query)) {
							$this->addPriceBreakData($product_info['products_id'], $product_info);
						}
			} // end if tep_not_null($product_id_list)
		} // end if (is_object($cart)
	}

	function addPriceBreakData ($products_id, $productinfo) {
			$this->pricebreaks[$products_id] = array('products_id' => tep_get_prid($productinfo['products_id']),
				'products_price' => $productinfo['products_price'],
				'products_name' => $productinfo['products_name'],
				'products_model' => $productinfo['products_model'],
				'products_weight' => $productinfo['products_weight'],
				'products_quantity' => $productinfo['products_quantity'],
				'products_tax_class_id' => $productinfo['products_tax_class_id'],
				'products_image' => $productinfo['products_image'],
				'products_qty_blocks' => $productinfo['products_qty_blocks'],
				'specials_new_products_price' => $productinfo['specials_new_products_price'],
				'products_price1_qty' => $productinfo['products_price1_qty'],
				'products_price2_qty' => $productinfo['products_price2_qty'],
				'products_price3_qty' => $productinfo['products_price3_qty'],
				'products_price4_qty'=> $productinfo['products_price4_qty'],
				'products_price5_qty'=> $productinfo['products_price5_qty'],
				'products_price6_qty'=> $productinfo['products_price6_qty'],
				'products_price7_qty' => $productinfo['products_price7_qty'],
				'products_price8_qty' => $productinfo['products_price8_qty'],
				'products_price1' => $productinfo['products_price1'],
				'products_price2' => $productinfo['products_price2'],
				'products_price3'=> $productinfo['products_price3'],
				'products_price4' => $productinfo['products_price4'],
				'products_price5'=> $productinfo['products_price5'],
				'products_price6' => $productinfo['products_price6'],
				'products_price7' => $productinfo['products_price7'],
				'products_price8' => $productinfo['products_price8']);
	}
	
  function getPriceBreak($product_id) {
		$products_id = tep_get_prid($product_id);
		if(isset($this->pricebreaks[$products_id]) && tep_not_null($this->pricebreaks[$products_id])) {
			return $this->pricebreaks[$products_id];
			}	else {
				return false;
		}
	}
	
  function getStock($product_id) {
		$products_id = tep_get_prid($product_id);
		if(isset($this->pricebreaks[$products_id]) && tep_not_null($this->pricebreaks[$products_id])) {
			return $this->pricebreaks[$products_id]['products_quantity'];
			}	else {
				return false;
		}
	}
}
?>


#56   smith..john

smith..john
  • Members
  • 1 posts
  • Real Name:Luke Prendergast

Posted 19 December 2006 - 10:21 AM

View PostGet-Wireless 2, on Sep 3 2006, 10:38 PM, said:

I am currently trying to install this contrib, However I also have MRSP installed. I have managed to edit most of it to still incorporate the MRSPcontrib. I am now having problems with one of the changes in catalog\product_info.php which is
From instructions in Quantity Price Breaks

First, a warning - I know jack about coding, but I logiced it through. I skipped this step and modified the priceformatter.php file to put the MSRP into the table that contains the QPB for SPPC. I've added cells to neaten up the table and used the MSRP style for the table. Note that I also have Show Price List on this install. It's nice and neat and works on all SPPC levels with QPB and specials. I still have to add rows and labels for 'Regular Price' and 'Special Price'.  Here is my priceformatter.php:

<?php
/*
 $Id: PriceFormatter.php,v 1.6 2003/06/25 08:29:26 petri Exp $
 adapted for Separate Pricing Per Customer v4 2005/03/20
 including an optimization to avoid double queries for the same info
 adapted for SPPC v4 to show price list 2006/03/04
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 Copyright (c) 2003 osCommerce
 Released under the GNU General Public License
*/

/*
   PriceFormatter.php - module to support quantity pricing
   Created 2003, Beezle Software based on some code mods by WasaLab Oy (Thanks!)
*/

class PriceFormatter {
 var $hiPrice;
 var $lowPrice;
 var $quantity;
 var $hasQuantityPrice;

 function PriceFormatter($prices=NULL) {
   $this->productsID = -1;

   $this->hasQuantityPrice=false;
   $this->hasSpecialPrice=false;

   $this->hiPrice=-1;
   $this->lowPrice=-1;

   for ($i=1; $i<=8; $i++){
   $this->quantity[$i] = -1;
   $this->prices[$i] = -1;
   }
   $this->thePrice = -1;
   $this->specialPrice = -1;
   $this->qtyBlocks = 1;

// add list price:
   $this->listPrice = '';
   $this->cg_id = '0'; // customer_group_id

   if($prices)
   $this->parse($prices);
 }

// function encode and decode omitted, probably not used anyway;-)

 function parse($prices) {
   $this->productsID = $prices['products_id'];
   $this->hasQuantityPrice=false;
   $this->hasSpecialPrice=false;

   $this->quantity[1]=$prices['products_price1_qty'];
   $this->quantity[2]=$prices['products_price2_qty'];
   $this->quantity[3]=$prices['products_price3_qty'];
   $this->quantity[4]=$prices['products_price4_qty'];
   $this->quantity[5]=$prices['products_price5_qty'];
   $this->quantity[6]=$prices['products_price6_qty'];
   $this->quantity[7]=$prices['products_price7_qty'];
   $this->quantity[8]=$prices['products_price8_qty'];

   $this->thePrice=$prices['products_price'];
   $this->specialPrice=$prices['specials_new_products_price'];
   $this->hasSpecialPrice=tep_not_null($this->specialPrice);

   $this->price[1]=$prices['products_price1'];
   $this->price[2]=$prices['products_price2'];
   $this->price[3]=$prices['products_price3'];
   $this->price[4]=$prices['products_price4'];
   $this->price[5]=$prices['products_price5'];
   $this->price[6]=$prices['products_price6'];
   $this->price[7]=$prices['products_price7'];
   $this->price[8]=$prices['products_price8'];

   $this->msrp=$prices['products_msrp'];

/*
   Change support special prices
   If any price level has a price greater than the special
   price lower it to the special price
*/

if ($this->hasSpecialPrice == true) {
 for($i=1; $i<=8; $i++) {
  if ($this->price[$i] > $this->specialPrice)
   $this->price[$i] = $this->specialPrice;
 }
}
//end changes to support special prices

   $this->qtyBlocks=$prices['products_qty_blocks'];

   $this->taxClass=$prices['products_tax_class_id'];

   if ($this->quantity[1] > 0) {
	 $this->hasQuantityPrice = true;
	 $this->hiPrice = $this->thePrice;
	 $this->lowPrice = $this->thePrice;

	 for($i=1; $i<=8; $i++) {
if($this->quantity[$i] > 0) {
  if ($this->price[$i] > $this->hiPrice) {
	$this->hiPrice = $this->price[$i];
  }
  if ($this->price[$i] < $this->lowPrice) {
	$this->lowPrice = $this->price[$i];
  }
}
	 }
   }

// BOF add customer_group_id/list price
	 global $sppc_customer_group_id;
 if(!tep_session_is_registered('sppc_customer_group_id')) { 
 $this->cg_id = '0';
 } else {
  $this->cg_id = $sppc_customer_group_id;
 }
 $this->listPrice = $prices['list_price'];
// EOF add customer_group_id/list price

 }
 // function loadProductSppc is Separate Pricing Per Customer only
 function loadProductSppc($product_id, $language_id=1, $product_info)
 {

 global $sppc_customer_group_id;
 if(!tep_session_is_registered('sppc_customer_group_id')) { 
 $customer_group_id = '0';
 } else {
  $customer_group_id = $sppc_customer_group_id;
 }

// BOF add List Price (retail price) to the product_info array +msrp
 $product_info['list_price'] = $product_info['products_price'];
 $product_info['msrp'] = $product_info['msrp'];
// EOF add List Price

 if ($customer_group_id != '0') {
	 $customer_group_price_query = tep_db_query("select customers_group_price, products_price1, products_price2, products_price3, products_price4, products_price5, products_price6, products_price7, products_price8, products_price1_qty, products_price2_qty, products_price3_qty, products_price4_qty, products_price5_qty, products_price6_qty, products_price7_qty, products_price8_qty, products_qty_blocks from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$product_id. "' and customers_group_id =  '" . $customer_group_id . "'");

	   if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {
	   $product_info['products_price']= $customer_group_price['customers_group_price'];
for ($i = 1; $i < 9; $i++) {
 $product_info['products_price'.$i.''] = $customer_group_price['products_price'.$i.''];
 $product_info['products_price'.$i.'_qty'] = $customer_group_price['products_price'.$i.'_qty'];
} 
// end if ($customer_group_price = tep_db_fetch_array($customer_group_price_query))
 $product_info['products_qty_blocks'] = $customer_group_price['products_qty_blocks'];
} else { // there is no price for the item in products_groups: retail price breaks need to nulled
 for ($i = 1; $i < 9; $i++) {
 $product_info['products_price'.$i.''] = '0.0000';
 $product_info['products_price'.$i.'_qty'] = '0';
 } 
// end if ($customer_group_price = tep_db_fetch_array($customer_group_price_query))
 $product_info['products_qty_blocks'] = '1';
}
 } 
// end if ($customer_group_id != '0')
// now get the specials price for this customer_group and add it to product_info array
 $special_price_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = " . (int)$product_id . " and status ='1' and customers_group_id = '" . $customer_group_id . "'");
 if ($specials_price = tep_db_fetch_array($special_price_query)) {
  $product_info['specials_new_products_price'] = $specials_price['specials_new_products_price'];
 }

   $this->parse($product_info);
   return $product_info;
 }

   function loadProduct($product_id, $language_id=1)
 {
 global $sppc_customer_group_id;
 if(!tep_session_is_registered('sppc_customer_group_id')) { 
 $customer_group_id = '0';
 } else {
  $customer_group_id = $sppc_customer_group_id;
 }

   $sql = "select pd.products_name, p.products_model, p.products_image, p.products_id," .
	   " p.products_price, p.products_weight," .
	   " p.products_price1,p.products_price2,p.products_price3,p.products_price4, p.products_price5,p.products_price6,p.products_price7,p.products_price8," .
	   " p.products_price1_qty,p.products_price2_qty,p.products_price3_qty,p.products_pri
ce4_qty, p.products_price5_qty,p.products_price6_qty,p.products_price7_qty,p.products_pri
ce8_qty," .
	   " p.products_qty_blocks," .
	   " p.products_tax_class_id," .
	   " NULL as specials_new_products_price" .
	   " from " . TABLE_PRODUCTS_DESCRIPTION . " pd," .
	   "	  " . TABLE_PRODUCTS . " p" .
	   " where p.products_status = '1'" .
	   "   and p.products_id = '" . (int)$product_id . "'" .
	   "   and pd.products_id = '" . (int)$product_id . "'" .
	   "   and pd.language_id = '". (int)$language_id ."'";

   $product_info_query = tep_db_query($sql);
   $product_info = tep_db_fetch_array($product_info_query);

// BOF add List Price (retail price) to the product_info array +msrp
   $product_info['list_price'] = $product_info['products_price'];
   $product_info['msrp'] = $product_info['msrp'];
// EOF add List Price

 if ($customer_group_id != '0') {
	 $customer_group_price_query = tep_db_query("select customers_group_price, products_price1, products_price2, products_price3, products_price4, products_price5, products_price6, products_price7, products_price8, products_price1_qty, products_price2_qty, products_price3_qty, products_price4_qty, products_price5_qty, products_price6_qty, products_price7_qty, products_price8_qty, products_qty_blocks from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$product_id. "' and customers_group_id =  '" . $customer_group_id . "'");

	   if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {
	   $product_info['products_price']= $customer_group_price['customers_group_price'];
for ($i = 1; $i < 9; $i++) {
 $product_info['products_price'.$i.''] = $customer_group_price['products_price'.$i.''];
 $product_info['products_price'.$i.'_qty'] = $customer_group_price['products_price'.$i.'_qty'];
} 
// end if ($customer_group_price = tep_db_fetch_array($customer_group_price_query))

 $product_info['products_qty_blocks'] = $customer_group_price['products_qty_blocks'];
} else { // there is no price for the item in products_groups: retail price breaks need to nulled
 for ($i = 1; $i < 9; $i++) {
 $product_info['products_price'.$i.''] = '0.0000';
 $product_info['products_price'.$i.'_qty'] = '0';
 } 
// end if ($customer_group_price = tep_db_fetch_array($customer_group_price_query))

 $product_info['products_qty_blocks'] = '1';
}
 } 
// end if ($customer_group_id != '0')

// now get the specials price for this customer_group and add it to product_info array
 $special_price_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = " . (int)$product_id . " and status ='1' and customers_group_id = '" . $customer_group_id . "'");
 if ($specials_price = tep_db_fetch_array($special_price_query)) {
  $product_info['specials_new_products_price'] = $specials_price['specials_new_products_price'];
 }

   $this->parse($product_info);
   return $product_info;
 }

 function computePrice($qty)
 {
$qty = $this->adjustQty($qty);

// Compute base price, taking into account the possibility of a special
$price = ($this->hasSpecialPrice === TRUE) ? $this->specialPrice : $this->thePrice;

for ($i=1; $i<=8; $i++)
 if (($this->quantity[$i] > 0) && ($qty >= $this->quantity[$i]))
  $price = $this->price[$i];

return $price;
 }

 function adjustQty($qty) {
// Force QTY_BLOCKS granularity
$qb = $this->getQtyBlocks();
if ($qty < 1)
 $qty = 1;

if ($qb >= 1)
{
 if ($qty < $qb)
  $qty = $qb;

 if (($qty % $qb) != 0)
  $qty += ($qb - ($qty % $qb));
}
return $qty;
 }

 function getQtyBlocks() {
   return $this->qtyBlocks;
 }

 function getPrice() {
   return $this->thePrice;
 }

 function getLowPrice() {
   return $this->lowPrice;
 }

 function getHiPrice() {
   return $this->hiPrice;
 }

 function hasSpecialPrice() {
   return $this->hasSpecialPrice;
 }

 function hasQuantityPrice() {
   return $this->hasQuantityPrice;
 }

 function getPriceString($style='PriceList') {
   global $currencies;

   if ($this->hasSpecialPrice == true) {
	$lc_text = '<table align="top" border="0" cellspacing="0" cellpadding="0">';


/////////////////////////////////// add msrp

 $lc_text .= '<tr><td align="right" class=' . $style. ' colspan="2">' . SHOW_PRICE_MSRP . '</td><td align="right" class=' . $style. ' colspan="2"><s>'
 . $currencies->display_price($this->msrp,
 tep_get_tax_rate($this->taxClass))
 . '</s></td></tr>';

//////////////////////

// BOF add list price NOTE : since only the special price for the customer group
// is queried, the retail special price is not known
 if ($this->cg_id > 0 && $this->listPrice > 0) {
 $lc_text .= '<tr><td align="right" class=' . $style. ' colspan="2">' . SHOW_PRICE_LIST . '</td><td align="right" class=' . $style. ' colspan="2">'
 . $currencies->display_price($this->listPrice,
 tep_get_tax_rate($this->taxClass))
 . '</td></tr>';
 } 
// end if ($this->cg_id > 0) 

	 elseif ($this->cg_id > 0 && $this->listPrice == 0) {
	  $lc_text .= '<tr><td align="right" class=' . $style. ' colspan="2">' . NOT_AVAILABLE_FOR_RETAIL_CUSTOMERS;
	  $lc_text .= '</td></tr>';
   }
	  $lc_text .= '<tr><td align="right" class=' . $style. ' colspan="2">';
	  $lc_text .= ' <s>'

 . $currencies->display_price($this->thePrice,
		tep_get_tax_rate($this->taxClass))
 . '</s> </tr><td align="right" class=' . $style. ' colspan="2">
  <span class="productSpecialPrice">'
 . $currencies->display_price($this->specialPrice,
		tep_get_tax_rate($this->taxClass))
 . '</span>'
 .'</td></tr>';
   }
   else
   {
 $lc_text = '<table align="top" border="0" cellspacing="0" cellpadding="0">';

////////////////////////add msrp

 $lc_text .= '<tr><td align="right" class=' . $style. ' colspan="2">' . SHOW_PRICE_MSRP . '</td><td align="right" class=' . $style. ' colspan="2"><s>'
 . $currencies->display_price($this->msrp,
 tep_get_tax_rate($this->taxClass))
 . '</s></td></tr>';

///////////////////////////////

// BOF add list price
 if ($this->cg_id > 0 && $this->listPrice > 0) {
 $lc_text .= '<tr><td align="right" class=' . $style. ' colspan="2">' . SHOW_PRICE_LIST . '</td><td align="right" class=' . $style. ' colspan="2">'
 . $currencies->display_price($this->listPrice,
 tep_get_tax_rate($this->taxClass))
 . '</td></tr>';
 } 
// end if ($this->cg_id > 0)  

	elseif ($this->cg_id > 0 && $this->listPrice == 0) {
	$lc_text .= '<tr><td align="right" class=' . $style. ' colspan="2">' . NOT_AVAILABLE_FOR_RETAIL_CUSTOMERS;
	$lc_text .= '</td></tr>';
   }
 $lc_text .= '<tr><td align="right" class=' . $style. ' colspan="2">';
 if ($this->cg_id > 0) {
  $lc_text .= SHOW_YOUR_PRICE;
 }
$lc_text .= '</td><td align="right" class=' . $style. ' colspan="2">';
 $lc_text .= $currencies->display_price($this->thePrice,
 tep_get_tax_rate($this->taxClass))
 . '</td></tr>';
// EOF add list price

   }

// If you want to change the format of the price/quantity table
// displayed on the product information page, here is where you do it.

   if($this->hasQuantityPrice == true) {
 for($i=1; $i<=8; $i++) {
  if($this->quantity[$i] > 0) {
   $lc_text .= '<tr><td align="right" class='.$style.'>'
   . $this->quantity[$i]
   .'+ </td><td align="right" class='.$style.'></td><td align="right" class='.$style.'>'
   . $currencies->display_price($this->price[$i],
   tep_get_tax_rate($this->taxClass))
   .'</td></tr>';
  }
 }

 $lc_text .= '</table>';

	 }

	 else {
 if ($this->hasSpecialPrice == true) {
  $lc_text = '';
  if ($this->cg_id > 0 && $this->listPrice > 0) {
  $lc_text .= '<span class="smallText">' . SHOW_PRICE_LIST;
  $lc_text .= $currencies->display_price($this->listPrice,
 tep_get_tax_rate($this->taxClass));
  $lc_text .= '</span><BR>' . REGULAR_PRICE;
  $lc_text .= '</span><BR>' . MSRP;
  } 
// end if ($this->cg_id > 0)

	elseif ($this->cg_id > 0 && $this->listPrice == 0) {
	  $lc_text .= '<span class="smallText">' . NOT_AVAILABLE_FOR_RETAIL_CUSTOMERS;
	  $lc_text .= '</span><br />' . SHOW_YOUR_PRICE;
  }
  $lc_text .= ' <s>'
	. $currencies->display_price($this->thePrice, tep_get_tax_rate($this->taxClass))
	. '<BR></s>  <span class="productSpecialPrice">'. SPECIAL_PRICE
	. $currencies->display_price($this->specialPrice, tep_get_tax_rate($this->taxClass))
	. '</span> ';
 }
 else {
  $lc_text = '';
  if ($this->cg_id > 0 && $this->listPrice > 0) {
  $lc_text .= '<span class="smallText">' . SHOW_PRICE_LIST;
  $lc_text .= $currencies->display_price($this->listPrice,
 tep_get_tax_rate($this->taxClass));
  $lc_text .= '<span class="smallText">' . SHOW_PRICE_MSRP;
  $lc_text .= $currencies->display_price($this->msrp,
 tep_get_tax_rate($this->taxClass));
  $lc_text .= '</span><BR><BR>' . SHOW_YOUR_PRICE;
  } 
// end if ($this->cg_id > 0)

  elseif ($this->cg_id > 0 && $this->listPrice == 0) {
	  $lc_text .= '<span class="smallText">' . NOT_AVAILABLE_FOR_RETAIL_CUSTOMERS;
	  $lc_text .= '</span><br />' . SHOW_YOUR_PRICE;
  }
  $lc_text .= ' '
	. $currencies->display_price($this->thePrice,
		  tep_get_tax_rate($this->taxClass))
	. ' ';
 }
	  }

   return $lc_text;
 }

 function getPriceStringShort() {

   global $currencies;

   if ($this->hasSpecialPrice == true) {
	 $lc_text = ' <s>'
. $currencies->display_price($this->thePrice,
		tep_get_tax_rate($this->taxClass))
. '</s>  <span class="productSpecialPrice">'
. $currencies->display_price($this->specialPrice,
		tep_get_tax_rate($this->taxClass))
. '</span> ';
   }
   else {
	 if($this->hasQuantityPrice == true) {
$lc_text = ' '
  . $currencies->display_price($this->lowPrice,
		  tep_get_tax_rate($this->taxClass))
  . ' - '
  . $currencies->display_price($this->hiPrice,
		  tep_get_tax_rate($this->taxClass))
  . ' ';
	 }
	 else {
$lc_text = ' '
  . $currencies->display_price($this->thePrice,
		  tep_get_tax_rate($this->taxClass))
  . ' ';
	 }
   }
   return $lc_text;
 }
}
?>

Don't ask me for support! I can hardly help myself!

#57   pricelessimprinters

pricelessimprinters
  • Members
  • 17 posts
  • Real Name:Stephen Smith
  • Location:NJ

Posted 27 December 2006 - 04:57 PM

Hello everyone

I am using the

Quote

New bug-fix version: price-break-1.11.2 (correction) Tim Cartwright (Berbee) 10 Nov 2004

version in which everything works fine except on our product info page in which when you try to add a different quanity in the box it only updates quanities by 1. If you do this through the shopping cart everything is fine though and updates to the amount you entered. Please test the QTY box at the bottom of this page to see the error only update 1 item no matter what qty you enter.

http://awardsplaquestrophies.com/awards/pr....php/........28

Could someone help me solve this. I seen another member asked this also before but nobody ever answered that thread also so I never found their solution.

Thanks again

#58 ONLINE   Jan Zonjee

Jan Zonjee

    Governor of Peace

  • Core Team
  • 7,086 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 27 December 2006 - 07:48 PM

View Postpricelessimprinters, on Dec 27 2006, 05:57 PM, said:

I am using the  
version in which everything works fine except on our product info page in which when you try to add a different quanity in the box it only updates quanities by 1.
Check in application_top.php (around line 363) that you changed the code for the action=add_product to:
	  // customer adds a product from the products page, adapted for QPBPP
	  case 'add_product' :	if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
								 $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id'])) + $HTTP_POST_VARS['cart_quantity'], $HTTP_POST_VARS['id']);
							  }
							  tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
							  break;
	  // performed by the 'buy now' button in product listings and review page
Perhaps you have a register_globals problem, so change $HTTP_POST_VARS['cart_quantity'] in that piece of code to $_POST['cart_quantity'] to exclude that.

#59   pricelessimprinters

pricelessimprinters
  • Members
  • 17 posts
  • Real Name:Stephen Smith
  • Location:NJ

Posted 28 December 2006 - 02:06 PM

Thanks for the help - the fix works fine.

#60   granitestater

granitestater
  • Members
  • 42 posts
  • Real Name:scott
  • Location:New Hampshire

Posted 28 December 2006 - 10:07 PM

JanZ - Anything to look out when adding this contribution?

Quantity Price Breaks Per Product v1.2.0a

http://www.oscommerce.com/community/contri...antity+discount

i had problems when i implemented version 1.11.1 that was uploaded on Aug 2003 where the discount brackets weren't even supported...