Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

However, the way it is working now.. everyone signs up and the admin would have to go through each record to see who filled in the dealer (TAX ID) field to give them access. How can something be done so that that field is tagged and only those records would wait in a que for approval?
Obviously, you haven't tried this. That has all been taken care of.
Link to comment
Share on other sites

Obviously, you haven't tried this. That has all been taken care of.

 

Well I did make a user... could you tell me what exactly is supposed to happen and where and what I should see? (It Suxs being a newbie as we all just want to get to expert :) ).

 

Also, I am looking for an admin panel will I can give access to someone to update the cart and give access to people wanting dealer pricing. What can I use?

 

Thanks

Link to comment
Share on other sites

could you tell me what exactly is supposed to happen and where and what I should see?
The default behaviour is that when something is entered in the tax id field:

a. an email is sent to the shop owner

b. a field called RA is set to on/alert and that will be immediately visible in the admin/customers.php page since a red dot will be in that column in the row with that customer

c. the default sort order of customers is: new customers first

d. the customers list can be sorted on the RA field so that you they can get them to the top of the list.

 

The next thing the admin is supposed is to do is EDIT the customers with the alert (RA) raised, put them in another group (default is retail) if need be and switch off the alert.

Link to comment
Share on other sites

The default behaviour is that when something is entered in the tax id field:

a. an email is sent to the shop owner

b. a field called RA is set to on/alert and that will be immediately visible in the admin/customers.php page since a red dot will be in that column in the row with that customer

c. the default sort order of customers is: new customers first

d. the customers list can be sorted on the RA field so that you they can get them to the top of the list.

 

The next thing the admin is supposed is to do is EDIT the customers with the alert (RA) raised, put them in another group (default is retail) if need be and switch off the alert.

 

Thanks! That was very detailed and helpful. I was wondering what the red RA flag was. :)

 

My last outstanding issue is what do I do with over 150+ products and I have two prices that I want to import? I haven't installed any import mod yet.... Not sure what to do because of the dealer price.. Suggestions?

 

Thanks!

Link to comment
Share on other sites

A new version of Separate Price Per Customer has been released :D

 

From the Contributions Section ;

 

This is version 4.1 of Separate Price Per Customer. It includes all of 4.0's functionality plus the ability to enable or disable Shipping & Payment modules on a per group or individual customer level.

 

In addition, all reported bug-fixes have been addressed in this release.

 

This release also includes an HTML overview of the contribution in action with extensive pictures. This is helpful for pre-installation evaluation and also doubles as an instruction manual. This overview can also be viewed Here.

 

Included are files and instructions for a new installation as well as an easy to follow upgrade path for existing 4.0 users.

 

This is the preferred contribution to use - all others should be considered superceded.

 

Thanks go out to JanZ for adding powerful new features and also for de-bugging the minor issues that have cropped up :thumbsup:

 

Btw, because the file size is now a little over the 300k limit (mainly due to the new docs) the contribution will require osC approval before being posted. I suspect it will be available in the Contributions section shortly.

Edited by Marvin Miller

Best & Thanks;
Marvin
----------------------
osCommerce 2.3.3.4 

Link to comment
Share on other sites

A new version of Separate Price Per Customer has been released  :D

 

From the Contributions Section ;

Thanks go out to JanZ for adding powerful new features and also for de-bugging the minor issues that have cropped up  :thumbsup:

 

Btw, because the file size is now a little over the 300k limit (mainly due to the new docs) the contribution will require osC approval before being posted. I suspect it will be available in the Contributions section shortly.

 

Great! If I justed added 4.0 yesterday and I don't have a heavy mod osc, what would be the process to upgrade to 4.1? Can I rerun the sql script? Or do I have to manually edit? Is there a upgrade list from 4.0 to 4.1?

 

Thanks!

Link to comment
Share on other sites

Hi guys;

 

As mentioned in the original post, 4.1 has been released but there is a size limitation on contribs of around 300K Anything more requires manual approval by the osC staff. So, as soon as they approve it - you'll see it in the contributions section.

 

Also as mentioned :-" , there is an easy upgrade path for existing 4.0 users :thumbsup: If you wanted to manually edit and update it's only 8 files and run one SQL script.

 

On the other hand, if your site is bone stock with only 4.0 then you could just copy the files from the upgrade folder and upload them to your site. After that, all you would have to do is run the SQL upgrade script.

 

So it's pretty painless to go from 4.0 -> 4.1 no matter how you slice it. Complete docs are included. I would suspect that by tomorrow the osC staff will have it up.

 

In the meantime if you check out the link I included in the original post you can see how the contrib works and what the new features are :D

Edited by Marvin Miller

Best & Thanks;
Marvin
----------------------
osCommerce 2.3.3.4 

Link to comment
Share on other sites

So it's pretty painless to go from 4.0 -> 4.1 no matter how you slice it. Complete docs are included. I would suspect that by tomorrow the osC staff will have it up.

 

Congratulation guys, very good work.... :thumbsup:

 

 

Jeep

John

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

osCommerce 2.3.4 Bootstrap Edge

Link to comment
Share on other sites

Hello,

 

I have installed this very good contribution ant I have two questions :

 

* I don't understand this function : "Switch off alert for authentication" in the admin part in each customer account.

 

*Is there a contribution whose can hide products for a groups ???

Link to comment
Share on other sites

I don't understand this function : "Switch off alert for authentication" in the admin part in each customer account.
If a new account has been made and the tax id field has something in it (or an existing account has added something in that field) an alert will be raised in the admin/customers.php page where a red light will be shown in the row with that customer. See an example on a temporary site Marvin has made. Obviously, when you have seen that and acted on it you will want to switch the red light off. That is the function "Switch off alert for authentication".
Is there a contribution whose can hide products for a groups ???
No, at least not yet. Someone made something like that for TotalB2B that in principle is applicable for SPPC4 too (search for "Hide Price for customers groups" in the contribution section).
Link to comment
Share on other sites

Wondered if you could make it possible (shouldnt be too hard for an expert programmer like yourself) so that I could enter a customer groups price (in categories.php ) in a deduction percentage instead of a price, just like used in specials.php (so it should be possible, most probably something like this:

if (substr($specials_price, -1) == '%') $specials_price = ($products_price - (($specials_price / 100) * $products_price));

just cant find out which var's to use.

 

Thanks a lot in advance, would be a great help, as at the company I work for (traineeship) they use deduction percentages rather than seperate prices on products for different groups of customers, and not just in specials but on default prices as well.

Edited by Eelcovdg
Link to comment
Share on other sites

Eelco,

Wondered if you could make it possible (shouldnt be too hard for an expert programmer like yourself)
Yes, that is possible, no it isn't that hard, no I'm not an expert programmer, purely an amateur.

 

The specials code can be applied yes, but that code first does a query for the products price and goes on, here it has to work on the http_post_variable. No problem really. This worked for me (admin/categories.php: approximately line 248-285, look for the "BOF percent hack", has to added twice, once for the update and once for the insert query).

 

I guess you could do this with some JavaScript also, once you know your customer groups and fixed discount (like the price including BTW/VAT/Sales tax is dynamically updated...).

 

  // BOF Separate Pricing Per Customer
$customers_group_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " where customers_group_id != '0' order by customers_group_id");
while ($customers_group = tep_db_fetch_array($customers_group_query)) // Gets all of the customers groups
 {
 $attributes_query = tep_db_query("select customers_group_id, customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where ((products_id = '" . $products_id . "') && (customers_group_id = " . $customers_group['customers_group_id'] . ")) order by customers_group_id");
 $attributes = tep_db_fetch_array($attributes_query);
 if (tep_db_num_rows($attributes_query) > 0) {
   if ($HTTP_POST_VARS['sppcoption'][$customers_group['customers_group_id']]) { // this is checking if the check box is checked
     if ( ($HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']] <> $attributes['customers_group_price']) && ($attributes['customers_group_id'] == $customers_group['customers_group_id']) ) {
      // BOF percent hack
      if (substr($HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']], -1) == '%' && isset($HTTP_POST_VARS['products_price'])) {
       $HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']] = ( $HTTP_POST_VARS['products_price'] - (((int)$HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']] / 100) * $HTTP_POST_VARS['products_price']));
      }
      // EOF percent hack
    tep_db_query("update " . TABLE_PRODUCTS_GROUPS . " set customers_group_price = '" . $HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']] . "' where customers_group_id = '" . $attributes['customers_group_id'] . "' and products_id = '" . $products_id . "'");
       $attributes = tep_db_fetch_array($attributes_query);
     } 
     elseif (($HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']] == $attributes['customers_group_price'])) {
    $attributes = tep_db_fetch_array($attributes_query);
     }
   } 
   else {
     tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '" . $customers_group['customers_group_id'] . "' and products_id = '" . $products_id . "'");
     $attributes = tep_db_fetch_array($attributes_query);
   }
 } 
 elseif (($HTTP_POST_VARS['sppcoption'][$customers_group['customers_group_id']]) && ($HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']] != '')) {
      // BOF percent hack
      if (substr($HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']], -1) == '%' && isset($HTTP_POST_VARS['products_price'])) {
       $HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']] = ( $HTTP_POST_VARS['products_price'] - (((int)$HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']] / 100) * $HTTP_POST_VARS['products_price']));
      }
      // EOF percent hack
   tep_db_query("insert into " . TABLE_PRODUCTS_GROUPS . " (products_id, customers_group_id, customers_group_price) values ('" . $products_id . "', '" . $customers_group['customers_group_id'] . "', '" . $HTTP_POST_VARS['sppcprice'][$customers_group['customers_group_id']] . "')");
   $attributes = tep_db_fetch_array($attributes_query);
 }
 
}
 // EOF Separate Pricing Per Customer

Link to comment
Share on other sites

Hi. I just installed this mod and love it! The only thing is that on product_info.php the old retail prices show when I am logged in as wholesale. From what I can tell this is the only place it is happening. I reinstalled, but same problem. i must be missing something. Thanks for the wonderful contribution!

Jen

Link to comment
Share on other sites

Okay. It is fixed. I feel silly :blush:

 

Added

 

$product_check = tep_db_fetch_array($product_check_query);

   // BOF Separate Price per Customer
   if(!tep_session_is_registered('sppc_customer_group_id')) { 
   $customer_group_id = '0';
   } else {
    $customer_group_id = $sppc_customer_group_id;
   }
 // EOF Separate Price per Customer
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

Jen

Link to comment
Share on other sites

Okay.  It is fixed.  I feel silly  :blush:

 

That's OK, it's a fairly big contrib to install so the possibility of errors is magnified by the size.

 

That's why in the docs I recommended checking the file over whenever an error is found. Even when testing the docs (by doing a manual install) I usually find that I have made three or four mistakes that require me to re-check my mods.

 

It's easier if you use a Compare & Merge utility. They will highlight every different line of code so that it's nearly impossible to miss. They also make installation WAY faster. :lol:

 

Did you install the 4.0 version or 4.1?

Best & Thanks;
Marvin
----------------------
osCommerce 2.3.3.4 

Link to comment
Share on other sites

It's what I'm trying to do ...

 

But I don't understand why there are two tables for the price :

 

*products_group_prices_cg1

*products_groups

 

The good prices are in the second but in index.php the first table is called ...

Can you explain me please ???

Link to comment
Share on other sites

The table products_group_prices_cg1 is updated by the code and contains the customers groups price and special prices for customer group 1. If there is no customer group price for a certain article, it will contain the products price. This table is used for and was needed to get accurate sorting by price in the product_listing module (used on the index page and for the search results).

 

Because it cannot be assumed that for every product there is a price in the products_groups table, you cannot combine/join the tables in the regular way together with the table specials to get all the correct prices. If there is no price in the products_groups table, you will never get the price from the tables specials if there is one. Therefore the use of these tables.

 

The shopping cart uses the prices from the products_groups table, so even if something goes wrong with the updating of these _cg# tables, your customer still sees and gets the correct price even if the sorting might be a bit off.

 

If you find it is too much work to get this modification to work properly I might be able to do it. At the moment I'm doing my best to write-up the install for the price break modification. I want to finish that before starting something new ;)

Link to comment
Share on other sites

Ok thanks for your good explication !!!

I will try to make something but I think that if you do this contribution it will be better than me !

 

Can you say me if you do that one day ???

Edited by goutbouyo
Link to comment
Share on other sites

Does this allow for seperate Whole sale and Retail prices? How does it work exactly, when someone signs up, are they set as a Retailer until the Admin adds them to the Wholesaler group?

 

Is it easy to add prices for the different groups? Is it within the product page or do you have to add the seperate prices in it's own page separate from the product information (similar to how you have to go to a special section to modify the options of the product)

Link to comment
Share on other sites

Caroline,

 

If you have a test system (if you haven't you should ;) ) you could start with doing the modification to the table (product_hide_groups from the top of my head), add something to it with phpMyAdmin on some article (say have "@,1") in that field for one article and see if you can get it working by changing an sql query as in the contribution. You don't need all the queries for the customer_group_id, that is already available to the code.

 

If that works, try a few more or do all the ones necessary (as explained in the contribution). In that case I can do the admin part probably quicker than you can. If that all works and you tested it I hope you can write the install instructions and upload it ;)

Link to comment
Share on other sites

Does this allow for seperate Whole sale and Retail prices? How does it work exactly, when someone signs up, are they set as a Retailer until the Admin adds them to the Wholesaler group?

 

Is it easy to add prices for the different groups? Is it within the product page or do you have to add the seperate prices in it's own page separate from the product information (similar to how you have to go to a special section to modify the options of the product)

Please see the last post on the previous page. Download it and read what it does, solves and how it looks in the admin section.
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...