Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Quantity price breaks show % saving


HairyJim

Recommended Posts

Hi

 

I unstalled quantity price breaks contributions but When i add something to the shopping cart i get this error on the screen. I cant figure it out.

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\jokeaholic.co.uk\wwwroot\includes\functions\database.php on line 103

 

 

Has anyone got a clue?

 

Thanks

Link to comment
Share on other sites

Hi

 

I unstalled quantity price breaks contributions but When i add something to the shopping cart i get this error on the screen. I cant figure it out.

 

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in D:\jokeaholic.co.uk\wwwroot\includes\functions\database.php on line 103

Has anyone got a clue?

 

Thanks

 

 

It sounds like there is an invalid SQL statement somewhere.

 

Go backwards through the install instructions and make sure you removed and replaced back the correct bits of code.

Link to comment
Share on other sites

  • 1 month later...

Hi HairyJim,

 

I was wondering if you can help me with one thing. I been trying do it myself but I cannot get it done. I want the tables to do the following:

 

QTY                1+          10+          20+          30+
Price each         $4.00       $3.00        $2.00        $1.00
Saving (%)                     10%          $20%         30%

 

Instead of:

 

$4.00
QTY                  10+          20+          30+
Price each           $3.00        $2.00        $1.00
Saving (%)           10%          20%          30%

 

Thanks in Advance,

StrictlyPC

Link to comment
Share on other sites

Did you define the price of 1 on the item?

 

To be able to display the cost of 1 unit you must define that cost on the item.

 

Jim

 

 

Hi HairyJim,

 

I was wondering if you can help me with one thing.  I been trying do it myself but I cannot get it done.  I want the tables to do the following:

 

QTY                1+          10+          20+          30+
Price each         $4.00       $3.00        $2.00        $1.00
Saving (%)                     10%          $20%         30%

 

Instead of:

 

$4.00
QTY                  10+          20+          30+
Price each           $3.00        $2.00        $1.00
Saving (%)           10%          20%          30%

 

Thanks in Advance,

StrictlyPC

Link to comment
Share on other sites

Did you define the price of 1 on the item?

 

To be able to display the cost of 1 unit you must define that cost on the item.

 

So on one of my items I have defined the following qty breaks:

 

Price break level 1: ?1499.00

Qty: 1

 

Price break level 2: 1200.00

Qty: 2

 

Price break level 3: 1100.00

Qty: 3

 

Price break level 4: 1050.00

Qty: 4

 

This gives me the following output on my item page:

 

QTY                1+          2+          3+          4+
Price each         $1,500       $1,200        $1,100        $1,050
Saving (%)              0       20%          $27%         30%

 

Jim

Edited by HairyJim
Link to comment
Share on other sites

  • 2 months later...
Hi HairyJim,

 

Thanks for your response. Normally, I would just enter the regular price and then enter the price breaks. But I see where you are getting at and I will use that method.

 

Thanks for your help,

StrictlyPC

Hello,

 

I've installed a "Quantity Price Breaks Per Product Price Table Formatter" contrib. What a great change to an original contrib. Few questions, though.

1. I think this one was already asked previously but didn't receive any answer: how do I move the table to the bottom of the page and keep the original "Single Price" at the top of the page as original?

2. The % is not calculated correctly. My original price for qty of 1 is $149.50, for qty of 5+ the price is $127.50, which is 15%. In my Qty table for 5+ I have 0%.

3. How can I have my table to show qty in ranges, like 5-9, 10-24, 25+? Right now I have: 5+, 10+, 25+.

 

Thanks for your help,

Irina.

Link to comment
Share on other sites

Hi Irina,

 

This is not my contribution but I do know a little about it. Unfortunatly right now I am going to go home for the weekend.

 

I will certainly take a look and try and guide you on Monday morning.

 

Jim

 

Hello,

 

I've installed a "Quantity Price Breaks Per Product Price Table Formatter" contrib. What a great change to an original contrib. Few questions, though.

1. I think this one was already asked previously but didn't receive any answer: how do I move the table to the bottom of the page and keep the original "Single Price" at the top of the page as original?

2. The % is not calculated correctly. My original price for qty of 1 is $149.50, for qty of 5+ the price is $127.50, which is 15%. In my Qty table for 5+ I have 0%.

3. How can I have my table to show qty in ranges, like 5-9, 10-24, 25+? Right now I have: 5+, 10+, 25+.

 

Thanks for your help,

Irina.

Link to comment
Share on other sites

Hi Irina,

 

This is not my contribution but I do know a little about it. Unfortunatly right now I am going to go home for the weekend.

 

I will certainly take a look and try and guide you on Monday morning.

 

Jim

Thanks. I'll wait for you to come back. :thumbsup:

 

Have a great trip!

Regards.

Link to comment
Share on other sites

I'm trying to figure out how to have the quantity price break work with the quantity of the shopping cart not the quantity of the product. Does anyone know if this has been done? and how?

 

Also I want to remove the little chart - I created my own in html adding other info so it is in my product description already - where is the code to comment out?

 

Thanks

Link to comment
Share on other sites

1. I think this one was already asked previously but didn't receive any answer: how do I move the table to the bottom of the page and keep the original "Single Price" at the top of the page as original?

 

To show the products single price find this code: <?php echo $products_price; ?> and replace with this: <?php echo $currencies->format($product_info['products_price']); ?>

 

Now put this code wherever you wish to see the product saving table: <?php echo $products_price; ?>

 

2. The % is not calculated correctly. My original price for qty of 1 is $149.50, for qty of 5+ the price is $127.50, which is 15%. In my Qty table for 5+ I have 0%.

 

Are the 2+, 3+ and 4+ %'s correct? Did you define a price break for 5+ on the product screen in the admin section?

 

3. How can I have my table to show qty in ranges, like 5-9, 10-24, 25+? Right now I have: 5+, 10+, 25+.

 

Sorry I am not sure that is possible with the way in which the contribution was made.

 

 

I'm trying to figure out how to have the quantity price break work with the quantity of the shopping cart not the quantity of the product. Does anyone know if this has been done? and how?

 

Also I want to remove the little chart - I created my own in html adding other info so it is in my product description already - where is the code to comment out?

 

Thanks

 

 

Find this piece of code in product_info.php and comment it out: <?php echo $products_price; ?>

Edited by HairyJim
Link to comment
Share on other sites

To show the products single price find this code: <?php echo $products_price; ?> and replace with this: <?php echo $currencies->format($product_info['products_price']); ?>

 

Now put this code wherever you wish to see the product saving table: <?php echo $products_price; ?>

Are the 2+, 3+ and 4+ %'s correct? Did you define a price break for 5+ on the product screen in the admin section?

Sorry I am not sure that is possible with the way in which the contribution was made.

Find this piece of code in product_info.php and comment it out: <?php echo $products_price; ?>

Thanks for your reply, James. I got a product's single price now and relocated my Qty table to the bottom of the page.

Now, about the % calculations. I finally got it working properly. The important point in these % calculations is always start your price break with Qty of 1. Mine was from 5. Some questions, though. I was trying to center my table with no luck. The code I have is: <td><br><align="center"><?php echo $products_price; ?></td>. Is this correct and why it doesn't move to the center?

I'm trying to display the quantity-price table in the admin's product preview according to the "Quantity_Price_Breaks_Per_Product_Also_In_Preview" add-on. I followed all the instructions on that add-on and placed PriceFormatter.php into admin/includes/classes. But, when I go to admin's product preview, I get the following error message:

Fatal error: Call to undefined function: tep_get_products_special_price() in ............\osCommerce\admin\includes\classes\PriceFormatter.php on line 117
How can I fix this error?

 

Thanks a lot for your help.

Irina.

Link to comment
Share on other sites

Thanks for your reply, James. I got a product's single price now and relocated my Qty table to the bottom of the page.

Now, about the % calculations. I finally got it working properly. The important point in these % calculations is always start your price break with Qty of 1. Mine was from 5. Some questions, though. I was trying to center my table with no luck. The code I have is: <td><br><align="center"><?php echo $products_price; ?></td>. Is this correct and why it doesn't move to the center?

 

Inside the folder Includes>Classes there is a file called PriceFormatter.php

 

find this code: <table border="0" cellspacing="0" cellpadding="0" class="infoBox" align="left">

 

Change the align property there to align="center"

 

Regarding the other error. tep_get_products_special_price() is a function call, it looked for the function within priceformatter, the function does not exist there it exists in includes>functions>general.php

 

I am not sure what this contrib is, have you got a link to it and I could take a look.

Link to comment
Share on other sites

Inside the folder Includes>Classes there is a file called PriceFormatter.php

 

find this code: <table border="0" cellspacing="0" cellpadding="0" class="infoBox" align="left">

 

Change the align property there to align="center"

 

Regarding the other error. tep_get_products_special_price() is a function call, it looked for the function within priceformatter, the function does not exist there it exists in includes>functions>general.php

 

I am not sure what this contrib is, have you got a link to it and I could take a look.

Thanks for that piece of code, this is exactly what I needed. Now, this "Quantity_Price_Breaks_Per_Product_Also_In_Preview" is not actually a contribution but an add-on to "Quantity Price Break" and it is located in http://www.oscommerce.com/community/contributions,1242, "Also in the admin's product preview" by Com2. I'll appreciate if you'll help me to fix this. Thank you very much for your time and efforts on this!

 

Irina.

Link to comment
Share on other sites

Did you define the price of 1 on the item?

 

To be able to display the cost of 1 unit you must define that cost on the item.

 

So on one of my items I have defined the following qty breaks:

 

Price break level 1: ?1499.00

Qty: 1

 

Price break level 2: 1200.00

Qty: 2

 

Price break level 3: 1100.00

Qty: 3

 

Price break level 4: 1050.00

Qty: 4

 

This gives me the following output on my item page:

 

QTY				1+		  2+		  3+		  4+
Price each		 $1,500	   $1,200		$1,100		$1,050
Saving (%)			  0	   20%		  $27%		 30%

 

Jim

Is it possible to only enter the price break amounts and still show the percentage savings based upon the original/sale price?

 

Example:

Regular Price $ 10.00

 

Buy 2+ for $9.00 each Save 10%

Buy 3+ for $8.00 each Save 20%

Buy 4+ for $7.00 each Save 30%

 

Thank you very much in advance. Great job!

Link to comment
Share on other sites

Thanks for that piece of code, this is exactly what I needed. Now, this "Quantity_Price_Breaks_Per_Product_Also_In_Preview" is not actually a contribution but an add-on to "Quantity Price Break" and it is located in http://www.oscommerce.com/community/contributions,1242, "Also in the admin's product preview" by Com2. I'll appreciate if you'll help me to fix this. Thank you very much for your time and efforts on this!

 

Irina.

Hi HairyJim. Did you have a chance to look at the "Also in the admin's product preview" contrib by Com2. Any suggestions for me on how can I fix my error in admin's product preview?

 

Thanks,

Irina.

Link to comment
Share on other sites

  • 2 weeks later...

Sorry to butt in on this but Im trying to discount quantities of something that only costs 10c including Tax.

 

I want to charge 5% discount for 1000, 7.5% for 2000 etc but it works out to 4 decimal places and only the first 2 decimal places are calculated.

 

Is there a workaround for this????

 

rgds

 

Mick

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...