Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Quantity Price Breaks


jpweber

Recommended Posts

@ Jan_Zonjee

 

Hi!

 

Thanks for quick answer. I will use the QPBPP - not back to the backup.

I like to hide this table (1+,2+,3+....) , because I dont need this.

And if I set 10 Prices, than is this table to big. If only displayed the "FROM PRICE", that is enough.

 

But you have say, I can change the sourcecode. But in which file i must change it?

 

 

Many Thanks!!!!

Link to comment
Share on other sites

Can you suggest a fix if the rule is not enforced in the standard contribution ?

It used to work like that. I haven't tried doing that in the new version in which a lot was changed. Will need to look into that.

Link to comment
Share on other sites

It used to work like that. I haven't tried doing that in the new version in which a lot was changed. Will need to look into that.

 

 

Thanks fo rthe rapid respones -

 

do you mean that it should enforce the rule "it used to work that way" -?

 

So is this a little bug ?

Link to comment
Share on other sites

I just installed the QPBPP Contribution. Everything is working in the admin in catalog pages. I am able to Give products price breaks. The price breaks show up properly on the catalog pages and in the shopping cart.

 

Here's the problem: When a customer goes to checkout the "checkout_shipping.php" loads with a blank page. The source code is there but the windows is blank.

 

Any ideas where the problem might be?

 

Thanks

Link to comment
Share on other sites

I seem to remember that there is a way to temporarily turn on error reporting in OS Commerce so that when you run into problems like this you can get error messages on the screen that OSCommerce typically suppresses.

 

Any idea how to do that?

Link to comment
Share on other sites

Correction: If I click on view source in the browser window it does NOT show me any source code. I thought it did the first time I tried but I must have been mistaken.

 

Not sure if that changes anything or not for troubleshooting.

Link to comment
Share on other sites

Correction: If I click on view source in the browser window it does NOT show me any source code. I thought it did the first time I tried but I must have been mistaken.

 

Not sure if that changes anything or not for troubleshooting.

You have to have the error messages. Doesn't your hosting provider log them to an error log?

 

In principle you can change the echo'ing of the error message with an .htaccess file on an Apache server I believe. In principle ... because if the hosting service set up Apache to ignore .htaccess files it still doesn't help.

Link to comment
Share on other sites

So is this a little bug ?

More then a few. The data that come from PriceFormatterStore should be converted a bit. And then it is very well possible that the $this->price_breaks is not an array so that you get PHP warnings about the foreach in two places. I thought it wasn't possible but I was obviously dead wrong.

 

After line 41 in PriceFormatter.php some code should be added:

	$product_id = tep_get_prid($product_id); // only use integers here
// returns NULL if the price break information is not yet stored
$price_formatter_data = $pfs->getPriceFormatterData($product_id);
if (tep_not_null($price_formatter_data)) {
  //Use data from the cache with some conversions
  $price_formatter_data['products_special_price'] = $price_formatter_data['specials_new_products_price'];
  $price_formatter_data['qtyBlocks'] = $price_formatter_data['products_qty_blocks'];
} elseif ($listing == NULL) {

Then around line 130 it should look if $this->price_break is an array

	if (true == $this->hasSpecialPrice && is_array($this->price_breaks)) {
  foreach($this->price_breaks as $key => $price_break) {
	$this->price_breaks[$key]['products_price'] = min($price_break['products_price'], $this->specialPrice);
  }
}
//end changes to support special prices

And then a few lines further in the function computePrice again:

	if (is_array($this->price_breaks) && count($this->price_breaks) > 0) {
  foreach($this->price_breaks as $price_break) {
	if ($qty >= $price_break['products_qty']) {
	  $price = $price_break['products_price'];
	}
  }
} // end if (is_array($this->price_breaks) && count($this->price_breaks) > 0)

Link to comment
Share on other sites

Hello

 

I seem to be getting the same problem as phcranston above with the shoppingcart.php

 

The error message I am getting is

 

PHP Fatal error: Call to a member function on a non-object in /hermes/web10/b1334/as.gogonow/catalog/includes/classes/shopping_cart.php on line 287

 

// BOF qpbpp
      $pf->loadProduct($products_id, $languages_id);
       if ($product = $pfs->getPriceFormatterData($products_id)) {
         $prid = $product['products_id'];
         $products_tax = tep_get_tax_rate($product['products_tax_class_id']);
         $products_price = $pf->computePrice($qty, $nof_items_in_cart_same_cat);
// EOF qpbpp

 

with

if ($product = $pfs->getPriceFormatterData($products_id)) {

being my problem line.

 

If you can help me, I would be most grateful.

Link to comment
Share on other sites

The error message I am getting is

 

PHP Fatal error: Call to a member function on a non-object in /****/catalog/includes/classes/shopping_cart.php on line 287

 

// BOF qpbpp
   $pf->loadProduct($products_id, $languages_id);
	if ($product = $pfs->getPriceFormatterData($products_id)) {
	  $prid = $product['products_id'];
	  $products_tax = tep_get_tax_rate($product['products_tax_class_id']);
	  $products_price = $pf->computePrice($qty, $nof_items_in_cart_same_cat);
// EOF qpbpp

 

with

if ($product = $pfs->getPriceFormatterData($products_id)) {

being my problem line.

And did you add $pfs to the line that starts with global in the function calculate() ?

	function calculate() {
  global $currencies, $languages_id, $pfs; // for qpbpp added: $languages_id, $pfs

Edited by Jan Zonjee
Link to comment
Share on other sites

I am sorry but I am having trouble again...

 

I think there may be a problem with the Discount Categories.

 

I have two products, same price, same discounts in the same discount category but the price is not fixing.

 

IE:

 

Product X cost $20.00 each but if you buy 2, the price drops to $18.00 each for a total of $36.00

Product Y cost $20.00 each also and if you buy 2, the price drops to $18.00 each for a total of $36.00

 

I want a customer to be able to buy both Product X and Product Y, and the grand total come out to $36.00. Right now, the total is coming up as $40.00.

 

If I am doing something wrong, please tell me. Again, if it's something I forgot, I would like to apologize in advance for wasting your time.

Link to comment
Share on other sites

I am sorry but I am having trouble again...

 

If I am doing something wrong, please tell me.

Bugger, I justed tested this and I get it the other way around: one product in the cart and it gives a subtotal as if two products of the same discount category are in the cart.

 

Will have to wait till tomorrow...

Link to comment
Share on other sites

Bugger, I justed tested this and I get it the other way around: one product in the cart and it gives a subtotal as if two products of the same discount category are in the cart.

 

Will have to wait till tomorrow...

 

I believe I saw the same thing but was unable to recreate this. Just glad I wasn't going crazy. I just can recreate my problem that I explained in my last post.

Link to comment
Share on other sites

I believe I saw the same thing but was unable to recreate this. Just glad I wasn't going crazy. I just can recreate my problem that I explained in my last post.

Should be over in the new version I uploaded yesterday (when the forums were down for the upgrade of forum software).

Link to comment
Share on other sites

I am sorry but I am having trouble again...

 

I think there may be a problem with the Discount Categories.

 

I have two products, same price, same discounts in the same discount category but the price is not fixing.

 

IE:

 

Product X cost $20.00 each but if you buy 2, the price drops to $18.00 each for a total of $36.00

Product Y cost $20.00 each also and if you buy 2, the price drops to $18.00 each for a total of $36.00

 

I want a customer to be able to buy both Product X and Product Y, and the grand total come out to $36.00. Right now, the total is coming up as $40.00.

 

If I am doing something wrong, please tell me. Again, if it's something I forgot, I would like to apologize in advance for wasting your time.

 

Hi Jan,

 

Im still having the same problem even after applying the update. In my opinion, for some reason, the discount category is not adding the total quantity up together of Product X and Product Y despite being in the same discount category.

 

I placed the products all in the same discount category but that is all. Is there something I am missing here?

Link to comment
Share on other sites

Im still having the same problem even after applying the update. In my opinion, for some reason, the discount category is not adding the total quantity up together of Product X and Product Y despite being in the same discount category.

 

I placed the products all in the same discount category but that is all. Is there something I am missing here?

I can't replicate that error, it is working fine for me. Also if I remove one of those products, it goes back to the non-discounted price.

 

First thing is to check if the discount_categories_id is set for the product. Try changing the last lines of includes/footer.php to:

<?php
global $pfs;
echo '<pre>'; // add begin of HTML comment <!-- and close with end HTML comment after printing --> if you don't want your
// customers to see this. You will have to do a "view source" of the page to see the contents of the object pfs then
print_r($pfs);
 }
?>

Link to comment
Share on other sites

  • 2 weeks later...

Hi, Great contribution, I have installed the Price Break 1.3.4 and is working great, but I have a question/issue, on the category view its show only the lowest price, and what I would like to show is the price range, the following picture shows my question better. Is something that I miss on the install? or where to look?

 

Please click on the image to show in proper resolution

 

samplenc9.jpg

 

Thanks for your help

Link to comment
Share on other sites

I answer myself the very previous post:

 

I edited the catalog/includes/classes/PriceFormatter.php to fix the layout of the getPriceStringShort() function.

 

Mhh I realized the code was there but commented, does somebody knows why it was moved to "From $XXX" layout instead of showing range? I mean, I know in the very end everybody can choose how to show the price but I mean if it has more impact on the sales I could revert to the "From $XXX" layout.

 

Any comment will be very appreciated.

Link to comment
Share on other sites

does somebody knows why it was moved to "From $XXX" layout instead of showing range?

Probably a personal preference of pbor1234 but if you really want to know you should ask him directly.

Link to comment
Share on other sites

  • 2 weeks later...

Hello.

 

I had installed QBP 1.3.4 but I have problems to put it together with the product_sort contrib. Many things overlap.

 

The storefront is fine so far.

 

In the admin I become following error:

 

 

1109 - Unknown table 'pd' in field list

 

select pd.products_name, pd.products_description, pd.products_head_title_tag, pd.products_head_desc_tag, pd.products_head_keywords_tag, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, products_qty_blocks, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id, p.products_sort_order, ptdc.discount_categories_id from products p left join products_to_discount_categories ptdc on p.products_id = ptdc.products_id where p.products_id = '0'

 

[TEP STOP]

 

I have installed the price_break.sql but I'm not sure about this in the readme:

 

 

alter table products add column products_price1 decimal(15,4) not null default 0.0;

alter table products add column products_price2 decimal(15,4) not null default 0.0;

alter table products add column products_price3 decimal(15,4) not null default 0.0;

alter table products add column products_price4 decimal(15,4) not null default 0.0;

alter table products add column products_price5 decimal(15,4) not null default 0.0;

alter table products add column products_price6 decimal(15,4) not null default 0.0;

alter table products add column products_price7 decimal(15,4) not null default 0.0;

alter table products add column products_price8 decimal(15,4) not null default 0.0;

alter table products add column products_price1_qty int not null default 0;

alter table products add column products_price2_qty int not null default 0;

alter table products add column products_price3_qty int not null default 0;

alter table products add column products_price4_qty int not null default 0;

alter table products add column products_price5_qty int not null default 0;

alter table products add column products_price6_qty int not null default 0;

alter table products add column products_price7_qty int not null default 0;

alter table products add column products_price8_qty int not null default 0;

alter table products add column products_qty_blocks int not null default 1;

 

 

Must I also insert this above?

 

Thanks

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...