Jump to content



Latest News: (loading..)

* - - - - 3 votes

Quantity Price Breaks


  • Please log in to reply
873 replies to this topic

#1   jpweber

jpweber
  • Members
  • 1,259 posts
  • Real Name:Jason Weber
  • Gender:Male
  • Location:Detroit, Michigan

Posted 01 August 2006 - 12:35 PM

Anyone know of a version of the Quantity Price Breaks that actually works?  http://www.oscommerce.com/community/contributions,1242/

I've just been having a hard time with this, and e-mailing people on here, I don't know anyone who's gotten a version to work yet.  Any advice would be greatly appreciated!

J
Jason

Simple 1-2-3 Intructions on how to get, install and configure SSL

The Google Sandbox explained

Simple to follow instructions on how to change the look of your OSC

How To Make A Horrible OSC Website

my toolbox: PHP Designer 2007 - Winmerge - phpMyAdmin - WS_FTP - Photoshop - Paint Shop Pro - Crimson Editor

my installed contributions:  Category Banners, File Upload feature-.77, Header Tags, Sort_Product_Attributes_1, XSellv2.3, Price Break 1.11.2, wishlist 3.5, rollover_category_images_v1.2, Short_Description_v2.1, UPSXML_v1_2_3, quickbooks qbi_v2_10, allprods v4.4, Mouseover-effect for image-buttons 1.0, Ultimate_SEO, AAP 1.41, Auto Select State Value, Fast Easy Checkout,  Dynamic SiteMap v2.0, Image Magic, Links Manager 1.14, Featured Products, Customer Testimonials, Article Manager, FAQ System, and I'm sure more ...

#2   Jan Zonjee

Jan Zonjee

    Governor of Peace

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

Posted 01 August 2006 - 08:24 PM

View Postjpweber, on Aug 1 2006, 02:35 PM, said:

Anyone know of a version of the Quantity Price Breaks that actually works?
Never used another version than the New bug-fix version: price-break-1.11.2 (correction) Tim Cartwright (Berbee) 10 Nov 2004 one. It contains the manual changes that you need, especially in product_info.php and includes/application_top.php. But I would be surprised if that was the last one working properly  :)

#3   jpweber

jpweber
  • Members
  • 1,259 posts
  • Real Name:Jason Weber
  • Gender:Male
  • Location:Detroit, Michigan

Posted 01 August 2006 - 09:45 PM

hi Jan.  I downloaded what you told me to, and installed it, and .... no errors!  Well, not yet.  The admin side of things look good.  I go to the one page where I instituted a price break, and, well, right now, I have it set up so the price of the mount is $199, but if you buy 3 of 'em, it goes down to $169.  

Price=$199
So  ... quantity blocks: 1
price break level 1:  $169    Qty:  3


When I go to that product's page, however, http://www.thevisiondepot.com/catalog/prod...54c0b10447642d4 .... well, I don't see a price quantity break.  Maybe I have to type it in there manually?

Also, I can't add more than 2 things to my cart right nwo.  If I try to add 3 things, well, it won't accept.  Ugh!  Well, thank you for pointing me in the right direction.  I think I'll get there.  I'll just google search and search the forums here.  But if you have any suggestions, I'd be more than willing to listen.  Thanks a lot Jan,

Jason
Jason

Simple 1-2-3 Intructions on how to get, install and configure SSL

The Google Sandbox explained

Simple to follow instructions on how to change the look of your OSC

How To Make A Horrible OSC Website

my toolbox: PHP Designer 2007 - Winmerge - phpMyAdmin - WS_FTP - Photoshop - Paint Shop Pro - Crimson Editor

my installed contributions:  Category Banners, File Upload feature-.77, Header Tags, Sort_Product_Attributes_1, XSellv2.3, Price Break 1.11.2, wishlist 3.5, rollover_category_images_v1.2, Short_Description_v2.1, UPSXML_v1_2_3, quickbooks qbi_v2_10, allprods v4.4, Mouseover-effect for image-buttons 1.0, Ultimate_SEO, AAP 1.41, Auto Select State Value, Fast Easy Checkout,  Dynamic SiteMap v2.0, Image Magic, Links Manager 1.14, Featured Products, Customer Testimonials, Article Manager, FAQ System, and I'm sure more ...

#4   Jan Zonjee

Jan Zonjee

    Governor of Peace

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

Posted 01 August 2006 - 10:00 PM

View Postjpweber, on Aug 1 2006, 11:45 PM, said:

I downloaded what you told me to, and installed it, and .... no errors!  Well, not yet.  The admin side of things look good.  I go to the one page where I instituted a price break, and, well, right now, I have it set up so the price of the mount is $199, but if you buy 3 of 'em, it goes down to $169.  

Price=$199
So  ... quantity blocks: 1
price break level 1:  $169    Qty:  3
When I go to that product's page, however, http://www.thevisiondepot.com/catalog/prod...54c0b10447642d4 .... well, I don't see a price quantity break.  Maybe I have to type it in there manually?
I don't see the code that adding QPBPP to e.g. product_info.php should give (instructions in that package are in separate files for each page!). For example it says:
 <td class="main" align="right"><input type="hidden" name="products_id" value="30"><input type="image" src="includes/languages/english/images/buttons/button_in_cart.gif" border="0" alt="Add to Cart" title=" Add to Cart "></td>
However I would expect to something like this:
<td class="main" align="right">
				  <table border="0" align="right">
					<tr><td align="center">
					  Quantity:<input type="text" name="cart_quantity" value="1" size="6">					</td></tr>
					<tr><td align="center">
					  <input type="hidden" name="products_id" value="5"><input type="image" src="includes/languages/english/images/buttons/button_in_cart.gif" border="0" alt="Add to Cart" title=" Add to Cart ">					</td></tr>
The field "cart_quantity" is used in application_top.php when adding a product to the cart. If you don't want an input field, at least make it a hidden filed with a value of 1.

Quote

Also, I can't add more than 2 things to my cart right nwo.  If I try to add 3 things, well, it won't accept.
Weird. However, when adding three or more of those products to the shopping cart I don't see the price going down either.

#5   jpweber

jpweber
  • Members
  • 1,259 posts
  • Real Name:Jason Weber
  • Gender:Male
  • Location:Detroit, Michigan

Posted 01 August 2006 - 10:16 PM

Hah!  Think I got it, Jan.  If you're still around, does that look better?  Is that how it's supposed to look?

http://www.thevisiondepot.com/catalog/prod...54c0b10447642d4

Thank you so much for bearing with me, Jan.  I hope this finally did it!

Jason
Jason

Simple 1-2-3 Intructions on how to get, install and configure SSL

The Google Sandbox explained

Simple to follow instructions on how to change the look of your OSC

How To Make A Horrible OSC Website

my toolbox: PHP Designer 2007 - Winmerge - phpMyAdmin - WS_FTP - Photoshop - Paint Shop Pro - Crimson Editor

my installed contributions:  Category Banners, File Upload feature-.77, Header Tags, Sort_Product_Attributes_1, XSellv2.3, Price Break 1.11.2, wishlist 3.5, rollover_category_images_v1.2, Short_Description_v2.1, UPSXML_v1_2_3, quickbooks qbi_v2_10, allprods v4.4, Mouseover-effect for image-buttons 1.0, Ultimate_SEO, AAP 1.41, Auto Select State Value, Fast Easy Checkout,  Dynamic SiteMap v2.0, Image Magic, Links Manager 1.14, Featured Products, Customer Testimonials, Article Manager, FAQ System, and I'm sure more ...

#6   Jan Zonjee

Jan Zonjee

    Governor of Peace

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

Posted 02 August 2006 - 07:10 AM

View Postjpweber, on Aug 2 2006, 12:16 AM, said:

Is that how it's supposed to look?
Yes (not very pretty that table, but that is the standard look). Adding three items to the cart lowers the price now also.

#7   jpweber

jpweber
  • Members
  • 1,259 posts
  • Real Name:Jason Weber
  • Gender:Male
  • Location:Detroit, Michigan

Posted 02 August 2006 - 02:14 PM

Great.  Thank you Jan.   I'll eventually go in there and change the look, but I'm just glad it works for now.  Have a great day,

J
Jason

Simple 1-2-3 Intructions on how to get, install and configure SSL

The Google Sandbox explained

Simple to follow instructions on how to change the look of your OSC

How To Make A Horrible OSC Website

my toolbox: PHP Designer 2007 - Winmerge - phpMyAdmin - WS_FTP - Photoshop - Paint Shop Pro - Crimson Editor

my installed contributions:  Category Banners, File Upload feature-.77, Header Tags, Sort_Product_Attributes_1, XSellv2.3, Price Break 1.11.2, wishlist 3.5, rollover_category_images_v1.2, Short_Description_v2.1, UPSXML_v1_2_3, quickbooks qbi_v2_10, allprods v4.4, Mouseover-effect for image-buttons 1.0, Ultimate_SEO, AAP 1.41, Auto Select State Value, Fast Easy Checkout,  Dynamic SiteMap v2.0, Image Magic, Links Manager 1.14, Featured Products, Customer Testimonials, Article Manager, FAQ System, and I'm sure more ...

#8   demonangel

demonangel
  • Members
  • 60 posts
  • Real Name:James Harvey
  • Gender:Male
  • Location:Fort Lauderdale, FL

Posted 02 August 2006 - 06:51 PM

Hi Guys, I just added this contrib to a client's site of mine, and Despite the fact that it is indeed a great contribution, If I change the quantity for Product in product_info.php to anythign other than 1, when it gets added to the cart it is displaying as '1'.

However, If I change the Quantity in the shopping cart, no problem. Just from when the cart is reading the quantity from product_info.php...

Did I do Somethign Wrong or miss a line or something? (Downloaded version 1.11.2 modified files pack, and Full pkg, with copy of modified files, complete Jemlin1)

-Thanks
DemonAngel

Edited by demonangel, 02 August 2006 - 06:54 PM.


#9   jpweber

jpweber
  • Members
  • 1,259 posts
  • Real Name:Jason Weber
  • Gender:Male
  • Location:Detroit, Michigan

Posted 02 August 2006 - 06:54 PM

View Postdemonangel, on Aug 2 2006, 02:51 PM, said:

Hi Guys, I just asdded this contrib to a client's site of mine, and Despite the fact that it is indeed a great contribution, If I change the quantity for Product in product_info.php to anyhtign other than 1, when it gets added to the cart it is displaying as '1'.

Anybody fix this?

-Thanks
DemonAngel

Can you paste the snippet of code we're talking about here?  I'll compare it to mine and see if I can help.

J
Jason

Simple 1-2-3 Intructions on how to get, install and configure SSL

The Google Sandbox explained

Simple to follow instructions on how to change the look of your OSC

How To Make A Horrible OSC Website

my toolbox: PHP Designer 2007 - Winmerge - phpMyAdmin - WS_FTP - Photoshop - Paint Shop Pro - Crimson Editor

my installed contributions:  Category Banners, File Upload feature-.77, Header Tags, Sort_Product_Attributes_1, XSellv2.3, Price Break 1.11.2, wishlist 3.5, rollover_category_images_v1.2, Short_Description_v2.1, UPSXML_v1_2_3, quickbooks qbi_v2_10, allprods v4.4, Mouseover-effect for image-buttons 1.0, Ultimate_SEO, AAP 1.41, Auto Select State Value, Fast Easy Checkout,  Dynamic SiteMap v2.0, Image Magic, Links Manager 1.14, Featured Products, Customer Testimonials, Article Manager, FAQ System, and I'm sure more ...

#10   demonangel

demonangel
  • Members
  • 60 posts
  • Real Name:James Harvey
  • Gender:Male
  • Location:Fort Lauderdale, FL

Posted 02 August 2006 - 07:27 PM

This is the code from product_info.php:

<td class="main" align="right">
                  <table border="0" align="right">
                    <tr><td align="center">
                      <?php echo TEXT_ENTER_QUANTITY . ":" . tep_draw_input_field('cart_quantity', $pf->adjustQty(1), 'size="6"'); ?>
                    </td></tr>
                    <tr><td align="center">
                      <?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>
                    </td></tr>
                  </table>

When I change the quantity here, it only says '1' in the shopping cart.

#11   jpweber

jpweber
  • Members
  • 1,259 posts
  • Real Name:Jason Weber
  • Gender:Male
  • Location:Detroit, Michigan

Posted 02 August 2006 - 07:31 PM

This is my code for the snippet you have; looks to be the same, and mine works just fine:

                <td class="main" align="right">
                  <table border="0" align="right">
                    <tr><td align="center">
                      <?php echo TEXT_ENTER_QUANTITY . ":" . tep_draw_input_field('cart_quantity', $pf->adjustQty(1), 'size="6"'); ?>
                    </td></tr>
                    <tr><td align="center">
                      <?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?>
                    </td></tr>
                  </table>


J
Jason

Simple 1-2-3 Intructions on how to get, install and configure SSL

The Google Sandbox explained

Simple to follow instructions on how to change the look of your OSC

How To Make A Horrible OSC Website

my toolbox: PHP Designer 2007 - Winmerge - phpMyAdmin - WS_FTP - Photoshop - Paint Shop Pro - Crimson Editor

my installed contributions:  Category Banners, File Upload feature-.77, Header Tags, Sort_Product_Attributes_1, XSellv2.3, Price Break 1.11.2, wishlist 3.5, rollover_category_images_v1.2, Short_Description_v2.1, UPSXML_v1_2_3, quickbooks qbi_v2_10, allprods v4.4, Mouseover-effect for image-buttons 1.0, Ultimate_SEO, AAP 1.41, Auto Select State Value, Fast Easy Checkout,  Dynamic SiteMap v2.0, Image Magic, Links Manager 1.14, Featured Products, Customer Testimonials, Article Manager, FAQ System, and I'm sure more ...

#12   Jan Zonjee

Jan Zonjee

    Governor of Peace

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

Posted 02 August 2006 - 07:32 PM

View Postdemonangel, on Aug 2 2006, 08:51 PM, said:

Hi Guys, I just added this contrib to a client's site of mine, and Despite the fact that it is indeed a great contribution, If I change the quantity for Product in product_info.php to anythign other than 1, when it gets added to the cart it is displaying as '1'.

However, If I change the Quantity in the shopping cart, no problem. Just from when the cart is reading the quantity from product_info.php...
I would expect this to come from application_top.php, product_info.php looks good indeed. Did you find these instructions?
File to be altered: catalog/includes/application_top.php

============================================================

Find:

// include currencies class and create an instance
  require(DIR_WS_CLASSES . 'currencies.php');
  $currencies = new currencies();

Add after the above:

// include the price formatter for the price breaks contribution
  require(DIR_WS_CLASSES . 'PriceFormatter.php');
  $pf = new PriceFormatter;

============================================================

Find:

								$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);

Change to:

								$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']);


#13   demonangel

demonangel
  • Members
  • 60 posts
  • Real Name:James Harvey
  • Gender:Male
  • Location:Fort Lauderdale, FL

Posted 02 August 2006 - 07:36 PM

It's just really weird, cause I I add multiples from the the Product listings page, no prob just the product info....

I tried your Snipplet, same thing, but I am gonna try using the snippet from the product_listing.php file and ssee what happens...

#14   demonangel

demonangel
  • Members
  • 60 posts
  • Real Name:James Harvey
  • Gender:Male
  • Location:Fort Lauderdale, FL

Posted 02 August 2006 - 07:44 PM

Okay Tried copying the code snipplet from my product_listing.ph file into my product_info.php file, and still no luck.

This is really getting to me cause, from the product listing, no prob, quantities are correct, it is only from the products_info.php page....hmmm.

It could be my code for all I know. But I'll double check, it is possible i over looked something...

#15   demonangel

demonangel
  • Members
  • 60 posts
  • Real Name:James Harvey
  • Gender:Male
  • Location:Fort Lauderdale, FL

Posted 02 August 2006 - 07:49 PM

Ah ha! Thanks Jan, I did over look that line, cause my application top has a slightly different line than:
$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);

My Line looks like:
//$cart->add_cart($products_id, $cart->get_quantity(tep_get_uprid($products_id, $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id'],true,array(),0);

So ha ha! It worked. Sorry for bogging everyone down with my probs and that to Jan and JP for thier help!

#16   jpweber

jpweber
  • Members
  • 1,259 posts
  • Real Name:Jason Weber
  • Gender:Male
  • Location:Detroit, Michigan

Posted 02 August 2006 - 07:58 PM

Good catch.  I have the mine altered like Jan said, as well.  Hope you have no more problems.

J
Jason

Simple 1-2-3 Intructions on how to get, install and configure SSL

The Google Sandbox explained

Simple to follow instructions on how to change the look of your OSC

How To Make A Horrible OSC Website

my toolbox: PHP Designer 2007 - Winmerge - phpMyAdmin - WS_FTP - Photoshop - Paint Shop Pro - Crimson Editor

my installed contributions:  Category Banners, File Upload feature-.77, Header Tags, Sort_Product_Attributes_1, XSellv2.3, Price Break 1.11.2, wishlist 3.5, rollover_category_images_v1.2, Short_Description_v2.1, UPSXML_v1_2_3, quickbooks qbi_v2_10, allprods v4.4, Mouseover-effect for image-buttons 1.0, Ultimate_SEO, AAP 1.41, Auto Select State Value, Fast Easy Checkout,  Dynamic SiteMap v2.0, Image Magic, Links Manager 1.14, Featured Products, Customer Testimonials, Article Manager, FAQ System, and I'm sure more ...

#17   demonangel

demonangel
  • Members
  • 60 posts
  • Real Name:James Harvey
  • Gender:Male
  • Location:Fort Lauderdale, FL

Posted 03 August 2006 - 03:58 PM

Hey JP, or Jan, where did you guys get that table...for the quantity breaks. I had to manually create mine for the contrib in the product_info.php file...

Just asking, cause I didn't see anyhting in the documentation regarding it...

#18   demonangel

demonangel
  • Members
  • 60 posts
  • Real Name:James Harvey
  • Gender:Male
  • Location:Fort Lauderdale, FL

Posted 03 August 2006 - 04:18 PM

For Anyone who wants it:

This is a code snipplet I put together for a switch of the discounts table:
(This example ius taken from my Clients' site which only has 5 level of discount...you can copy & paste the <TR> from level 5 on for the additional discounts...

essentially if the product has discounts, the table will show, if not, a nice message appears...

THE CODE:

<?php if ($product_info['products_price1'] == '0.0000'){
  echo '<tr><td colspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td colspan="3" bgcolor="#D9CFAB" align="center"><span class="style1">'. $product_info['products_name'].'&nbsp;does not have quantity discounts.</span></td>
        </tr>
</table>';
  }else{
  ?>
  <tr>
        <td colspan="3" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td colspan="3" bgcolor="#D9CFAB"><span class="style1">Quantity Discounts by Case </span></td>
        </tr>
      <tr>
        <td colspan="3" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="47%" bgcolor="823b3b" class="style1"><span class="style2">Case Quantity: </span></td>
            <td width="3%" bgcolor="823b3b" class="style2">&nbsp;</td>
            <td width="50%" align="right" valign="top" bgcolor="823b3b" class="style1"><span class="style2">Price:</span></td>
          </tr>
          <tr>
            <td><span class="style1">2-4 Cases: </span></td>
            <td>&nbsp;</td>
            <td align="right" valign="top"><?php //echo $product_info['products_price1'];
echo $currencies->display_price($product_info['products_price1'], tep_get_tax_rate($product_info['products_tax_class_id']))?></td>
          </tr>
          <tr>
            <td><span class="style1">5-9 Cases: </span></td>
            <td>&nbsp;</td>
            <td align="right" valign="top"><?php //echo $product_info['products_price2'];
echo $currencies->display_price($product_info['products_price2'], tep_get_tax_rate($product_info['products_tax_class_id']))?></td>
          </tr>
          <tr>
            <td><span class="style1">10-14 Cases: </span></td>
            <td>&nbsp;</td>
            <td align="right" valign="top"><?php //echo $product_info['products_price3'];
echo $currencies->display_price($product_info['products_price3'], tep_get_tax_rate($product_info['products_tax_class_id']))?></td>
          </tr>
          <tr>
            <td><span class="style1">15-19 Cases: </span></td>
            <td>&nbsp;</td>
            <td align="right" valign="top"><?php //echo $product_info['products_price4'];
echo $currencies->display_price($product_info['products_price4'], tep_get_tax_rate($product_info['products_tax_class_id']))?></td>
          </tr>
          <tr>
            <td bgcolor="#ECE9D8"><span class="style1">20 Cases or More: </span></td>
            <td bgcolor="#ECE9D8">&nbsp;</td>
            <td align="right" valign="top" bgcolor="#ECE9D8"><?php //echo $product_info['products_price5'];
echo $currencies->display_price($product_info['products_price5'], tep_get_tax_rate($product_info['products_tax_class_id']))?></td>
          </tr>
        </table></td>
        </tr>
<?php }?>

END THE CODE

#19   Jan Zonjee

Jan Zonjee

    Governor of Peace

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

Posted 03 August 2006 - 10:06 PM

View Postdemonangel, on Aug 3 2006, 05:58 PM, said:

where did you guys get that table...for the quantity breaks.
Standard feature in the class PriceFormatter which is called on product_info.php with $products_price=$pf->getPriceString();

#20   rickylam

rickylam
  • Members
  • 3 posts
  • Real Name:Ricky Lam

Posted 09 August 2006 - 03:26 AM

Thank you all for your contributions to OS commerce. I am having some problems with my database after running the "Quantity Price Breaks Per Product" plug-in and perhaps someone on this forum can help me with it.

I get the error message when I go to a specific item in my category "1054 - Unknown column 'p.products_id' in 'on clause'" This problem only occured after applying the package.

I did read in the forums about the SQL 5 compatiablity bug -- and downloaded the patch to fix it, however, I am still getting the same error message. I am running Windows 2000 , with mySQL 5 (community edition) and PHP 5.1.4.

Recently, I have been told that the SQL 5 bug fix is only suitable for Unix/Linux servers -- can anyone please help modify the SQL 5 bug fix code for a Windows server user?

Any help in this matter would be highly appreciated.

Thanks in advance!