Jump to content
Latest News: (loading..)
scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

All, I uploaded a new version of Seperate Pricing Per Customer.

Some bug fixes I found when installing on my new copy of 2.2MS2 and a MAJOR OPTIONAL improvement -- I needed the functionality of having special prices for each group.

 

I think all the code is good -- I have spent the day testing. If you find something doesn't work on your install, or perhaps I missed something, let me know. (email: scott AT everson D0T ws)

 

Here are the notes:

 

Updated by Scott Everson (scott AT everson DOT ws), 08/02/2003

 

Bug fixes:

 

-Added in mod to products_new.php (so correct price displayed in new products list)

-Adjusted location of mod in modules/product_listing.php

-Changed $product_info_values[] to $product_info[] in product_info.php mod. My 2.2MS2 used the $product_info[] array.

 

Improvements:

 

-Added option mod to support special prices per group. This means that you can create a special price for your 'Retail' group and only customers in that group will see the special price. Create a special price for your 'Wholesale' group and only customers in that group will see the special price. Special prices will not default.. meaning if there is no special price for 'Wholesale' but there is one for 'Retail' your wholesale customer will NOT BE SHOWN the retail special price.

 

More info: When you add special prices, you will see the prices for each group next to the product title. It a price/group is missing, it is because a special price for that prodcut/group already exists. If the product is missing, it is because there is already a special price for all groups.

 

I am willing to offer support for this MOD and version 2.2MS2.

Share this post


Link to post
Share on other sites

EasyPopulate supported this in it's MS1 version, can you download ep and check that it still has the correct fields etc?

 

Email any changes that need to be made to dc@loxly.com or post them here, I'll keep an eye on this thread. Unless the miserable people jump over here too.

 

Debbie

*Positive energy works much better than negative*


[no external urls in signatures please, kthanks]

Share this post


Link to post
Share on other sites

This Mod looks like it is perfect for my need - I will install it tongiht and see how I go.

 

I was wondering if it were possible (either through further development or an additional addon) that the available products could change from customer to customer.

 

Say you have a specific customer (or no group of customers) that you have specific pricing for. The login with their details and then they see all their specific pricing is displayed. Would it be difficult to limit (or expand) a range depending on their login??

 

So not only do they get specific pricing they would get a specific (and tailored) product range? This (to me) seems like it could be a natural progression although I know it is probably complicated! Has anything looked into this? Do you think it would be hard to modify this Contrib. further for this to work?

 

Basically I don't want to offer my entire range to all customers. If i tailor the price as well as the offered range for each customer that would be ideal!!!

 

I hope this is possible :-)

 

Looking forward to getting this mod installed tonight.

 

Thanks

Share this post


Link to post
Share on other sites
Basically I don't want to offer my entire range to all customers. If i tailor the price as well as the offered range for each customer that would be ideal!!!

 

Fiscus, I think that is a great idea and I think this mod CAN do the trick. I will play with it later this week and let you know. Perhaps setting the price to be -1 or something would make it not available to the group. I will let you know what I come up with.

 

-Scott

Share this post


Link to post
Share on other sites

Scott,

 

This would really be brilliant!!

 

I offer certain ranges to specifc customers at specifc prices (alternitevly the general publix just get the normal range and normal prices). To be able to offer people diff ranges and diff prices would be perfect.

 

While I am still working on my PHP and MySQL skills, I can imagine that this would be a perfect mod to try and intergrate it into.

 

While I haven't installed this current MOD atm - I imagine that there could simply be a matrix of check boxes where you can select the products that a spefic customer or group can purchase. The prices could also be intergrated this way.

 

I will install your mod to see how you currently have things setup...

 

I will be looking forward to seeing how you go!

 

Can't wait.

 

Keep up the good work!

Share this post


Link to post
Share on other sites

I am not very good with the SQL codes, and I was wondering if you could please write out how to add -

 

Database Changes:



Add to the customers table:

customers_group_name (char 27) Default value: Retail

customers_group_id (int 11) Default value: 0



Create

products_groups table



Add to the products_groups table:

customers_group_id (int 11)

customers_group_price (decimal 15, 4)

products_id (int 11)

products_price (decimal 15,4)

 

Thank you very much, I'm excited to try this out on my version of MS2.

 

Thanks again,


Adam de Merlis

Share this post


Link to post
Share on other sites

Adam,

Insert the following using phpMyAdmin and you should be right.

ALTER TABLE `customers` ADD `customers_group_name` CHAR( 27 ) DEFAULT 'Retail' NOT NULL ,

ADD `customers_group_id` INT( 11 ) DEFAULT '0' NOT NULL;



CREATE TABLE `products_groups` (

`customers_group_id` INT( 11 ) NOT NULL ,

`customers_group_price` DECIMAL( 15, 4 ) NOT NULL ,

`products_id` INT( 11 ) NOT NULL ,

`products_price` DECIMAL( 15, 4 ) NOT NULL 

);

HTH,

Tony


"The price of success is perseverance. The price of failure comes much cheaper."

Share this post


Link to post
Share on other sites

Thanks, that is all I needed.

 

I have since installed the entire contribution without custom specials, and I am having trouble using it. I notice that at the bottom of each customer there is a group name and a list of groups (only retail) but it is not availiable inside the product it-self? Is there a box I need to check or what?

 

Thanks for your help.


Adam de Merlis

Share this post


Link to post
Share on other sites

Don't worry I have it working!

 

I was wondering if there is way to drop the pricing by a certain percentage for a specific group? Or is there a contribution that does this and wont mess up this contribution I just added?

 

Thanks


Adam de Merlis

Share this post


Link to post
Share on other sites

hi,

 

if have a lite problem

select distinct customers_group_id from TABLE_PRODUCTS_GROUPS  

 

[TEP STOP]

 

whats wrong, ik cant see it.

i am yust starting with php

 

thx

 

Lighthouse


yes i know my english is bad, but you understand wath i mean;) if not ask

Share this post


Link to post
Share on other sites

Seems to be your TABLE_PRODUCTS_GROUPS is not defined in the database table defines... so mySQL can't find it.

 

Adding a

define('TABLE_PRODUCTS_GROUPS', 'whateverthenameis');

should fix it.

 

Mattice


"Politics is the art of preventing people from taking part in affairs which properly concern them"

Share this post


Link to post
Share on other sites

does anyone know if it is possible to change the product page.

say we have 3 groups

retail

wholesale

supplyer

 

retail and guest get standard page

wholesale gets price for retail & wholesale

supplyer gets price for retail, wholesale & Supplyer

 

would i have to make 3 diferent produkt pages and display them based on the login???

 

Regards John

Share this post


Link to post
Share on other sites

I am having the same error and have made sure that the table is being identified in the database_tables.php file.

 

1146 - Table 'mysqlname.TABLE_PRODUCTS_GROUPS' doesn't exist

 

select distinct customers_group_id from TABLE_PRODUCTS_GROUPS

 

[TEP STOP]

 

When I go to update the user to a new group such as "wholesale" it brings up the above error.

 

What am I doing wrong???


"Failure will never overtake me if my determination to succeed is strong enough" - Og Mandino

Share this post


Link to post
Share on other sites
ALTER TABLE `customers` ADD `customers_group_name` CHAR( 27 ) DEFAULT 'Retail' NOT NULL ,

ADD `customers_group_id` INT( 11 ) DEFAULT '0' NOT NULL;



CREATE TABLE `products_groups` (

`customers_group_id` INT( 11 ) NOT NULL ,

`customers_group_price` DECIMAL( 15, 4 ) NOT NULL ,

`products_id` INT( 11 ) NOT NULL ,

`products_price` DECIMAL( 15, 4 ) NOT NULL 

);

 

 

Where do i insert this please. I am new to this and dont understand how to create a table. I have tried using phpmyadmin but could not figure it out. If anyone has any advice it would be greatly appreciated. Thanks, William Skaggs

Share this post


Link to post
Share on other sites

Here is the part of the install instructions I dont understand..

 

 

Database Changes:

 

Add to the customers table:

customers_group_name (char 27) Default value: Retail

customers_group_id (int 11) Default value: 0

 

Create

products_groups table

 

Add to the products_groups table:

customers_group_id (int 11)

customers_group_price (decimal 15, 4)

products_id (int 11)

products_price (decimal 15,4)

 

Does anyone think they could explain this to me being I am completely stupid about this.

 

Thanks,

William Skaggs

Share this post


Link to post
Share on other sites

Do you have access to phpMyAdmin? If yes... read on.

 

Select your database from the drop down box in the left of your screen.

Then, select 'SQL' from the top menu on the right of your screen.

 

Copy the following code and paste it to the text box on your phpMyAdmin screen.

ALTER TABLE `customers` ADD `customers_group_name` CHAR( 27 ) DEFAULT 'Retail' NOT NULL , 

ADD `customers_group_id` INT( 11 ) DEFAULT '0' NOT NULL; 



CREATE TABLE `products_groups` ( 

`customers_group_id` INT( 11 ) NOT NULL , 

`customers_group_price` DECIMAL( 15, 4 ) NOT NULL , 

`products_id` INT( 11 ) NOT NULL , 

`products_price` DECIMAL( 15, 4 ) NOT NULL 

);

 

Press 'Go'

Some should appear saying 'Successful', and vaugly resemble what you pasted previously.

 

That should be it...

 

Let me know if you have any more troubles,

Tony


"The price of success is perseverance. The price of failure comes much cheaper."

Share this post


Link to post
Share on other sites

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,

Share this post


Link to post
Share on other sites

Also,

 

If I have a special price for "Resseler" group, the modules/new_products.php show tho everyone this special price.

 

Have a great day,

Share this post


Link to post
Share on other sites

Ok. Here is how I fixed the problem of special groups prices in modules/new_products.php

 

>>>>>>>>>>>>

 

REPLACE

 

$new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

 

WITH

 

$new_products_query = tep_db_query("select products_id, products_image, products_tax_class_id,  products_price from " . TABLE_PRODUCTS . " where products_status = '1' order by products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

 

 

>>>>>>>>>>>

 

 

REPLACE

 

$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

 

WITH

 

$new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id,  p.products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);

 

 

>>>>>>>>>>

 

 

BEFORE

 

    $info_box_contents[$row][$col] = array('align' => 'center',

                                          'params' => 'class="smallText" width="33%" valign="top"',

                                          'text' => '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_products['products_image'], $new_products['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $new_products['products_id']) . '">' . $new_products['products_name'] . '</a><br>' . $currencies->display_price($new_products['products_price'], tep_get_tax_rate($new_products['products_tax_class_id'])));

 

ADD

 

        $special_price_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . $new_products['products_id'] . "' and customers_group_id =  '" . $customer_group['customers_group_id'] . "' and status <> '0'");

 if ($special_price = tep_db_fetch_array($special_price_query)) {

  $new_products['products_price'] = $special_price['specials_new_products_price'];

       }

 

 

 

Good Luck!!

Share this post


Link to post
Share on other sites

POSSIBLE BUG!

 

Does anyone else recognize this problem?

 

The shopping cart recognizes an individual price purchase right. BUT the calculation of the sub-total seems to be according to the "retail" or normal price...

 

The checkout proceeds as it is supposed to. but it would still be nice to get the item prices agree with the sub-total in the shopping_cart.php page.

 

Am I the only one who has this problem? If not, could someone have a look at it?

 

I think this is the area to change. but unfortunately my php is still on the learning stage...

 

    function show_total() {

     $this->calculate();

Share this post


Link to post
Share on other sites
This Mod looks like it is perfect for my need - I will install it tongiht and see how I go.  

 

I was wondering if it were possible (either through further development or an additional addon) that the available products could change from customer to customer.  

 

Say you have a specific customer (or no group of customers) that you have specific pricing for. The login with their details and then they see all their specific pricing is displayed. Would it be difficult to limit (or expand) a range depending on their login??  

 

So not only do they get specific pricing they would get a specific (and tailored) product range? This (to me) seems like it could be a natural progression although I know it is probably complicated! Has anything looked into this? Do you think it would be hard to modify this Contrib. further for this to work?  

 

Basically I don't want to offer my entire range to all customers. If i tailor the price as well as the offered range for each customer that would be ideal!!!  

 

I hope this is possible  

 

Looking forward to getting this mod installed tonight.  

 

Thanks

 

Any word on an update on the Mod? Have you had a chance to look into this?

Share this post


Link to post
Share on other sites

Hi,

 

get an parse error in admin/specials.php on line 203

 

the line is:

} else {

 

in this part of the file:

      </tr>

     <tr>

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

         <tr>

           <td class="main"><br><?php echo TEXT_SPECIALS_PRICE_TIP; ?></td>

           <td class="main" align="right" valign="top"><br><?php echo (($form_action == 'insert') ? tep_image_submit('button_insert.gif', IMAGE_INSERT) : tep_image_submit('button_update.gif', IMAGE_UPDATE)). '   <a href="' . tep_href_link(FILENAME_SPECIALS, 'page=' . $HTTP_GET_VARS['page'] . (isset($HTTP_GET_VARS['sID']) ? '&sID=' . $HTTP_GET_VARS['sID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>'; ?></td>

         </tr>

       </table></td>

     </form></tr>

<?php



///////////// this is the line

} else { 





?>

     <tr>

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

         <tr>

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

             <tr class="dataTableHeadingRow">

               <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td>

               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_PRODUCTS_PRICE; ?></td>

               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_STATUS; ?></td>

               <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?> </td>

             </tr>

 

 

does anybody else have this problem?

 

i changed everything according to the install file and did it twice![/b]

Share this post


Link to post
Share on other sites

Ok,

 

the error is gone if i add a bracket to it, like

 

}

} else {

 

but another problem is that if i want to edit a special article the page is empty. I can create and delete but not edit.

 

I also have an error in catalog/specials.php on line 150

but this line is the last one and is empty?

 

 

???

 

Thanks.

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

×