Jump to content
jpweber

Quantity Price Breaks

Recommended Posts

Hi Jan.

 

Thanks for your advice. It is because there isn't any table of 'products_groups' in my database. So, I think that maybe I need install the 4.2.1 first. Finally, thanks for your advice.

 

From the instruction, there is one instruction which show:

'UPDATE `configuration_group`

SET sort_order = last_insert_id() WHERE `configuration_group_id` = last_insert_id();'.

 

After I insert it to database, it shows 'error message' as below:

________________________________________________________

Error

SQL query:

 

SET sort_order = last_insert_id( ) WHERE `configuration_group_id` = last_insert_id( )

MySQL said:

 

#1193 - Unknown system variable 'sort_order'

_________________________________________________________

Sorry about that I am the new user of oscommerce and didn't know any database knownledge, actually, how to 'UPDATE `configuration_group` into the database?? Can you give me advice on it?

 

Thanks for your attention.

 

Carmet

 

Hi Jan,

 

Sorry, I know how to add it now. Thank you

 

Carmet

Share this post


Link to post
Share on other sites

Hi Jan,

 

You told me that if I want to use the SPPC, I should use the update one of SPPC 4.2.2 only, no need install 4.2.1 to upgrade 4.2.2 because of big work load. However, I checked that if I only install the SPPC 4.2.2, it is not the full package for new user. It was because I found out that some instructions of SPPC4.2.2 must add after the instruction of SPPC4.2.1. such as below:

____________________________________________

in catalog/admin/includes/functions/general.php

 

Line 923-925 (this is in function tep_remove_product)

**AFTER**

// BOF Separate Pricing Per Customer

tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . (int)$product_id . "'");

// EOF Separate Pricing Per Customer

 

**ADD**

// BOF QPBPP for SPPC

tep_db_query("delete from " . TABLE_PRODUCTS_PRICE_BREAK . " where products_id = '" . (int)$product_id . "'");

tep_db_query("delete from " . TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES . " where products_id = '" . (int)$product_id . "'");

// EOF QPBPP for SPPC

______________________________________________

 

And in my osc, there isn't any ''// BOF Separate Pricing Per Customer....'', how do I add the new installation?? Therefore, should I install the 4.2.1 first and then upgrade to 4.2.2?? Please kindly advice.

 

Carmet

Share this post


Link to post
Share on other sites

Hi All,

I want to know is there have anyone reformat the price table html output? I want a vertical price table but my coding is very limited. Did anyone have made the changes before and can email me the code? Thanks a lot!!! my email: fran.nwk@gmail.com

 

 

 

 

B.Regards

Fran Ng

Share this post


Link to post
Share on other sites

Hey Guys,

Quik question. I want to be able to print or echo the price breaks for each product on the shopping cart page. I'll explain.

 

Product Name

Widget #1 (Save more when you Buy: 4 = $15.95 | Buy: 10 = $12.95) $19.95

 

How do I go about defining that so I can add it to the shopping cart? Any ideas or help in the right direction would be greatly appreciated.

 

Thanks

Edited by PropioWeb

Samuel Mateo, Jr.

osC 2.2 MS2

Installed Mods:

WYSIWYG HTMLArea 1.7 | Basic Template System 1.0 | osC-Affiliate | OSC-SupportTicket

Featured Products 1.3 | LoginBox 5.2 | LatestNews 1.1.3 | Extras for IE

Share this post


Link to post
Share on other sites

Dear Jan,

 

Thx for a great contrib. It works really well.

I do have an issue with another contrib I installed: Attribute Qty Product Info.

The thing is that when a product has attributes they are all shown with a seperate quantity box next to the attribute.

When Clicking on the add to cart. All available attrib's are put into the cart.

I would love for the quantity box above the add to cart button to disappear when attributes are present. Would that be possible?

 

Could you please help me out on how to change this?

 

Thank you for a quick answer.

 

Wkr,

 

Boetje

Share this post


Link to post
Share on other sites
Quik question. I want to be able to print or echo the price breaks for each product on the shopping cart page. I'll explain.

 

Product Name

Widget #1 (Save more when you Buy: 4 = $15.95 | Buy: 10 = $12.95) $19.95

 

How do I go about defining that so I can add it to the shopping cart? Any ideas or help in the right direction would be greatly appreciated.

I would try to use the PriceFormatter.php when in the for ($i=0, $n=sizeof($products); $i<$n; $i++) { loop with $pf->loadProduct((int)$products[$i]['id'], (int)$languages_id); (similar to what is used on product_info.php).

 

And write a function in PriceFormatter.php that builds and then returns the (Save more when you Buy: 4 = $15.95 | Buy: 10 = $12.95) when there are price breaks.

Let's say we call that function getSaveMoreWhenYouBuy. Then after the $pf->etc. you call that function e.g. with

$save_more_when_you_buy = $pf->getSaveMoreWhenYouBuy();

Then all you have to do is echo $save_more_when_you_buy on the appropriate spot.

Share this post


Link to post
Share on other sites

Hi, I have one strange glitch with this very useful plugin. Say that I have two different products in my store which cost $10, or $8 if 10+ are ordered. Then, a customer orders 10 of ITEM01 (which charges $80) but only 1 of ITEM02; still ITEM02 is discounted as if 10+ are ordered even though that is not the case. Any easy cure for this?

Share this post


Link to post
Share on other sites
Hi, I have one strange glitch with this very useful plugin. Say that I have two different products in my store which cost $10, or $8 if 10+ are ordered. Then, a customer orders 10 of ITEM01 (which charges $80) but only 1 of ITEM02; still ITEM02 is discounted as if 10+ are ordered even though that is not the case. Any easy cure for this?

That should only happen when both ITEM02 and ITEM01 are in the same discount category. If not, it shouldn't happen.

Share this post


Link to post
Share on other sites

I have a slightly different application and I am wondering if this controb can do it.

 

I want to have it so that if a customer orders 1 of an item it is $100, then it is $50 for each additional.

 

Can this do it or is anyone aware of a modification to do this?

 

Thanks!

Share this post


Link to post
Share on other sites
I have a slightly different application and I am wondering if this controb can do it.

 

I want to have it so that if a customer orders 1 of an item it is $100, then it is $50 for each additional.

osC and this contribution are written in such a way that you work with a price per item. You can rewrite the PriceFormatter class to calculate in this way but you would still need to work with a price per item. Since osC uses the price per item, then calculates tax and rounds down to two decimals (the most common situation for most currencies like dollars, euros, pounds) you get rounding errors. So those functions have to be changed also to first do the calculation of base price times number of items and then calculate tax.

Share this post


Link to post
Share on other sites

Anybody here for a quick fix? I checked all the files if they were correctly placed (but i'm a php noob so I just made the adjustments as stated in the tut) and it's telling me this when i watch the categories on the admin panel (im using the dutch language):

 

1146 - Table 'arnout.products_to_discount_categories' doesn't exist

 

select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_qty_blocks, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, ptdc.discount_categories_id, dc.discount_categories_name from products p left join products_to_discount_categories ptdc on p.products_id = ptdc.products_id left join discount_categories dc using(discount_categories_id), products_description pd, products_to_categories p2c where p.products_id = pd.products_id and pd.language_id = '4' and p.products_id = p2c.products_id and p2c.categories_id = '0' order by pd.products_name

 

[TEP STOP]

 

What did I do wrong? (cause obviously it's my fault :P)

 

Edit// something with price_break.sql I read from another thread. How do I apply this? Again, I'm a total noob :P

Edited by Boxman90

Share this post


Link to post
Share on other sites
Edit// something with price_break.sql I read from another thread. How do I apply this?

You would need access to something like phpMyAdmin. There are two ways basically to apply a .sql file. Either copy and paste the "code" in a text box (don't recall how it is called on the tabs, I don't use it very often) or upload the sql file (again don't know where that is located but it must have been posted dozens of times somewhere on this forum).

 

Strange thing is that the error statement does not mention the field products_qty_blocks not being there. This QPBPP field is also introduced with the sql file. So it looks like some of the sql commands were executed but not all?

Share this post


Link to post
Share on other sites

I just installed QPBPP yesterday, 04/04/09.

 

I am able to enter a products price breaks, see the results in a preview, able to save the record, and then go back to the record to see the information, on the admin side.

 

But, when I login to the store, as a user, and try to view the product I get this error:

 

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

1146 - Table 'dpmatis_osc1.TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES' doesn't exist

 

select pd.products_name, p.products_model, p.products_image, p.products_id, p.manufacturers_id, p.products_price, p.products_weight, p.products_quantity, p.products_qty_blocks, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, ptdc.discount_categories_id from products p left join specials s on p.products_id = s.products_id left join TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES ptdc on p.products_id = ptdc.products_id, products_description pd where p.products_status = '1' and pd.products_id = p.products_id and p.products_id = '36' and pd.language_id = '1'

 

[TEP STOP]

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

 

This error occurs for every product.

 

When I go into phpMyAdmin ... the table does exist but there are no records.

 

I used phpMyAdmin to modify the MySQL structure by pasting price_break.sql into the SQL tab. Everything seemed to run fine there.

 

HELP! I would like to fix this error and be able to shop but would also like to understand what is causing this error and what role the PRODUCTS_TO DISCOUNT_CATEGORIES plays in the osC system.

 

Thanks ... Dan M

Share this post


Link to post
Share on other sites
==============================================================================

1146 - Table 'dpmatis_osc1.TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES' doesn't exist

That means that you didn't add the define for TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES to includes/database_tables.php (might be both on the catalog side and the admin side).

Share this post


Link to post
Share on other sites
That means that you didn't add the define for TABLE_PRODUCTS_TO_DISCOUNT_CATEGORIES to includes/database_tables.php (might be both on the catalog side and the admin side).

 

That was it !! You certainly know your product! Thank You ... Dan

Share this post


Link to post
Share on other sites

How do I format the pricing table?

 

Can someone tell me where the table is being formatted with the quantities and pricing for each quantity ?

 

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

 

Currently the table displays price breaks from Left to Right. I would like to display pricing from Top to bottom.

 

I see in product_info.php that here is a line of code that says ... $product_price = $pf->getPricingString();

 

When I comment out that line the entire pricing table disappears ... OK

 

So I thought the getPricingString was a class ... but I cannot locate it anywhere.

 

I see in classes there are 2 files that sound related ... PriceFormatter.php & PriceFormatterStore.php but I cannot see where the table is being formatted there either??

 

Hope someone can point me in the right direction.

Share this post


Link to post
Share on other sites
How do I format the pricing table?

 

Can someone tell me where the table is being formatted with the quantities and pricing for each quantity ?

 

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

 

Currently the table displays price breaks from Left to Right. I would like to display pricing from Top to bottom.

 

I see in product_info.php that here is a line of code that says ... $product_price = $pf->getPricingString();

 

When I comment out that line the entire pricing table disappears ... OK

 

So I thought the getPricingString was a class ... but I cannot locate it anywhere.

 

I see in classes there are 2 files that sound related ... PriceFormatter.php & PriceFormatterStore.php but I cannot see where the table is being formatted there either??

 

Hope someone can point me in the right direction.

getPriceString is a function in the class PriceFormatter.php.

 

Actually the old (now commented out) function showed the price breaks vertically. Just comment out the new function and uncomment the old function (lower).

Share this post


Link to post
Share on other sites

How do I get the correct price from the QPBPP table when the user enters a quantity in the cart?

 

Example ...

 

1 - 100.00

2 - 90

3 - 80

 

currently if I enter 3 in the cart the total calcualtes to 100.00 ( for 1pc price)

 

No matter what quantity you put in the cart the total us calculated from the unit price for 1pc pricing (NET / GROSS PRICE)

 

If sonmeone can point me in the right direction .... Thanks

 

Dan

Share this post


Link to post
Share on other sites
How do I get the correct price from the QPBPP table when the user enters a quantity in the cart?

 

Example ...

 

1 - 100.00

2 - 90

3 - 80

 

currently if I enter 3 in the cart the total calcualtes to 100.00 ( for 1pc price)

 

No matter what quantity you put in the cart the total us calculated from the unit price for 1pc pricing (NET / GROSS PRICE)

I would expect a problem with adding this contribution to your shop. Either an error adding it or you already have a contribution in there that nullifies what you are doing here or something along those lines.

Share this post


Link to post
Share on other sites

This is the 1st and only contribution I have added to osC.

 

Do you know where I would look or what file I to look in to see if I missed and addition/change?

Share this post


Link to post
Share on other sites

the only way you would know if you messed something up would be if you got an error, or if the contribution plain does not work.


A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Share this post


Link to post
Share on other sites

I have version osCommerce 2.2-MS2 and the everything seems to work except /includes/classes/ shopping_cart.php which just thows an error whether I add the code by hand or with the supplied file. I get stuff like Fatal error: Call to undefined function: calculate_price. The original file does not look like it has the same code as the supplied.... help?

Share this post


Link to post
Share on other sites

Then when I use the supplied code I get this message in the store:

 

Fatal error: Call to undefined function: calculate_price() in /includes/classes/shopping_cart.php on line 310

Share this post


Link to post
Share on other sites

Okay...I think the prob is me running PHP Version 4.4.4. Can anyone give me a shopping_cart.php file that works with PHP 4? I can't upgrade at this time as I have too many other sites to upgrade at this time if I did....

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

×