Jump to content
jpweber

Quantity Price Breaks

Recommended Posts

Hi,

 

I'am upgrading my oscommerce from php4/mysql4 to php5/mysql5. I have updated Register_Globals, Problematic Mysql Querys in Mysql5 and Mysql5 Quantity Price Breaks Correction.

 

All ok in this 3 steps.

 

Now I have a problem with shopping_cart.php:

 

Parse error: parse error, unexpected ';' in /home/lopes_andre/public_html/demos/catalogms2/shopping_cart.php on line 46

 

This error is related with Quantity Price Breaks?

 

What I should do?

 

 

Best Regards, André.

Share this post


Link to post
Share on other sites
Instead of us trying to guess what error that is, why don't you ask your hosting provider for where they log the errors and take it from there?

 

The hosting provider ad me add a prepend.php file to the directory to report the error. Here is what was generated.

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /usr/local/psa/home/vhosts/sportpinsusa.com/httpdocs/prepend.php:1) in /usr/local/psa/home/vhosts/sportpinsusa.com/httpdocs/shop/includes/functions/sessions.php on line 67

 

 

Is this any help?

 

THanks,

Bill

Share this post


Link to post
Share on other sites
The hosting provider ad me add a prepend.php file to the directory to report the error. Here is what was generated.

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /usr/local/psa/home/vhosts/sportpinsusa.com/httpdocs/prepend.php:1) in /usr/local/psa/home/vhosts/sportpinsusa.com/httpdocs/shop/includes/functions/sessions.php on line 67

 

 

Is this any help?

 

THanks,

Bill

 

I tried to edit the previous post but wasn't able to. It turns out the error is generated be navigating back to the cart by using the browser back button. Not from actually having the checkout_shipping.php file called. No error is generated on that page. Help!?!

 

Bill

Share this post


Link to post
Share on other sites
I tried to edit the previous post but wasn't able to. It turns out the error is generated be navigating back to the cart by using the browser back button. Not from actually having the checkout_shipping.php file called. No error is generated on that page. Help!?!

 

Bill

Hate to be a bother, but here goes. I finally got that error fixed - just a few lines of code were off in the shopping cart and that made all of the difference. Now on to the next problem. The price is not being updated to the lower price as the quantities are increased and the images in the shopping cart are broken. Thanks in advance.

 

Bill

Share this post


Link to post
Share on other sites

Hi

 

I seem to be having the same problem with the shopping cart! The quantity price breaks work but in the shopping cart it just shows it at the full price.

 

Any ideas anyone?

 

pete

Share this post


Link to post
Share on other sites

I have spent a day trying to get QPBBB 1.3.0 to work with moderate success (some problems with shopping_cart.php leaves the shop with an error of

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/ecdo9968/public_html/includes/classes/shopping_cart.php:396) in /home/ecdo9968/public_html/includes/functions/sessions.php on line 102

 

Parse error: syntax error, unexpected $end in /home/ecdo9968/public_html/includes/languages/english/product_info.php on line 29

 

but that is probably operator error). Should I have started with 1.0 and worked up or can I just jump straight into 1.3.0 from a straight 2.2 install?

 

However, I am now wondering if I am installing the right thing!

 

Will this contribution allow customers to buy 4+ of something and get 5% discount or 10+ of something and get 10% discount?

I can't find the admin page that is shown in install.html#howtouse with all the price levels, so not really sure how it all works!

 

This is my second go at install a contribution - was it too ambitious???

Edited by Jan Zonjee

ECD Online: all the valves you could ever want!

Share this post


Link to post
Share on other sites
I have spent a day trying to get QPBBB 1.3.0 to work with moderate success (some problems with shopping_cart.php leaves the shop with an error of

 

[snip]

Should I have started with 1.0 and worked up or can I just jump straight into 1.3.0 from a straight 2.2 install?

 

However, I am now wondering if I am installing the right thing!

 

Will this contribution allow customers to buy 4+ of something and get 5% discount or 10+ of something and get 10% discount?

I can't find the admin page that is shown in install.html#howtouse with all the price levels, so not really sure how it all works!

 

This is my second go at install a contribution - was it too ambitious???

 

I have been back and reloaded all my original files so at least the site is working again. But one of the problems I had locating the right bits of code to change is the shopping_cart.php. The version I had didn't have product_sting_id as a variable in it. Was that because I was starting from QPB 1.3.0 and that bit of code hadn't already changed?

 

Is there anyone who will, for a fee, install these contributions for people like me who are a bit inexperienced??!!

Edited by Jan Zonjee

ECD Online: all the valves you could ever want!

Share this post


Link to post
Share on other sites

I have successfully installed QPBPP (as far as I know!) and so far so good (it's just what we needed), but wanted to see if it was possible to add just a few more customizations and am wondering if anyone knows how to do this.

 

I would like the quantity box to be a drop down of only 4 amounts, 50, 100, 200, and 300. I am working in catalog/product_info.php and see how I can turn the code from input_field to tep_draw_pull_down_menu, but after that I am not sure how to code it to read the 4 amounts I would like. It seems like it should be a simple fix that I just can't figure out.

 

I would also like to be able to completely get rid of the table with the %'s and +'s, the contribution provides and replace it with a simple table that reads what price the item is at the different amounts. For example, I want to sell 50 cards for $30.00, and 100 cards for $50.00, and I want to just list this rather than have the table telling the customer what the savings are and what each individual card is. I am fine with having to create that new table or inserting an image of that table, as long as I can safely hide the previously given table. is this possible?

 

Does any of this make sense? If you could offer any help to this, I would greatly appreciate it. I have looked to see if anyone else has had this problem, but have not had any luck, please send me that direction if you know of a topic already started about this.

 

I appreciate any help. Thanks in advance!!

 

BBailey

Share this post


Link to post
Share on other sites

I have just installed Quantity Price Breaks V1.3.1

and from the install manual there you will find in catalogue/admin/categories:

 

Open: \catalog\admin\categories.php

 

1. After (around line 15):

 

require(DIR_WS_CLASSES . 'currencies.php');

Add:

// BOF qpbpp

// include the price formatter for the price breaks contribution

require(DIR_WS_CLASSES . 'PriceFormatter.php');

$pf = new PriceFormatter;

// EOF qpbpp

 

2. After (around line 150):

for ($i=0, $n=sizeof($product_categories); $i

// BOF qpbpp

tep_db_query("delete from " . TABLE_PRODUCTS_PRICE_BREAK . " where products_id = '" . (int)$product_id . "'");

// EOF qpbpp

 

3. After (around line 220):

'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),

 

Add:

 

// BOF qpbpp

'products_qty_blocks' => (($i=tep_db_prepare_input($HTTP_POST_VARS['products_qty_blocks'])) < 1) ? 1 : $i,

// EOF qpbpp

 

step 1 and step 3 are ok but I am confused with step 2, I don't know what line 150 is, and can anybody direct me to this line? as i have already installed many other contributions.

Should i add

for ($i=0, $n=sizeof($product_categories); $i

// BOF qpbpp

tep_db_query("delete from " . TABLE_PRODUCTS_PRICE_BREAK . " where products_id = '" . (int)$product_id . "'");

// EOF qpbpp

after line 150 or what it is ? Please help, thanks!

 

When I am trying to fill one product, it shows:

 

Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in

 

/xxx/catalogue/admin/categories.php on line 785

 

i know there must be something wrong with these several lines:

 

for ($i=0, $n=sizeof($product_categories); $i<$n; $i++) {

// BOF qpbpp

tep_db_query("delete from " . TABLE_PRODUCTS_PRICE_BREAK . " where products_id = '" . (int)$product_id . "'");

// EOF qpbpp

 

your help would be highly appreciated!

 

Thomas

Share this post


Link to post
Share on other sites

My guess is you will have to find:

 

for ($i=0, $n=sizeof($product_categories); $i<$n; $i++) {
tep_db_query("delete from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$product_id . "' and categories_id = '" . (int)$product_categories[$i] . "'");
}

 

and then add

 

// BOF qpbpp
tep_db_query("delete from " . TABLE_PRODUCTS_PRICE_BREAK . " where products_id = '" . (int)$product_id . "'");
// EOF qpbpp

 

However, I too get the same error. It only happens when I want to add a new product. When you click on "PREVIEW" and then on "BACK", there is no more error though.

 

Does anyone has any thoughts on this?

 

Thanks.

Share this post


Link to post
Share on other sites

ya, you are right, i have the same problem:

''It only happens when I want to add a new product. When you click on "PREVIEW" and then on "BACK", there is no more error though''

 

hope someone can help us.

 

Waiting... & Thanks...

 

Thomas

Share this post


Link to post
Share on other sites

To get rid of the error, REPLACE

<?php
if(array_key_exists($count, $price_breaks_array)) {
  echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price' . $count, $price_breaks_array[$count]['products_price'], 'size="10"');
  echo tep_draw_separator('pixel_trans.gif', '24', '15') . TEXT_PRODUCTS_QTY;
  echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_input_field('products_qty' . $count, $price_breaks_array[$count]['products_qty'], 'size="10"');
  echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_checkbox_field('products_delete' . $count, 'y', false) . TEXT_PRODUCTS_DELETE;
} else {
  echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price' . $count, '', 'size="10"');
  echo tep_draw_separator('pixel_trans.gif', '24', '15') . TEXT_PRODUCTS_QTY;
  echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_input_field('products_qty' . $count, '', 'size="10"');
}
?>

 

WITH

 

<?php
if(isset($count)) {
  echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price' . $count, $price_breaks_array[$count]['products_price'], 'size="10"');
  echo tep_draw_separator('pixel_trans.gif', '24', '15') . TEXT_PRODUCTS_QTY;
  echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_input_field('products_qty' . $count, $price_breaks_array[$count]['products_qty'], 'size="10"');
  echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_checkbox_field('products_delete' . $count, 'y', false) . TEXT_PRODUCTS_DELETE;
} else {
  echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_price' . $count, '', 'size="10"');
  echo tep_draw_separator('pixel_trans.gif', '24', '15') . TEXT_PRODUCTS_QTY;
  echo tep_draw_separator('pixel_trans.gif', '24', '15') . tep_draw_input_field('products_qty' . $count, '', 'size="10"');
}
?>

 

Cheers.

Edited by JohnSanders

Share this post


Link to post
Share on other sites

Hello

 

i installed "Quantity Price Breaks Per Product v1.3.1". Really good :)

 

But i would like to know why create "discount categories" ? what is the use of discount categories ?

 

Thanks

Share this post


Link to post
Share on other sites

I got the Quantity Price Breaks to work pretty well and it is an amazing contribution! There are two things I would like to do though that I can not seem to figure out.

 

Instead of a input_field for the quantity field, I would like it to be a pull down box that only gives 4 options, because we sell packages in only 4 options. Does anyone know how to do this? Any help would be appreciated, I have googled and searched in this forum for any help but have not seen anyone with this problem, but I have seen oscommerce example stores using it.

 

The other problem is that, 4 only have 4 available packaging options, 50, 100, 200 and 300, and when someone purchases one set of one of those, for example 50 notecards of no.1, everything works fine, the math adds correctly, and the product gets added to the cart at the right price and everything is fine (27.00), but if the customer goes back and adds another set of 50 notecards no.2 when they go to the cart, now the total price is the amount for a discount of 100 (39.00) not a total amount for 2 sets of 50 (27 + 27).

 

This will present a huge problem if customers want to order more than one. Does anyone know how to make the total price not add the amounts together and give them a discount as well?

 

Any help is really appreciated, I am pretty new to this so the contributions have been helping tremendously.

Share this post


Link to post
Share on other sites

Dears,

I have install QPBPP_v1_3_1 and import database,

but when go to product_info, have wrong as below:

 

1146 - Table 'cakesaround.TABLE_PRODUCTS_PRICE_BREAK' doesn't exist

 

select products_price, products_qty from TABLE_PRODUCTS_PRICE_BREAK where products_id = '255' order by products_qty

 

From phpmy Admin, I can see table--products_price_break and have id=255 record in it.

 

Would you please give some advice asap?

 

Thanks & Best Regards,

Share this post


Link to post
Share on other sites
1146 - Table 'cakesaround.TABLE_PRODUCTS_PRICE_BREAK' doesn't exist

You didn't add the define for TABLE_PRODUCTS_PRICE_BREAK to the file includes/database_tables.php (needed both on the catalog side and the admin side).

Share this post


Link to post
Share on other sites
You didn't add the define for TABLE_PRODUCTS_PRICE_BREAK to the file includes/database_tables.php (needed both on the catalog side and the admin side).

 

very thanks for you reply!!

 

BTW, when I run /admin/discount_categories.php have this error:

Discount categories

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20, 20' at line 1

 

select dc.discount_categories_id, dc.discount_categories_name from discount_categories dc order by dc.discount_categories_name ASC limit -20, 20

 

[TEP STOP]

my PHP is 4.40 and mysql is 5.0

 

Would you please help to give some advice?

 

Thanks & best Regards,

Edited by Jan Zonjee

Share this post


Link to post
Share on other sites
BTW, when I run /admin/discount_categories.php have this error:

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-20, 20' at line 1

 

select dc.discount_categories_id, dc.discount_categories_name from discount_categories dc order by dc.discount_categories_name ASC limit -20, 20

 

[TEP STOP]

my PHP is 4.40 and mysql is 5.0

 

Would you please help to give some advice asap?

Download osC2.2. RC2a and start upgrading from your out of date installation. Start with the update-200608717.txt, then upgrade-22rc1.html (both in the directory extras) and then update to RC2a. That will keep you busy for a while :)

Share this post


Link to post
Share on other sites
Download osC2.2. RC2a and start upgrading from your out of date installation. Start with the update-200608717.txt, then upgrade-22rc1.html (both in the directory extras) and then update to RC2a. That will keep you busy for a while :)

 

Very thanks for Jan Zonjee quickly reply!!!

Can you advise which Quantity Price Breaks Per Product is suitable for osc2.2?

from server_info.php , my current osc is osCommerce 2.2-MS2

 

Thanks again Jan.

 

Best Regards,

Edited by sunrise99

Share this post


Link to post
Share on other sites
Can you advise which Quantity Price Breaks Per Product is suitable for osc2.2?

from server_info.php , my current osc is osCommerce 2.2-MS2

Either use 1.2.9 or 1.3.1 (both are very different but work). osC 2.2 MS2 is not suitable for MySQL5. You need to upgrade your osC to get at least rid of the MySQL5 errors you are going to experience. No way around that.

Share this post


Link to post
Share on other sites
Either use 1.2.9 or 1.3.1 (both are very different but work). osC 2.2 MS2 is not suitable for MySQL5. You need to upgrade your osC to get at least rid of the MySQL5 errors you are going to experience. No way around that.

 

Hi Jan:

Thanks for your powerful support.

 

From your 1.3.3 install.html Q&A :

Q3. I notice that if a product has attributes no price break is given when the same product with different attributes is added to the cart. How can I change that?

A3. You can add the discount category modificaton of QPBPP to the shop. Whether you use any discount categories or not, products with attributes will be counted together on the basis of the "base" products_id.

 

I want to know whether it is necessary to add A3 if a product has attributes no price break is given .

I also want to know which file is relative to price break , is it class/shop_cart.php?

because I install fresh osc and copy all qpbpp, when I test it, no price break, I have setup from admin and import mysql.

 

Thanks & Best Regards,

Share this post


Link to post
Share on other sites

HI,

I installed Quantity Price Breaks contribution. When I put say a quantity of 8 in the shopping cart, it would not calculate the discount. The discount table shows up correctly on the product info page. After seeing that the discount was not being applied, I replaced my original shop files with the contribution files. I am still not getting the changed calculation. Here are the files I replaced:

\catalog\advanced_search_result.php

\catalog\index.php

\catalog\product_info.php

\catalog\includes\application_top.php

\catalog\includes\classes\shopping_cart.php

\catalog\includes\modules\product_listing.php

 

Thanks so much for any help!

Share this post


Link to post
Share on other sites
I want to know whether it is necessary to add A3 if a product has attributes no price break is given .

No. However, with version 1.3.1 the discount category code is already built in. With 1.2.x it was optional (not that it should hurt, only unless you do not want to have products with attributes seen as a single product for the price break).

I also want to know which file is relative to price break , is it class/shop_cart.php?

because I install fresh osc and copy all qpbpp, when I test it, no price break, I have setup from admin and import mysql.

I don't understand your question about what is relative but I notice you and others have problems. The 1.3 versions are quite new and not changed by me (haven't even installed it yet to see the details) so I don't know if it is a problem with not installing correctly or with the contribution itself. I noticed a piece of text mangled in the install instruction for admin/categories.php but that had to do with deleting products.

Edited by Jan Zonjee

Share this post


Link to post
Share on other sites

my issue is:

 

I installed Quantity Price Breaks contribution on one fresh osc2.2 RC1 and RC2a. When I put say a quantity of 8 in the shopping cart, it would not calculate the discount. The discount table shows up correctly on the product info page. After seeing that the discount was not being applied.

 

example:

Quantity 1+ 5+ 20+

Price for each $10.00 $9.00 $8.00

Your savings - 10% 20%

 

when buy 10 pcs, it still 10.00USD per pcs. total 100$.

Edited by sunrise99

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×