Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Quantity Price Breaks Per Product


62 replies to this topic

#1 maria071

  • Community Member
  • 16 posts
  • Real Name:maria

Posted 11 October 2005, 03:36

I am totally missing something. I installed all the files and updated the DB but I don't see anything different where do you put the quantity discount info in?

THANK YOU for the help
Maria

#2 maria071

  • Community Member
  • 16 posts
  • Real Name:maria

Posted 11 October 2005, 12:46

View Postmaria071, on Oct 10 2005, 11:36 PM, said:

I am totally missing something. I installed all the files and updated the DB but I don't see anything different where do you put the quantity discount info in?

THANK YOU for the help
Maria

Anyone have any ideas?

#3 Jan Zonjee

  • Team Member
  • 7,001 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 11 October 2005, 16:15

View Postmaria071, on Oct 11 2005, 02:46 PM, said:

Anyone have any ideas?
Sure, but it seems obvious that where you change the price (indeed, admin/categories.php) you also put in the price breaks so I assume nobody wants to state the obvious.

You can download another Quantity Price Break contribution with screenshots that will give you an idea how the table where you put in the info should look like if it doesn't look any different than before installing that contribution.

#4 maria071

  • Community Member
  • 16 posts
  • Real Name:maria

Posted 11 October 2005, 16:30

View PostJanZ, on Oct 11 2005, 12:15 PM, said:

Sure, but it seems obvious that where you change the price (indeed, admin/categories.php) you also put in the price breaks so I assume nobody wants to state the obvious.

You can download another Quantity Price Break contribution with screenshots that will give you an idea how the table where you put in the info should look like if it doesn't look any different than before installing that contribution.


Thank you VERY much for responding. My screen looks nothing like the screenshot so now I have to backtrack and figure out where I went wrong.

I am sorry that the question seemed stupid I just wasn't seeing anything different.

#5 Yakky

  • Community Member
  • 1 posts
  • Real Name:Yak

Posted 25 October 2005, 20:05

Please place questions regarding the Quantity Price Breaks Per Product contribution here. Hopefully members can help with the various questions.

I get a lot of emails regarding this contribution, however, I am not the author of it and don't know any of the particular details. My contribution was simply pulling out the code that was changed in order to modify php files that may have been modified by other contributions.

If you have not installed any other contributions, I strongly urge downloading the complete package where you just copy over old files with the updated files.

Please only install the version where you have to copy and paste code (my contribution) only if you are familiar with the PHP language. If you are not, try getting a local friend to help you as it's very easy to mess things up using this method.

#6 Irin

  • Community Member
  • 740 posts
  • Real Name:Irina
  • Gender:Female
  • Location:USA

Posted 27 October 2005, 23:21

View PostYakky, on Oct 25 2005, 03:05 PM, said:

Please place questions regarding the Quantity Price Breaks Per Product contribution here. Hopefully members can help with the various questions.

I get a lot of emails regarding this contribution, however, I am not the author of it and don't know any of the particular details. My contribution was simply pulling out the code that was changed in order to modify php files that may have been modified by other contributions.

If you have not installed any other contributions, I strongly urge downloading the complete package where you just copy over old files with the updated files.

Please only install the version where you have to copy and paste code (my contribution) only if you are familiar with the PHP language. If you are not, try getting a local friend to help you as it's very easy to mess things up using this method.
Hello,

I've installed a "Quantity Price Breaks Per Product" contrib. Everything seems to work OK. I have some formating questions, though.
1. How can I make my Qty. discount to show like:
5-9 $108.00
10-24 $93.00
25+ $85.00
Right now I have:
5+ $108.00
10+ $93.00
25+ $85.00

2. How can I relocate my table to show up under product description, just before "This product was added to our catalog on ...." instead of at the place of product price? Actually, I'd like to keep an originally formated product price and have a table under product description with Qty. discounts.
Right now I have:
$130.00
5+ $108.00
10+ $93.00
25+ $85.00

3. And I'd like to change "Quantity" formating to a smaller font size.

I'll appreciate any ideas. Thanks,
Irina.

Edited by Irin, 27 October 2005, 23:25.


#7 dandelion

  • Community Member
  • 395 posts
  • Real Name:Ruth Maude
  • Gender:Female
  • Location:Toronto

Posted 02 November 2005, 02:54

Hi,

OOPS - Sorry I couldn't fine a thread so I started one but now I see there is this one so I'm double posting.

Anyway, I've just installed this contribution and now I realize how thick I am that it's not exactly what I need. I need Quantity Price Breaks across the store so no matter which size or style they buy when they buy 2 cartons they get 20% off the 1 carton price for that item, 3 cartons 30%, 4 cartons 40%, and 5 or more cartons 50%.

Also - I don't like the little table I want to remove it - where's the code?

HELP PLEASE!

#8 cgourlay

  • Community Member
  • 6 posts
  • Real Name:Colin gourlay

Posted 02 November 2005, 19:05

Can anyone help me out with this. I have this mod installed with the Product Attribute Options mod. When I add the same product to the cart, but with a different attribute, it is not discounted.

IE - if I order one blue widget and one red widget, no discount. Two blue widgets or two red widgets I get a discount.

Anyone know how to make this thing ignore attributes?

#9 virtualink

  • Community Member
  • 29 posts
  • Real Name:LC
  • Location:Hawaii

Posted 04 November 2005, 00:47

Problems with Shopping cart.

This contribution works great. However, I am having problems when an item is on special.

Example: Special price of item is $10.00. Quantity Discounts set at 2+ $9.00.

When 2 items are added, the shopping cart shows $18.00 - which is correct. However, the sub-total shows $20.00 - incorrect.

It seems the special price is overiding the quantity discount price in the shopping cart.

When there is no special price, the quantity discount works great - no problems in the shopping cart.

Any ideas please?
Aloha,
Lawrence

#10 virtualink

  • Community Member
  • 29 posts
  • Real Name:LC
  • Location:Hawaii

Posted 04 November 2005, 03:28

Please disregard my previous post. Problem corrected.

Operator error. Failed to follow instructions for includes/classes/shopping_cart.php. In CRE version the code is a little different, find the following:

		  $products_price = $pf->computePrice($qty);
		  $products_weight = $product['products_weight'];

Immediately after delete:
		  $special_price = tep_get_products_special_price($prid);
		  if ($special_price) {
			$products_price = $special_price;

Works fine now.
Aloha,
Lawrence

#11 lisk

  • Community Member
  • 18 posts
  • Real Name:lis k

Posted 04 November 2005, 04:12

I am trying to implement this add-on and I'm getting an error. It says "Call to a member function on a non-object" and points to this line (bolded - in products_info.php):

$product_info = tep_db_fetch_array($product_info_query);

tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
$pf->loadProduct((int)$HTTP_GET_VARS['products_id'], (int)$languages_id);
$products_price=$pf->getPriceString();



$pf also appears:

in products.php


<?php echo TEXT_ENTER_QUANTITY . ":" . tep_draw_input_field('cart_quantity', $pf->adjustQty(1), 'size="6"'); ?>

in application_top.php

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

in shopping_cart.php

}

function add_cart($products_id, $qty = '1', $attributes = '', $notify = true) {
global $new_products_id_in_cart, $customer_id;
global $languages_id;

$pf = new PriceFormatter;
$pf->loadProduct($products_id, $languages_id);
$qty = $pf->adjustQty($qty);
$products_id = tep_get_uprid($products_id, $attributes);
if ($notify == true) {
$new_products_id_in_cart = $products_id;
tep_session_register('new_products_id_in_cart');
}

100 or so lines down:

}

function calculate() {
global $languages_id;
$this->total = 0;
$this->weight = 0;
if (!is_array($this->contents)) return 0;
$pf = new PriceFormatter;
reset($this->contents);
while (list($products_id, ) = each($this->contents)) {
$qty = $this->contents[$products_id]['qty'];

// products price
if ($product = $pf->loadProduct($products_id, $languages_id)){
$prid = $product['products_id'];
$products_tax = tep_get_tax_rate($product['products_tax_class_id']);
$products_price = $pf->computePrice($qty);
$products_weight = $product['products_weight'];

...

function get_products() {
global $languages_id;

if (!is_array($this->contents)) return false;
$pf = new PriceFormatter;
$products_array = array();
reset($this->contents);
while (list($products_id, ) = each($this->contents)) {
if ($products = $pf->loadProduct($products_id, $languages_id)) {
$products_price = $pf->computePrice($this->contents[$products_id]['qty']);

in product_listing.php:

case 'PRODUCT_LIST_PRICE':
$lc_align = 'right';
$pf->parse($listing);
$lc_text = $pf->getPriceStringShort();

about 50 lines down:

case 'PRODUCT_LIST_PRICE':
$lc_align = 'right';
$pf->parse($listing);
$lc_text = $pf->getPriceStringShort();
break;

#12 eddydavik

  • Community Member
  • 14 posts
  • Real Name:Edward EScobar

Posted 26 December 2005, 05:28

View Postlisk, on Nov 3 2005, 09:12 PM, said:

I am trying to implement this add-on and I'm getting an error. It says "Call to a member function on a non-object" and points to this line (bolded - in products_info.php):

I had a similar problem, and the solution for me was that I edited the wrong line in application.top.php

This is what mine currently looks like. There are two instances where $cart->add_cart... comes up and I had edited the second one, when in fact, I should have edited the first one. This code below is the correct edited version. So I guess you can check yours with mine and see if they match.
 $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
	  case 'buy_now' :		if (isset($HTTP_GET_VARS['products_id'])) {
								if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
								  tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
								} else {
								  $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
								}
							  }

Hope this helps :)

#13 AlaneinHilo

  • Community Member
  • 40 posts
  • Real Name:Alane

Posted 30 December 2005, 00:09

I've got QPBPP mostly successfully installed but I am having an issue with the product copy feature in admin. When I attempt to copy (duplicate) a product I get this:

Quote

1136 - Column count doesn't match value count at row 1

insert into products (products_quantity, products_model, products_image, products_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, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('99', 'KUKUI-LEI', '', '7.0000', now(), null, '0.00', '0', '0', '0')

[TEP STOP]

The corresponding code in categories.php is:

elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') {
			$product_query = tep_db_query("select products_quantity, products_model, products_image, products_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, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
			$product = tep_db_fetch_array($product_query);

			tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, products_image, products_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, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "',  now(), " . (empty($product['products_date_available']) ? "null" : "'" . tep_db_input($product['products_date_available']) . "'") . ", '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");
			$dup_products_id = tep_db_insert_id();

			$description_query = tep_db_query("select language_id, products_name, products_description, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'");
			while ($description = tep_db_fetch_array($description_query)) {
			  tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_url']) . "', '0')");
			}

Where have I gone wrong here?

Thanks,
Alane

#14 Jan Zonjee

  • Team Member
  • 7,001 posts
  • Real Name:Jan Zonjee
  • Gender:Male
  • Location:the Netherlands

Posted 30 December 2005, 09:55

View PostAlaneinHilo, on Dec 30 2005, 01:09 AM, said:

Where have I gone wrong here?
From a version I downloaded some time ago it looks like you are not wrong, but the instructions incomplete. The (top) part should have been:
		  } elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') { // BOF changes for Price Break 1.11.3
			$product_query = tep_db_query("select products_quantity, products_model, products_image, products_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, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
			$product = tep_db_fetch_array($product_query);

			tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model,products_image, products_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, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "', '" . tep_db_input($product['products_price1']) . "', '" . tep_db_input($product['products_price2']) . "', '" . tep_db_input($product['products_price3']) . "', '" . tep_db_input($product['products_price4']) . "', '" . tep_db_input($product['products_price5']) . "', '" . tep_db_input($product['products_price6']) . "', '" . tep_db_input($product['products_price7']) . "', '" . tep_db_input($product['products_price8']) .  "', '" . tep_db_input($product['products_price1_qty']) . "', '" . tep_db_input($product['products_price2_qty']) . "', '" . tep_db_input($product['products_price3_qty']) . "', '" . tep_db_input($product['products_price4_qty']) . "', '" . tep_db_input($product['products_price5_qty']) . "', '" . tep_db_input($product['products_price6_qty']) . "', '" . tep_db_input($product['products_price7_qty']) . "', '" . tep_db_input($product['products_price8_qty']) ."', '" . tep_db_input($product['products_qty_blocks']) . "',  now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");
		// EOF changes for Price Break 1.11.3
			$dup_products_id = tep_db_insert_id();


#15 AlaneinHilo

  • Community Member
  • 40 posts
  • Real Name:Alane

Posted 30 December 2005, 19:25

That worked! Thanks so much for your quick help Jan!

Alane

#16 chaser777

  • Community Member
  • 20 posts
  • Real Name:Dominik

Posted 04 January 2006, 17:48

I am having an interesting problem with this module maybe someone can help here. I have the module installed in conjunction with lots of modules. Including the MAP module and the salemaker. When I use salemaker the sale price appears when you enter the product description and it does apply it when you check out. However it does not appear anywhere else. I am wondering if anyone has ever seen this before I would appreciate any help. If you want to see an example of this look at discount-wholesale-carpet.com/catalog.

Thanks

Dominik

#17 Hub

  • Community Member
  • 4 posts
  • Real Name:Hub Schoenmaekers

Posted 09 January 2006, 16:01

Hi there,

I've installed the trib and works fine now.

The only thing which bothers me a bit is that I have to fill the prices excluding tax even though I have display prices incl. tax set to true in the controlpanel.

So I want to insert the price incl. tax in the price field of the trib.

Any help is appreciated.

Thanks

Hub

#18 Genius

  • Community Member
  • 503 posts
  • Real Name:Prash

Posted 12 January 2006, 17:20

HI,

I have installed this contribution and all went well.. The problem i have to should i say the request i have is that i would like to have the product listing page to show the values that show on the product info page..

At the moment it shows like image, product name , 10-20 and the buy now button,

What i would like to show is the image, product name , then a box with the price and quantity to add and the buy now button ie .

image, Product name, 1 ($20), 3+ ($15), 5+($20) - Buy Now. * also to show at the bottom of each a quantity box.

Many thanks

#19 virtualink

  • Community Member
  • 29 posts
  • Real Name:LC
  • Location:Hawaii

Posted 04 February 2006, 01:11

I am trying to incorporate MSRP Display Price & Percentage into my system which already has Quantity Price Breaks Per Product installed.

Since PriceFormatter.php replaced code in product_info.php, I am stuck. The MSRP code was designed to replace the same code which was removed by Quantity Price Breaks.

Example:
/* REPLACED by Quantity Price Break per Product V-1.11.2_1
	if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
	  $products_price = 'Regular Price: <s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice"><br>Special Price: ' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
	} else {
	  $products_price = 'Your Price: <font color ="#FF0000">' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</font>';
	}
*/
// BEGIN Quantity Price Break per Product V-1.11.2_1 
	$pf->loadProduct((int)$HTTP_GET_VARS['products_id'], (int)$languages_id);
	$products_price=$pf->getPriceString();
// END Quantity Price Break per Product

I am supposed to replace the "original" product_info.php code with the following MSRP code:
				 $products_price = '<table class="PriceList" border="0" width="100%" cellspacing="0" cellpadding="0">';
			$new_price = tep_get_products_special_price($product_info['products_id']);
			if ($product_info['products_msrp'] > $product_info['products_price'])
			  $products_price .= '<tr><td>' . TEXT_PRODUCTS_MSRP . '</td><td class="oldPrice" align="right">' . $currencies->display_price($product_info['products_msrp'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</td></tr>';
			$products_price .= '<tr><td>' . TEXT_PRODUCTS_OUR_PRICE . '</td>';
			if ($new_price != '')
			  {$products_price .= '<td class="oldPrice"';}
			else
			  {$products_price .= '<td';}
			$products_price .= ' align=right>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</td></tr>';
			if ($new_price != '')
			  {$products_price .= '<tr class="productSpecialPrice"><td>' . TEXT_PRODUCTS_SALE . '</td><td align=right>' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</td></tr>';}
			if ($product_info['products_msrp'] > $product_info['products_price'])
			  {if ($new_price != '')
				{$products_price .= '<tr><td>' . TEXT_PRODUCTS_SAVINGS . '</td><td align=right>' . $currencies->display_price(($product_info['products_msrp'] -  $new_price) , tep_get_tax_rate($product_info['products_tax_class_id'])) . ' (' . ceil((($product_info['products_msrp'] -  $new_price) / $product_info['products_msrp']) * 100) . '% )</td></tr>';}
			  else
				{$products_price .= '<tr><td>' . TEXT_PRODUCTS_SAVINGS . '</td><td align=right>' . $currencies->display_price(($product_info['products_msrp'] -  $product_info['products_price']) , tep_get_tax_rate($product_info['products_tax_class_id'])) . ' (' . ceil((($product_info['products_msrp'] -  $product_info['products_price']) / $product_info['products_msrp']) * 100) . '% )</td></tr>';}}
			else
			  {if ($new_price != '')
				{$products_price .= '<tr><td>' . TEXT_PRODUCTS_SAVINGS . '</td><td align=right>' . $currencies->display_price(($product_info['products_price'] -  $new_price), tep_get_tax_rate($product_info['products_tax_class_id'])) . ' (' . ceil((($product_info['products_price'] - $new_price) / $product_info['products_price']) * 100) . '% )</td></tr>';}}
			$products_price .= '</table>';

Any help would be very much appreciated!!
Aloha,
Lawrence

#20 northernmonkey

  • Community Member
  • 14 posts
  • Real Name:Ben

Posted 12 February 2006, 06:43

View PostIrin, on Oct 27 2005, 11:21 PM, said:

Hello,

I've installed a "Quantity Price Breaks Per Product" contrib. Everything seems to work OK. I have some formating questions, though.
1. How can I make my Qty. discount to show like:
5-9 $108.00
10-24 $93.00
25+ $85.00
Right now I have:
5+ $108.00
10+ $93.00
25+ $85.00

2. How can I relocate my table to show up under product description, just before "This product was added to our catalog on ...." instead of at the place of product price? Actually, I'd like to keep an originally formated product price and have a table under product description with Qty. discounts.
Right now I have:
$130.00
5+ $108.00
10+ $93.00
25+ $85.00

3. And I'd like to change "Quantity" formating to a smaller font size.

I'll appreciate any ideas. Thanks,
Irina.

I too would like to know how to change the look and location of the price information table and also the size of the 'quantity' text above the add to cart button