Latest News: (loading..)
jpweber

Quantity Price Breaks

903 posts in this topic

But when I click on info to preview of product so there is not break price:

Well, what do you think happens in this piece of code:

	$pf->loadProduct((int)$HTTP_GET_VARS['products_id'], (int)$languages_id);
$products_price = $pf->getPriceString(); 


  $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
}

Next problem. I can not get to cart item from product info only from product listing.

You use a template. How should we know if they coded that correctly.

 

And last problem. When I add item to the cart from product listing and go to cart and change number of items for exmaple 10x so there should be 10x $600 -> $6000 and there is $7900.

See above. The code in your shopping_cart class seems OK on quick glance.

Share this post


Link to post
Share on other sites
Well, what do you think happens in this piece of code:

	$pf->loadProduct((int)$HTTP_GET_VARS['products_id'], (int)$languages_id);
$products_price = $pf->getPriceString(); 


  $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
}

 

You use a template. How should we know if they coded that correctly.

See above. The code in your shopping_cart class seems OK on quick glance.

 

 

hey Jan could you take a look at my posts on page number 10 and that message I sent you the other night, please?

Share this post


Link to post
Share on other sites

Hi

 

Can I get this contridution so my coustomers can:

 

pick and mix 100 of any products in a Categorie and get the lowest prices?

 

IE

 

product a order 42

product b order 26

product c order 32

 

and as the total items add up to 100 then prices our £x.oo or 20% off (price £y.oo is the higher)

 

each product has a price for qty 100 mix

and a each price

 

can this be done?

Share this post


Link to post
Share on other sites
can this be done?

In the package you downloaded it is already described how you can "upgrade" to that.

Share this post


Link to post
Share on other sites
Ok there's been one small mistake in css file, that I forgot to put in there, now it looks a bit better, but still, my item's text is too far from its name, there's big gap between it, any ideas how to fix it?

Just to make things clear, customizing osC to another look is the job of the shop owner.

 

The position of the table with the prices is the place where $products_price is echo'ed. The appearance of that table and/or $products_price is determined by the code in the function getPriceString() in includes/catalog/classes/PriceFormatter.php

 

If you want it to look differently I suggest you first make it in HTML (save a php page as an html page and tinker with that).

 

Once you are satisfied with the way it looks in HTML you can then adapt the code in getPriceString() to output the HTML you want.

Share this post


Link to post
Share on other sites

Hello guys,

 

thank for this contrib.

 

I have a problem. Everything works fine ( administration, shopping cart, etc. ), but the prices are not showing in product listing. If I open product, the price is there but in the product summary ( product list ) is not.

 

If i tried the file product_listing.php which was delivered with the latest release, the prices were there, but i had another product listing design, than i wanted.

 

Do somebody know, why are the prices not showing in product listing?

The file product_listing.php was changed as descibed in install file.

 

Thank for every help.

 

System: OS 2.2, OPBPP 1.2.9

 

Sending screens as example:

 

 

error1.gif

error2.gif

Edited by trajektik

Share this post


Link to post
Share on other sites

I've added products to the shopping cart and added attributes that give quantity details.

E.G.

 

5 pack for £5.00

10 pack for £9.00

20 pack for £17.00

 

When in the shopping cart the actual quantity value is still 1 if you select the 20 pack. I would prefer it to show either 20 or when the product is a five pack then 4.

 

Is QPBPP what I need to resolve this issue or is there a simpler way of sorting out the issue?

 

Thanks, Paul

Share this post


Link to post
Share on other sites
I've added products to the shopping cart and added attributes that give quantity details.

E.G.

 

5 pack for £5.00

10 pack for £9.00

20 pack for £17.00

 

When in the shopping cart the actual quantity value is still 1 if you select the 20 pack. I would prefer it to show either 20 or when the product is a five pack then 4.

 

Is QPBPP what I need to resolve this issue or is there a simpler way of sorting out the issue?

 

Thanks, Paul

 

 

Well I started to have a go at installing on a test site using our template but unfortunately there seems to be a lot of differences in the coding and in some instances the code referred to just is not there. I even looked just for a part (i.e. $currencies) and it wasn't there.

 

My PHP skills are very limited.

 

Two questions:

Is there a site where I can see this up and running (admin as well as the cart)?

 

Thanks, Paul

Edited by Jan Zonjee

Share this post


Link to post
Share on other sites

Hello all,

 

I just added Quantity Price Break to a new install of latest edition of OSC. Only other mod installed is STS. As far as I can tell I added , replaced or commented out everything properly. I also upoaded the required files and ran the SQL query using the enclose file to add the necessary tables. When I go to the ADmin section - Categories/Prodcuts I revieve the following error at the top of the page and not right box.

 

1054 - Unknown column 'p.products_price1' in 'field list'

 

select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_price1, p.products_price2, p.products_price3, p.products_price4, p.products_price5, p.products_price6, p.products_price7, p.products_price8, p.products_price1_qty, p.products_price2_qty, p.products_price3_qty, p.products_price4_qty, p.products_price5_qty, p.products_price6_qty, p.products_price7_qty, p.products_price8_qty, p.products_qty_blocks, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from products p, products_description pd, products_to_categories p2c where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = '0' order by pd.products_name

 

[TEP STOP]

 

I have a little php experience but this error is beyond my knowledge. ANy help would be appreciated. Thanks.

 

Bill

Share this post


Link to post
Share on other sites
As far as I can tell I added , replaced or commented out everything properly. I also upoaded the required files and ran the SQL query using the enclose file to add the necessary tables. When I go to the ADmin section - Categories/Prodcuts I revieve the following error at the top of the page and not right box.

 

1054 - Unknown column 'p.products_price1' in 'field list'

Actually, the included sql file is for an addition to this mod. The sql for the "regular" mod is found in the install.html and it looks like you didn't run that:

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;

Share this post


Link to post
Share on other sites
Just to make things clear, customizing osC to another look is the job of the shop owner.

 

The position of the table with the prices is the place where $products_price is echo'ed. The appearance of that table and/or $products_price is determined by the code in the function getPriceString() in includes/catalog/classes/PriceFormatter.php

 

If you want it to look differently I suggest you first make it in HTML (save a php page as an html page and tinker with that).

 

Once you are satisfied with the way it looks in HTML you can then adapt the code in getPriceString() to output the HTML you want.

 

Easier said that done, it's not that easy like regular php'ing

Share this post


Link to post
Share on other sites
Easier said than done, it's not that easy like regular php'ing

Let's do it this way: you write the HTML, tell us the sort order of the different elements in product listing and then we/I take a look at how it can be implemented in PHP.

Share this post


Link to post
Share on other sites
If i tried the file product_listing.php which was delivered with the latest release, the prices were there, but i had another product listing design, than i wanted.

 

Do somebody know, why are the prices not showing in product listing?

Hard to say. These templates tend to use their own coding for the product_listing.php which is very different from the standard osC way. In the product_listing.php all you get is the low price-high price range (for example $23 - $27) so perhaps you can do without?

Share this post


Link to post
Share on other sites
Actually, the included sql file is for an addition to this mod. The sql for the "regular" mod is found in the install.html and it looks like you didn't run that:

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;

 

Actually, this file is included with the release. But just to be sure I deleted the tables created by the original file. I then copied the code listed above from the HTML file. Pasted in the query box in the database and ran the function to create the new tables. I ended up with an identical table structure as before. The problem is, even after I did this I ended up with the same error. What's th next step to fix this? Thanks

 

Bill Kardos

Share this post


Link to post
Share on other sites
I ended up with an identical table structure as before. The problem is, even after I did this I ended up with the same error.

Why would MySQL tell you the column is not there when it is? Unless it is in a totally different query I don't see how this should be possible (unless the changes are in a different database then the one giving the error).

Share this post


Link to post
Share on other sites
Why would MySQL tell you the column is not there when it is? Unless it is in a totally different query I don't see how this should be possible (unless the changes are in a different database then the one giving the error).

 

I'm just about to integrate this contribution untill i noticed the changes to the products table:

 

alter table products

add column products_price1 decimal(15,4) not null default 0.0,

add column products_price2 decimal(15,4) not null default 0.0,

add column products_price3 decimal(15,4) not null default 0.0,

......etc.

 

I feel this should have been a seperate table with products_id as a foreignkey to link the product to the price-break. Now each product has the overhead of 16 columns!??!??

 

Who knows, is there an alternative that does do this the way it should be done?

Share this post


Link to post
Share on other sites
I'm just about to integrate this contribution untill i noticed the changes to the products table:

 

alter table products

add column products_price1 decimal(15,4) not null default 0.0,

add column products_price2 decimal(15,4) not null default 0.0,

add column products_price3 decimal(15,4) not null default 0.0,

......etc.

 

I feel this should have been a seperate table with products_id as a foreignkey to link the product to the price-break. Now each product has the overhead of 16 columns!??!??

 

Who knows, is there an alternative that does do this the way it should be done?

As far as I know there is no alternative but if you want to change it to something that works more proper than go ahead. That is what open source is about.

 

It would open up the possibility to use less or more than 8 quantities I think.

Share this post


Link to post
Share on other sites
As far as I know there is no alternative but if you want to change it to something that works more proper than go ahead. That is what open source is about.

 

It would open up the possibility to use less or more than 8 quantities I think.

 

Exactly ;) I will first try to integrate the current solution in, then see if i can build it more efficiently.

Paul

Share this post


Link to post
Share on other sites
Why would MySQL tell you the column is not there when it is? Unless it is in a totally different query I don't see how this should be possible (unless the changes are in a different database then the one giving the error).

The columns added are in the products table of the MySQL database for the OSCommerce install. I don't understand either why it's saying the column isn't there. Is there some error in copying or pasting the code, like not using a } that could cause this? Is there some conflict with the STS Mod that's keeping this from working? I really need to use this QPB Mod and any helpor suggestions would be appreciated.

Share this post


Link to post
Share on other sites
The columns added are in the products table of the MySQL database for the OSCommerce install. I don't understand either why it's saying the column isn't there. Is there some error in copying or pasting the code, like not using a } that could cause this? Is there some conflict with the STS Mod that's keeping this from working? I really need to use this QPB Mod and any helpor suggestions would be appreciated.

And you added this to the shop and there you don't get the error? Are you 100% sure the database that admin/includes/configure.php is pointing to is the same as the one in the shop part?

 

This doesn't make sense.

Share this post


Link to post
Share on other sites
And you added this to the shop and there you don't get the error? Are you 100% sure the database that admin/includes/configure.php is pointing to is the same as the one in the shop part?

 

This doesn't make sense.

 

That's one of the first things I thought about as well. I confirmed that the same databse is being pointed to as in the shop part. If the admin/includes/configure.php wasn't pointing at the correct DB wouldn't the rest of the shop be non-functional as well?

 

As I'm looking at this error more I'm wondering if this might be the problem -

 

1054 - Unknown column 'p.products_price1' in 'field list'

 

There is no column "p.products_price1" in the field list. The column that was created by the database querry was "products_price1" in the Products table. Any ideas?

 

Bill

Edited by billkard

Share this post


Link to post
Share on other sites
There is no column "p.products_price1" in the field list. The column that was created by the database querry was "products_price1" in the Products table.

No, that is OK. The p. points to the table (table.field) where further on in the query the table products is abbreviated as p. That's not it. I'm flabbergasted...

Share this post


Link to post
Share on other sites
No, that is OK. The p. points to the table (table.field) where further on in the query the table products is abbreviated as p. That's not it. I'm flabbergasted...

 

OK, Thanks for all your help. I finally got this all worked out. Turns out the site wa heavily customized by my host, Globat. They have files split between secure andnon-secure directories. Turns out there were 3 instances of configure.php and one of the was pointing the wrong place, although I don'tknow how. GOt everything pointing the right place and now it works. Thanks again.

Share this post


Link to post
Share on other sites
OK, Thanks for all your help. I finally got this all worked out. Turns out the site wa heavily customized by my host, Globat. They have files split between secure andnon-secure directories. Turns out there were 3 instances of configure.php and one of the was pointing the wrong place, although I don'tknow how. GOt everything pointing the right place and now it works. Thanks again.

OK, now I have a new set of issues and hoping there's some help out there. I've got things working to a point. Turns out my hosting provider has OSC 2.2 MS2 installed, not the current version. Most things are the same but the shopping_cart.php is significantly different. I was able to adapt the code to the shopping cart by reviewing the files in an older version of the release. Now everything works fine until the point when I try to check out and and checkout_shipping.php is called. I am returned a white screen with nothing on it. When I view source there'snothing to view. It works this way whether I use the checkout button in the cart or the menu at the top.

When I revert to the saved,unaltered files prior to adding Quantity Price Break mods everything functions as normal. So I've narrowed it down to something in QPB, but what? I didn't alter checkout_shipping. Hope you can provide some help.

 

Bill

Share this post


Link to post
Share on other sites
Hope you can provide some help.

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?

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