PDA

View Full Version : Price Break Integration



ganast
12-20-2004, 09:48 AM
I hope this is kosher to post here:

I need to integrate the price-break-1.11.2 module:

http://www.oscommerce.com/community/contributions,1242

At issue is the already embedded (oscMAX 1.7) Price Per Customer Module:

http://www.oscommerce.com/community/contributions,716

Either I need to remove the PPC module... which I really don't want to do, or I need to change the Price Break module to recognize the PPC discounts. In order to do this, some PPC code needs to be reworked, and provision made for it in the PriceFormatter.php class. The files that are affected are:

catalog/includes/classes/shoppingcart.php
catalog/includes/modules/product_listing.php
catalog/product_info.php

...and the PriceFormatter.php class from the Price Break module needs to have some code added to accomodate PPC discounts.

I think that one of the original authors or someone familiar with the code could do this without too much study of the code... I on the other hand would find it difficult at best.

--gabe

PS: whatever comes of this, I will post the code back to the forum so that it can be integrated in 1.7 if that is wanted.

ganast
12-20-2004, 10:22 AM
Actually it appears that the following code just needs to be integrated into the PriceFormatter.php class...

--gabe


global $customer_id;
$customer_group_id_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id = '". $customer_id . "'");
$customer_group_id = tep_db_fetch_array($customer_group_id_query);
$orders_customers_price = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '". $customer_group_id['customers_group_id'] . "' and products_id = '" . $products['products_id'] . "'");
if (($orders_customers = tep_db_fetch_array($orders_customers_price)) && ($customer_group_id['customers_group_id'] != 0)) {
$products_price = $orders_customers['customers_group_price'];
}

ganast
12-20-2004, 08:19 PM
Well, I have it almost done as an either/or deal... if you have a customer specific price, you get that, otherwise you get the tiered discount. Pretty lame implementation, but its all I need for this particular shop. I'll post the how-to file once I have finished it up, and tested it a bit.

--gabe

PS: still looking for someone who might do a nice integration using the PriceFormatter.php class.

ganast
12-22-2004, 01:47 PM
I personally would wait until Master/Slave is done, and use that, however, if you need this now (like I did), I have hacked the Price Break mod into oscMAX 1.7

Small caveat: it does not do lowest price comparrison with per customer pricing. Either the customer has per customer price breaks and does not get quantity price breaks, or the customer has no per customer price breaks and gets quantity breaks.

Larger caveat: I have not done extensive testing.

The attached files should drop in on top of an unmodified oscMAX1.7 (you have to change the file names and copy them to the proper directories)

--gabe

PS: the original contrib for MS2.2 can be seen here:
http://www.oscommerce.com/community/contributions,1242