Jump to content
scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

I am new at this so please forgive my lack of knowledge.

 

I am currently using the 2.2MS2, but I do not have a catalog/inlcudes/database_tables.php file??? Therefore I can't make necessary changes.

 

Is it possible that I am missisng a modification?

 

Any help would be appreciated.

 

Thanks,

 

TC

Share this post


Link to post
Share on other sites

Just tried to install this contribute at a fresh version of OsCommerce 2.2M2, but compared to phpBB for example it seems really hard to me to get contributes of OsCommerce running. For Example the

$select_string .= '>';
isn't existing in my version. However it is the version you can reach over OsCommerce. So I am really getting disappointed...

 

Isn't there anyone who have "prepared" files for a fresh installation? Many other communites are overthing such files for those, who are new to the project. Can be fasten up adding a contribute that is so complex like this one. Anyone out there? thx

Share this post


Link to post
Share on other sites

There do seem to be a few bugs in the install instructions..but nothing too difficult to work around ;)

 

Here, Clement itemized the bugs you're talking about the best...

 

Hello everybody,

 

Here are some problems that I found into 3.5 version for different specials for each new group:

 

 

A. In the install instructions

------------------------------------

 

1. At catalog/specials.php changes:

 

Around line 80



After



   $row = 0;

   $specials_query = tep_db_query($specials_split->sql_query);

   while ($specials = tep_db_fetch_array($specials_query)) {

     $row++;



Add 



         $customer_group_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . "        where customers_id =  '" . $customer_id . "'");

         $customer_group = tep_db_fetch_array($customer_group_query);



   $row = 0;

   $specials_query = tep_db_query($specials_split->sql_query);

   while ($specials = tep_db_fetch_array($specials_query)) {

     $row++;



         $customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $specials['products_id'] . "' and customers_group_id =  '" . $customer_group['customers_group_id'] . "'");

         if ( $customer_group['customers_group_id'] != 0)

           if ($customer_group_price = tep_db_fetch_array($customer_group_price_query))

               $specials['products_price']= $customer_group_price['customers_group_price'];

 

 

I think there must be "replace" and not "add" because if I just add the seccond part of code then I've got an arror into specials.php file.

 

 

 

 

2. For catalog/includes/functions/general.php changes the instructions say that :

 

Around 200



After



   $select_string .= '>';



Add .......

 

 

But "$select_string .= '>';" is only in admin/includes/functions/general.php , so I think at this point all changes must be swiched to the admin/functions/general.php

 

 

 

A. Runing the script

------------------------------------

 

 

3. The special prices for "Resellers" - not the default group - arn't displayed from the catalog/includes/modules/new_products.php

 

 

4. If I setup a special price for "Reseller" as percent, then the special price is calculated based on the default group price not as a percent from the "reseller" price.

 

 

Thank you very much for this contribution,

 

Hope this helps, of course all thanks should be directed towards Clement. ;)

Share this post


Link to post
Share on other sites

Hey all,

 

I've been working with this contribution (which is awesome, let me say first thing), for a day or so and I've found a few, I'm hesitant to say "bugs", hey they could be features ;), but nevertheless they seem odd.

 

The main thing is, it seems that if Retail doesn't have a customers_group_id of 0, then there are discrepancies in prices between surfers browsing the site and people logged in as "Retail". Changing a customers_group_id number is simple... Let's say you have two customers, one Retail and one Reseller. Now go and change the Retail customer's group to "Temp Group". Notice that the "Retail" group has been dropped all together. If you add Retail back, since the customers_group_id number is generated by the database dynamically, it will never be 0 again. So in order to fix the problem, you have to do it manually through the database. Not a problem for me, but I imagine that my clients won't be able to figure this out, and knowing the nature of clients, it's inevitable that they will find this problem in no time. ;)

 

Another little problem is that if you edit a "Special" not add, but edit, it doesn't allow you to choose a new group for that special. This was relatively easy to fix, and if anyone wants the fix, I'll give it to them.

 

Anyway, I'm wondering if anyone else has run into these problems and if anyone has found a way around them. I'm currently designing a way to fix the first problem I mentioned, and I think that the best way would be a seperate "Group Editor" added to the list of tools on the Admin side. I'll post it, when I finish it, but in the mean time I'd like to get some feedback on the issues I mentioned.

 

Maybe it's just me ;) That's usually a feasible option...hehe

 

insectis

Share this post


Link to post
Share on other sites

i am having the same problem as tiffanycox. i do not have the catalog/inlcudes/database_tables.php file does any one have an idea why. or can some one please send me this file. i am also missing the same file but located under admin


Biscochitos almost as good as grandma

Share this post


Link to post
Share on other sites

Hello group,

 

Using 2.2-ms2

S.P.P.C v3.5

 

Did the install as best I could, hit the button to go to Customers, got this message in customers.php

 

" Parse error: parse error in /home/someuser/public_html/catalog/admin/customers.php on line 229 "

 

 

Went and looked at the file in PHP expert (not me, the program) and got the error

 

" Parse error: parse error, unexpected T_CASE in customers.php on line 229 "

 

 

 

Here is the code for that area ----- line 229 is numbered as such

 

tep_db_perform(TABLE_ADDRESS_BOOK, $sql_data_array, 'update', "customers_id = '" . (int)$customers_id . "' and address_book_id = '" . (int)$default_address_id . "'");

 

tep_redirect(tep_href_link(FILENAME_CUSTOMERS, tep_get_all_get_params(array('cID', 'action')) . 'cID=' . $customers_id));

 

} else if ($error == true) {

$cInfo = new objectInfo($HTTP_POST_VARS);

$processed = true;

}

 

break;

229 case 'deleteconfirm':

$customers_id = tep_db_prepare_input($HTTP_GET_VARS['cID']);

 

if (isset($HTTP_POST_VARS['delete_reviews']) && ($HTTP_POST_VARS['delete_reviews'] == 'on')) {

$reviews_query = tep_db_query("select reviews_id from " . TABLE_REVIEWS . " where customers_id = '" . (int)$customers_id . "'");

 

 

 

Would appreciate assistance to let me know how to fix this sucker, I am NOT PHP literate, so any help would be greatly appreciated.

 

Respects for the time taken to look

 

admin-monkey

 

 

__________________________________________________

No monkeys were harmed in this admission of ignorance

Share this post


Link to post
Share on other sites

Hi ... i installed the seperate....pric..v3.5 ... and it works...but just one problem.. on the main page the NEW Products show the "reseller Price" if i logged and got configured as reseller ... thats right. and the prices works in invioce and shipping module, too ... but just in the categories itself only shown the "normal customer prices" ....

 

....if i click the seperate categories i only see the normal prices ...not the "reseller" ...if i click on the product details ...the price is reseller again...

 

someone an idea ? i installed it now several times...nothing changed....

 

please help

Share this post


Link to post
Share on other sites

Hi ... i installed the seperate....pric..v3.5 ... and it works...but just one problem.. on the main page the NEW Products show the "reseller Price" if i logged and got configured as reseller ... thats right. and the prices works in invioce and shipping module, too ... but just in the categories itself only shown the "normal customer prices" ....

 

....if i click the seperate categories i only see the normal prices ...not the "reseller" ...if i click on the product details ...the price is reseller again...

 

someone an idea ? i installed it now several times...nothing changed....

 

please help

Share this post


Link to post
Share on other sites

First of all: GREAT GREAT GREAT - Very usefull!

 

My Basics:

 

Version:

- osC 2.2 MS2

 

Contributions:

- Separate_Pricing_Per_Customer_v3.5

(PriceModInstall_v3.5.txt 08/03/2003)

- quick_stockupdate

 

Settings:

TABLE_CUSTOMERS

customersgroup_name Default Standard

 

Groups

- Standard

- Retail

- Friends

 

All groups have different prices for the products:

T-Shirt (no group) 25.00

T-Shirt for Standard 25.00

T-Shirt for Friends 17.24

T-Shirt for Retail 14.10

 

This Contribution works fine so long. But there is one Problem that I can't figure out why or where.

 

I want give different specials for the three groups concerning the same product:

T-Shirt for Standard 25.00

T-Shirt for Friends 16.00

T-Shirt for Retail 12.00

 

Every Group or anybody (no group) has their correct price but

in the Categories product-listing I can see the same product (always with the correct price) as often as I made specials for that product (but for the different groups).

 

Looks like (for "Friends"):

 

T-Shirt M Longsleeves K03M-2 ?25,00 - (no special)

T-Shirt M Sleeveless K03M-4 ?20,00 ?18,56 - (special)

T-Shirt M Sleeveless K03M-4 ?20,00 ?18,56 - (special)

T-Shirt M Sleeveless K03M-4 ?20,00 ?18,56 - (special)

 

I wonder if this caused in the

catalog/includes/modules/product_listing.php (around line 78):

 

  if ($listing_split->number_of_rows > 0) {

   $rows = 0;

   $listing_query = tep_db_query($listing_split->sql_query);

   while ($listing = tep_db_fetch_array($listing_query)) {

     $rows++;

     // contr: start separate_pricing_per_customer

     $listing['specials_new_products_price']=tep_get_products_special_price($listing['products_id']);

     // contr: end separate_pricing_per_customer



     if (($rows/2) == floor($rows/2)) {

       $list_box_contents[] = array('params' => 'class="productListing-even"');

     } else {

       $list_box_contents[] = array('params' => 'class="productListing-odd"');

     }

 

or around line 110

 

            break;

         case 'PRODUCT_LIST_PRICE':

           $lc_align = 'right';

           // contr: start separate_pricing_per_customer

           $customer_group_query = tep_db_query("select customers_group_id from " . TABLE_CUSTOMERS . " where customers_id =  '" . $customer_id . "'");

           $customer_group = tep_db_fetch_array($customer_group_query);

           $customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $listing['products_id'] . "' and customers_group_id =  '" . $customer_group['customers_group_id'] . "'");

           if ( $customer_group['customers_group_id'] != 0) {

             if ($customer_group_price = tep_db_fetch_array($customer_group_price_query)) {

               $listing['products_price'] = $customer_group_price['customers_group_price'];

             }

           }

           // contr: end separate_pricing_per_customer

           if (tep_not_null($listing['specials_new_products_price'])) {

             $lc_text = ' <s>' .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</s>  <span class="productSpecialPrice">' . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . '</span> ';

           } else {

             $lc_text = ' ' . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ' ';

           }

           break;

         case 'PRODUCT_LIST_QUANTITY':

 

Any help is appreciated

Thank you in advance

Haegar

Share this post


Link to post
Share on other sites
tiffanycox

Tiffany cox:

am new at this so please forgive my lack of knowledge.

 

I am currently using the 2.2MS2, but I do not have a catalog/inlcudes/database_tables.php file??? Therefore I can't make necessary changes.

 

Is it possible that I am missing a modification?

 

Any help would be appreciated.

 

Thanks,

 

TC

 

Ok so I was having the same problem and I could not figure out issue at all. But for the past few days I have been looking into the problem. It looks like our version of oscommerce "2.2ms2" has some changes.

First change:

 

database_tables.php does not exist they moved the list of tables to the catalog/includes/application_top.php

 

Ok the next thing that was changes is the products_new.php. What they did was move some of the functions so that it can be used by other files but I am not sure about that yet. So to make the changes is catalog/includes/modules/products_new.php there you will find the line

 

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

I found it on line 26

 

Ok on the last change is the same as the catalog side but it is for the admin side same location

 

admin/includes/application_top.php

 

This is where you make the change

admin/includes/database_tables.php

 

Around line 57

 

After:

 

define('TABLE_WHOS_ONLINE', 'whos_online');

define('TABLE_ZONES', 'zones');

 

Add:

 

define('TABLE_PRODUCTS_GROUPS', 'products_groups');

 

 

That is it I hope this helps you out and other people as well :D


Biscochitos almost as good as grandma

Share this post


Link to post
Share on other sites

I have being looking around and I haven't found an answer.

 

Well.. I have a client who deals with both retailers and resellers. The problem with that is that I don't know exactly how to do this to set up different prices for each individual accounts. I have the MS2 version and I have tried to install the Separate Pricing Version 3.5 and it actually gave me lots of errors. I even fallow the advice that there were some errors made by the maker of this contribution and change the mistakes, but I was still having errors.

 

I actually haven't seen a website running anything like that yet... Does anyone have Separate Pricing Running with no problems? Any links to see how they work?

 

Is it possible to have a finished contribution to make it work?

 

Thanks, any help is appreciated.

Share this post


Link to post
Share on other sites

Hi,

 

so i am nearly total capitulation. I am using OSCommerce 2.2 MS2 and the 3.5 version of this contribute. I am not interesting currently in the special modification. I've tried several times to install the contribute, but always there is one error in the admin-panel. If i am using the adminpanel for customers and try to update a new group, I get the following error:

Warning: Supplied argument is not a valid MySQL result resource in /var/www/hitco/catalog/admin/includes/functions/database.php on line 99

 

Any idea why? I made it three times and always this mistake...

Share this post


Link to post
Share on other sites

My guess would be that somewhere in the install of the contribution, you didn't copy something, or you overwrote something that needed to stay in the code. Hopefully you backed up your work and you have the time to go through systematically and check the install directions against your actual install.

 

Line 99 in admin/includes/functions/database.php is just a return function for a mysql call, so if it's erroring out, that means that it didn't get data that it could work with.

 

hth,

 

insectis

Share this post


Link to post
Share on other sites

No! That isn't it! I just found it out... I made everything absolute correct, but... like said, I have a clean installation, so only the sample data is in the db. If you try to ad the sample customer to a new group, the error happens. If you create a new user account, there is not problem at all! I really got mad to search for a bug ... but this problem happens if you make it 1:1 to the install. Think there is somewhere a wrong query with the sample (first?) customer?

 

Now, it seems to work. The product overview shows up the "normal" price, not group price. At the product_info itself everything is okay. But tomorrow I will have a look at the bugfix in the thread here, maybe there is already a solution. But keep the problem above in mind...

Share this post


Link to post
Share on other sites

There is a problem I ran into when switching groups around. I never had the exact problem you mentioned, but I had some logic errors. So, I ended up completely reprogramming the group portion and some of the other stuff in the contribution... ;)

Share this post


Link to post
Share on other sites

Hey people,

 

Well, I installed this contribution once again and I have gotten an error... Well I am not sure if it is an error. I finish the installation up to where the install says "special prices". I don't know if I should continue after that and install the entire contribution..

 

The problem is that when I choose costumers in the administration tools, I don't see a page at all. Can anyone help me wit that? Is there something I could do?

 

Am I missing some code or something in the phpadmin that I neglected to put? Please help!

 

Thanks in advance,

 

Dark

:ph34r:

Share this post


Link to post
Share on other sites

I found this error in the begining of my website...

 

It is in the NEW Products for September:

 

1054 - Unknown column 'customers_group_id' in 'where clause'

select specials_new_products_price from specials where products_id = '40' and customers_group_id = '' and status <> '0'

 

Can anyone tell me why it has that?

Share this post


Link to post
Share on other sites

Is anyone here?

 

Could anyone help me with my problem?

 

I would like to add the second part of this contribution to the sql, but I don't know how.

 

I have being going at this for a while... please help!!!

Share this post


Link to post
Share on other sites

Get PhpMyAdmin first off if you don't already have it.

 

Next add 'customers_group_id' & 'customers_group_name' to the customers table as per the instructions.

 

That should do it.

Share this post


Link to post
Share on other sites

Thanks for the reply, I got the part of that code figured out.

 

But I am still having trouble with something regarding the administration side of the website.

 

Well, I want to see the contribution but when I log into my website in the admin side... There is nothing... I see a blank screen.

 

I don't know exactly what is wrong here, but I would like to know. I have double check the admin files that need to be updated or changed.. .But everything is edited the way is suppost to.

 

Anyone have an idea why it shows a blank page? Can't see ANYTHING AT ALL!

 

Thanks,

 

Dark

Share this post


Link to post
Share on other sites

I've installed seperate price per customer mod v3.5 and easy populate v2.61 to OSC ms2.2.

 

They work fine except when I download the database usinf this easy populate mode, I just didn't see any column field that says or belonged to seperate price per customer in my downloaded database to modify.

 

I opened with excel.

 

What should I do to make the column of seperate price per customer to showed up whe I download my database using easy populate?

 

Please someone be kind to help me!

 

Thank you.

KelantanPro

Share this post


Link to post
Share on other sites

Has anyone had a problem installing the admin/costumers.php file and having the file to show up blank in your administration side of the cart? Does anyone know how to solve that problem? Why does it show that way?

Share this post


Link to post
Share on other sites
Hello,

I inserted all code as described, and I get various Prices for e?very gruop.

If I then go and buy, the Prices are changed to the original price.

I guess that any customer will become quite angry if I do not maintain the actual prices.

 

As well the product price is changed but in the new_product the price is not displayed correct

 

Please let me know how to handle

 

Thanks very much

Thomas

Please verify that you made all of the specified changes to the 'catalog/includes/classes/order.php' file? This is the part of the code that handles the correct pricing for checkout.

 

-Scott

Share this post


Link to post
Share on other sites
ok so i took a deeper look at the file under the file

catalog/products_new.php

and i still can not find the bit of code. This is what i am looking at maybe you can point out the bit of code that needs to be replaced

 

<?php

/*

$Id: products_new.php,v 1.24 2003/02/13 04:23:23 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright ? 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCTS_NEW);

 

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_PRODUCTS_NEW));

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">

<title><?php echo TITLE; ?></title>

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

<link rel="stylesheet" type="text/css" href="stylesheet.css">

</head>

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">

<!-- header //-->

<?php require(DIR_WS_INCLUDES . 'header.php'); ?>

<!-- header_eof //-->

 

<!-- body //-->

<table border="0" width="100%" cellspacing="3" cellpadding="3">

<tr>

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- left_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>

<!-- left_navigation_eof //-->

</table></td>

<!-- body_text //-->

<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td><table border="0" width="100%" cellspacing="0" cellpadding="0">

<tr>

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_products_new.gif', HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

</table></td>

</tr>

<tr>

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

</tr>

<tr>

<td>

<?php

$products_new_query_raw = "select p.products_id, pd.products_name, p.products_image, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, p.products_date_added, m.manufacturers_name from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' order by p.products_date_added DESC, pd.products_name";

 

$products_new_split = new splitPageResults($HTTP_GET_VARS['page'], MAX_DISPLAY_PRODUCTS_NEW, $products_new_query_raw, $products_new_numrows);

 

$products_new_query = tep_db_query($products_new_query_raw);

while ($products_new = tep_db_fetch_array($products_new_query)) {

$products_new_array[] = array('id' => $products_new['products_id'],

'name' => $products_new['products_name'],

'image' => $products_new['products_image'],

'price' => $products_new['products_price'],

'specials_price' => $products_new['specials_new_products_price'],

'tax_class_id' => $products_new['products_tax_class_id'],

'date_added' => tep_date_long($products_new['products_date_added']),

'manufacturer' => $products_new['manufacturers_name']);

}

 

require(DIR_WS_MODULES . 'products_new.php');

?>

</td>

</tr>

<?php

if (($products_new_numrows > 0) && ((PREV_NEXT_BAR_LOCATION == '2') || (PREV_NEXT_BAR_LOCATION == '3'))) {

?>

<tr>

<td><br><table border="0" width="100%" cellspacing="0" cellpadding="2">

<tr>

<td class="smallText"><?php echo $products_new_split->display_count($products_new_numrows, MAX_DISPLAY_PRODUCTS_NEW, $HTTP_GET_VARS['page'], TEXT_DISPLAY_NUMBER_OF_PRODUCTS_NEW); ?></td>

<td align="right" class="smallText"><?php echo TEXT_RESULT_PAGE; ?> <?php echo $products_new_split->display_links($products_new_numrows, MAX_DISPLAY_PRODUCTS_NEW, MAX_DISPLAY_PAGE_LINKS, $HTTP_GET_VARS['page'], tep_get_all_get_params(array('page', 'info', 'x', 'y'))); ?></td>

</tr>

</table></td>

</tr>

<?php

}

?>

</table></td>

<!-- body_text_eof //-->

<td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">

<!-- right_navigation //-->

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>

<!-- right_navigation_eof //-->

</table></td>

</tr>

</table>

<!-- body_eof //-->

 

<!-- footer //-->

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?>

<!-- footer_eof //-->

<br>

</body>

</html>

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

 

 

 

last thing I have downloaded the whole oscommerce and I still can not find the database_tables.php file maybe you can give me better instructions on how to find the file

The version of products_new.php that this mod was written for is

 

$Id: products_new.php,v 1.27 2003/06/09 22:35:33 hpdl Exp $

 

Perhaps that is your problem? Are you starting from a very fresh install?

 

-Scott

Share this post


Link to post
Share on other sites
i am having the same problem as tiffanycox. i do not have the catalog/inlcudes/database_tables.php file does any one have an idea why. or can some one please send me this file. i am also missing the same file but located under admin

All, please note that the release this module update was built on is: osCommerce 2.2 Milestone 2 (07/12/2003). Anything before that and you may have the wrong file set to install upon.

 

-Scott

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

×