Seperate Pricing Per Customer v3.5
#1
Posted 04 August 2003, 00:28
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.
#2
Posted 04 August 2003, 00:53
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*
Learn to Set up and Manage Your Affiliate Program
#3
Posted 05 August 2003, 03:57
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
#4
Posted 05 August 2003, 04:17
Quote
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
#5
Posted 05 August 2003, 04:22
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!
#6
Posted 05 August 2003, 16:39
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,
#7
Posted 05 August 2003, 16:52
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
#8
Posted 05 August 2003, 19:22
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.
#9
Posted 05 August 2003, 19:32
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
#10
Posted 05 August 2003, 20:57
if have a lite problem
Quote
[TEP STOP]
whats wrong, ik cant see it.
i am yust starting with php
thx
Lighthouse
#11
Posted 05 August 2003, 22:03
Adding a
define('TABLE_PRODUCTS_GROUPS', 'whateverthenameis');
should fix it.Mattice
#12
Posted 07 August 2003, 10:02
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
#13
Posted 07 August 2003, 18:29
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???
#14
Posted 08 August 2003, 16:22
Quote
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
#15
Posted 08 August 2003, 16:38
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
#16
Posted 09 August 2003, 00:15
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
#17
Posted 09 August 2003, 02:11
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,
#18
Posted 09 August 2003, 02:26
If I have a special price for "Resseler" group, the modules/new_products.php show tho everyone this special price.
Have a great day,
#19
Posted 09 August 2003, 03:30
>>>>>>>>>>>>
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!!
#20
Posted 10 August 2003, 08:52
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();














