Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.5


scendent

Recommended Posts

This is something I could use aswell... Tax Exempt on PST Tax Class only. Has anyone else been able to code something for this?

 

Thanks

Shayne

Hi,

 

I have setted my tax myself with the config in the admin panel and it's work great. I can send you my SQL table for this. All you have to do is upload to PhPMyadmin the SQL file... Tell me if you want it...

John

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

osCommerce 2.3.4 Bootstrap Edge

Link to comment
Share on other sites

I have made some modifications to this file so that when wholesale customers login and see wholesale prices they also get to see the retail price. (Page 34 of the SPPC topic).

 

In front of the retail prices there is text as shown below. Could somebody tell me how i can add text in front of the wholesale price as well. Obviously i would only want wholesale customers to be able to see this text.

 

An example of what i want is below:

 

Retail Price: ?10.99

Agent Price: ?4.99

Link to comment
Share on other sites

I have done some research on my own and finally (yeah, after endless hours!) figured out how to display Approval Status for Non-Retail accounts in address_book_details.php:

 

<?php
 $sql = "SELECT customers_group_id, customers_group_ra FROM customers where customers_id = '" . tep_db_input($customer_id) . "'";

 $result = mysql_query($sql);
 while($row = mysql_fetch_array($result)){
 $customers_group_id = $row["customers_group_id"];
 $customers_group_ra = $row["customers_group_ra"];
 }
	if ($customers_group_id == '0' AND $customers_group_ra == '1') {
	  echo " (Subject to Activation)";
	} elseif ($customers_group_id == '0' AND $customers_group_ra == '0') {
	  echo " (Denied)"; 
	} else {
	  echo " (Activated)";
  } 
?></td>

 

Hope this helps someone!

 

Ken

Edited by ken.yong
Link to comment
Share on other sites

Another question:

 

In admin/customers.php, I got the following error when I refresh the country by using Countries-States contribution:

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in admin/includes/functions/database.php

 

The Customer Group drop-down becomes blank, the options for payment and shipping disappear!

 

If I don't refresh the country, it works perfectly fine.

 

Did anyone experience this at all?

 

Ken

Edited by ken.yong
Link to comment
Share on other sites

I have made some modifications to this file so that when wholesale customers login and see wholesale prices they also get to see the retail price. (Page 34 of the SPPC topic).

 

In front of the retail prices there is text as shown below. Could somebody tell me how i can add text in front of the wholesale price as well. Obviously i would only want wholesale customers to be able to see this text.

 

An example of what i want is below:

 

Retail Price: ?10.99

Agent Price: ?4.99

 

I think what you need and search are the excellent contribution :-" Show Price list for SPPC 4.1 v1.0. Have fun. :thumbsup:

John

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

osCommerce 2.3.4 Bootstrap Edge

Link to comment
Share on other sites

In admin/customers.php, I got the following error when I refresh the country by using Countries-States contribution:
I know there were some issues with the Country State contribution (see e.g. this post). I don't remember it involving code in the admin section though. The error you get is consistent with asking for a query result, where there hasn't been a query.
Link to comment
Share on other sites

Thanks a lot! Jan! I tried to fix this and let me know if there will be conflicts since I am really a php newbie.

 

The Country-State contribution has extra add-ons for admin/customers.php. If anyone experienced this, follow the followings to fix it:

 

1. Go to admin/customers.php

 

2. Find the following codes which were added by SPPC:

// BOF Separate Pricing Per Customer - START
	$customers_query = tep_db_query("select c.customers_id, c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_company_tax_id, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_state, a.entry_zone_id, a.entry_country_id, c.customers_telephone, c.customers_fax, c.customers_newsletter, c.customers_group_id,  c.customers_group_ra, c.customers_payment_allowed, c.customers_shipment_allowed, c.customers_default_address_id from " . TABLE_CUSTOMERS . " c left join " . TABLE_ADDRESS_BOOK . " a on c.customers_default_address_id = a.address_book_id where a.customers_id = c.customers_id and c.customers_id = '" . (int)$HTTP_GET_VARS['cID'] . "'");

	$module_directory = DIR_FS_CATALOG_MODULES . 'payment/';
	$ship_module_directory = DIR_FS_CATALOG_MODULES . 'shipping/';

	$file_extension = substr($PHP_SELF, strrpos($PHP_SELF, '.'));
	$directory_array = array();
	if ($dir = @dir($module_directory)) {
	while ($file = $dir->read()) {
	if (!is_dir($module_directory . $file)) {
	   if (substr($file, strrpos($file, '.')) == $file_extension) {
		  $directory_array[] = $file; // array of all the payment modules present in includes/modules/payment
			  }
		   }
		}
	sort($directory_array);
	$dir->close();
	}

	$ship_directory_array = array();
	if ($dir = @dir($ship_module_directory)) {
	while ($file = $dir->read()) {
	if (!is_dir($ship_module_directory . $file)) {
	   if (substr($file, strrpos($file, '.')) == $file_extension) {
		  $ship_directory_array[] = $file; // array of all shipping modules present in includes/modules/shipping
			}
		  }
		}
		sort($ship_directory_array);
		$dir->close();
	}

   $existing_customers_query = tep_db_query("select customers_group_id, customers_group_name from " . TABLE_CUSTOMERS_GROUPS . " order by customers_group_id ");	
// EOF Separate Pricing Per Customer - END

 

3. Moved the above code from being just above $customers = tep_db_fetch_array($customers_query); to just below require('includes/application_top.php');

 

That's it. I have tested it briefly and I didn't realize problems so far. I think the problem lies in when the Country-State refreshes, the above block of code is somehow being left out, thus the error.

 

Ken

Edited by ken.yong
Link to comment
Share on other sites

Hi,

 

I have setted my tax myself with the config in the admin panel and it's work great. I can send you my SQL table for this. All you have to do is upload to PhPMyadmin the SQL file... Tell me if you want it...

 

My tax is setup via the admin as well based on the instruction provided by the Canada Tax instruction contribution. However, If a dealer (one of my groups) is tax exempt, then I want only my PST Tax class to be exempt. In canada we still need to charge the GST whether you're exempt or not. Currently, if Tax Exempt is true, then no tax is applied which doesn't really work for me.

 

Any help would be great, so if you think your table could help me out, then please send it over and I'll take a look. Thanks again for the offer!

 

Shayne

Link to comment
Share on other sites

My tax is setup via the admin as well based on the instruction provided by the Canada Tax instruction contribution. However, If a dealer (one of my groups) is tax exempt, then I want only my PST Tax class to be exempt. In canada we still need to charge the GST whether you're exempt or not. Currently, if Tax Exempt is true, then no tax is applied which doesn't really work for me.
This has already been coded, but never released or written up as instructions on how to add to your site (just the changed files). It is parked somewhere on the internet that I like to keep Google etc. out of, so I will PM you the url of where you can download those files.
Link to comment
Share on other sites

My tax is setup via the admin as well based on the instruction provided by the Canada Tax instruction contribution. However, If a dealer (one of my groups) is tax exempt, then I want only my PST Tax class to be exempt. In canada we still need to charge the GST whether you're exempt or not. Currently, if Tax Exempt is true, then no tax is applied which doesn't really work for me.

 

Any help would be great, so if you think your table could help me out, then please send it over and I'll take a look. Thanks again for the offer!

 

Shayne

 

Here My table SQL :

 

 

FOR THE TAX ZONE TABLE :

 

-- 
-- Table structure for table `geo_zones`
-- 

DROP TABLE IF EXISTS `geo_zones`;
CREATE TABLE `geo_zones` (
 `geo_zone_id` int(11) NOT NULL auto_increment,
 `geo_zone_name` varchar(32) NOT NULL default '',
 `geo_zone_description` varchar(255) NOT NULL default '',
 `last_modified` datetime default NULL,
 `date_added` datetime NOT NULL default '0000-00-00 00:00:00',
 PRIMARY KEY  (`geo_zone_id`)
) TYPE=MyISAM AUTO_INCREMENT=6;

-- 
-- Dumping data for table `geo_zones`
-- 

INSERT INTO `geo_zones` (`geo_zone_id`, `geo_zone_name`, `geo_zone_description`, `last_modified`, `date_added`) VALUES (2, 'Canada GST (TPS) Zone', 'GST-TPS (most of Canada except NS, NB, NL)', '2005-01-24 13:38:52', '2005-01-24 13:15:48');
INSERT INTO `geo_zones` (`geo_zone_id`, `geo_zone_name`, `geo_zone_description`, `last_modified`, `date_added`) VALUES (3, 'Ontario PST Zone', 'PST (only when shipping to Ontario)', NULL, '2005-01-24 13:18:51');
INSERT INTO `geo_zones` (`geo_zone_id`, `geo_zone_name`, `geo_zone_description`, `last_modified`, `date_added`) VALUES (4, 'HST Zone', 'Taxe zone for Nova Scotia, New Brunswick, Newfoundland', '2005-01-24 13:25:42', '2005-01-24 13:21:50');
INSERT INTO `geo_zones` (`geo_zone_id`, `geo_zone_name`, `geo_zone_description`, `last_modified`, `date_added`) VALUES (5, 'Qu?bec TVQ Zone', 'Taxe TVQ au Qu?bec', NULL, '2005-01-24 13:31:48');

 

 

 

FOR THE TAX CLASS TABLE:

 

-- 
-- Table structure for table `tax_class`
-- 

DROP TABLE IF EXISTS `tax_class`;
CREATE TABLE `tax_class` (
 `tax_class_id` int(11) NOT NULL auto_increment,
 `tax_class_title` varchar(32) NOT NULL default '',
 `tax_class_description` varchar(255) NOT NULL default '',
 `last_modified` datetime default NULL,
 `date_added` datetime NOT NULL default '0000-00-00 00:00:00',
 PRIMARY KEY  (`tax_class_id`)
) TYPE=MyISAM AUTO_INCREMENT=3;

-- 
-- Dumping data for table `tax_class`
-- 

INSERT INTO `tax_class` (`tax_class_id`, `tax_class_title`, `tax_class_description`, `last_modified`, `date_added`) VALUES (1, 'GST/HST/PST Class', 'All taxable goods', '2005-01-24 13:36:44', '2005-01-18 20:47:39');
INSERT INTO `tax_class` (`tax_class_id`, `tax_class_title`, `tax_class_description`, `last_modified`, `date_added`) VALUES (2, 'GST Shipping class', 'GST on shipping in Canada', '2005-01-25 14:19:24', '2005-01-24 13:37:01');

 

 

 

FOR THE TAX RATE TABLE :

 

-- 
-- Table structure for table `tax_rates`
-- 

DROP TABLE IF EXISTS `tax_rates`;
CREATE TABLE `tax_rates` (
 `tax_rates_id` int(11) NOT NULL auto_increment,
 `tax_zone_id` int(11) NOT NULL default '0',
 `tax_class_id` int(11) NOT NULL default '0',
 `tax_priority` int(5) default '1',
 `tax_rate` decimal(7,4) NOT NULL default '0.0000',
 `tax_description` varchar(255) NOT NULL default '',
 `last_modified` datetime default NULL,
 `date_added` datetime NOT NULL default '0000-00-00 00:00:00',
 PRIMARY KEY  (`tax_rates_id`)
) TYPE=MyISAM AUTO_INCREMENT=10;

-- 
-- Dumping data for table `tax_rates`
-- 

INSERT INTO `tax_rates` (`tax_rates_id`, `tax_zone_id`, `tax_class_id`, `tax_priority`, `tax_rate`, `tax_description`, `last_modified`, `date_added`) VALUES (1, 2, 1, 1, 7.0000, '7.0 % GST (TPS) #102501186', '2005-01-25 14:22:59', '2005-01-18 20:47:39');
INSERT INTO `tax_rates` (`tax_rates_id`, `tax_zone_id`, `tax_class_id`, `tax_priority`, `tax_rate`, `tax_description`, `last_modified`, `date_added`) VALUES (2, 3, 1, 1, 8.0000, '8 % PST #8509-4676', '2005-01-25 15:22:58', '2005-01-24 13:45:58');
INSERT INTO `tax_rates` (`tax_rates_id`, `tax_zone_id`, `tax_class_id`, `tax_priority`, `tax_rate`, `tax_description`, `last_modified`, `date_added`) VALUES (3, 5, 1, 2, 7.5000, '7.5 % TVQ #1003224178 TQ0001', '2005-01-25 14:26:58', '2005-01-24 13:47:52');
INSERT INTO `tax_rates` (`tax_rates_id`, `tax_zone_id`, `tax_class_id`, `tax_priority`, `tax_rate`, `tax_description`, `last_modified`, `date_added`) VALUES (4, 2, 2, 1, 7.0000, '7.0% GST on shipping', NULL, '2005-01-24 13:52:14');
INSERT INTO `tax_rates` (`tax_rates_id`, `tax_zone_id`, `tax_class_id`, `tax_priority`, `tax_rate`, `tax_description`, `last_modified`, `date_added`) VALUES (8, 5, 2, 2, 7.5000, 'Shipping Taxe 7.5 %', '2005-01-25 14:30:18', '2005-01-24 14:11:51');
INSERT INTO `tax_rates` (`tax_rates_id`, `tax_zone_id`, `tax_class_id`, `tax_priority`, `tax_rate`, `tax_description`, `last_modified`, `date_added`) VALUES (6, 4, 2, 1, 15.0000, '15% shipping HST #102501186', '2005-01-24 14:02:43', '2005-01-24 13:58:24');
INSERT INTO `tax_rates` (`tax_rates_id`, `tax_zone_id`, `tax_class_id`, `tax_priority`, `tax_rate`, `tax_description`, `last_modified`, `date_added`) VALUES (7, 4, 1, 1, 15.0000, 'HST Tax #102501186', '2005-01-25 14:26:27', '2005-01-24 14:04:55');
INSERT INTO `tax_rates` (`tax_rates_id`, `tax_zone_id`, `tax_class_id`, `tax_priority`, `tax_rate`, `tax_description`, `last_modified`, `date_added`) VALUES (9, 3, 2, 1, 8.0000, '8 % PST (shipping)', '2005-01-25 15:23:22', '2005-01-25 14:29:05');

 

I Hope it will help...

John

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

osCommerce 2.3.4 Bootstrap Edge

Link to comment
Share on other sites

This has already been coded, but never released or written up as instructions on how to add to your site (just the changed files). It is parked somewhere on the internet that I like to keep Google etc. out of, so I will PM you the url of where you can download those files.

 

I got it... thanks for that. I'll try it out and let you know how it works out.

 

Shayne

Link to comment
Share on other sites

Hi all

 

I've been skimming thru this rather small Forum for SPPC :P and know that SPPC is quite an involved contribute to install, but with all the fuss, I figure it's worth having...BUT...only if it will do the job I need it to do....SOOOO.... I'd love some honest comments as to whether SPPC is for me or not, before I go thru the painful process of installation (and no doubt adding to your growing list of queries!)....

 

What I need is this:

 

1. To give specific clients their own discount or quantity discount rate and/or special product price. This is NOT a wholesale or retail based amount... It's purely an individually negotiated rate with each customer (I deal in business to business sales mostly)

2. Other contributions I've installed are only small(is) - such as Customer Account Number, Reconfigured Order Emails, PayPal Australia module... any experiences with these clashing with SPPC?

 

I would also like to know if the discount % or value appears on the order form and invoice?

 

Thanks for your feedback/help/advice

 

 

:)

Edited by aquamango
Link to comment
Share on other sites

Hi,

 

 

Today I have installed 'Separate_Price_Per_Customer_Version_40' in my site ,it is working fine but there is one bug.i.e, I have added a group whole sale in admin side during addition i have given display price with tax and price exmpt to 'no'.But when I logged as a whole saler but it is displaying price without tax.I have enabled display price with tax in admin side.Please help me. :(

Link to comment
Share on other sites

But when I logged as a whole saler but it is displaying price without tax.I have enabled display price with tax in admin side.
I do hope you have the latest version (4.1.1, 4.0 is old). Regarding what you saw, did you log-out and log-in? Because these values are stored in the session of the logged-in customer and are not changed when you do something in the admin.
Link to comment
Share on other sites

Another Problem!

 

I got the following error today when trying to view my site and admin:

 

FATAL ERROR: register_globals is disabled in php.ini, please enable it!

 

To rectify the problem i installed version 1.3 of:

 

http://www.oscommerce.com/community/contributions,2097/category,all/search,register+globals

 

I just wanted to know if somebody has had a similiar problem as some of SPPC is not working correctly now.

 

The bits that I have found (so far) that do not work are the customer list sorting arrows in admin. (the ones that sort out the customers by name, date etc).

 

Your help would be much appreciated.

Link to comment
Share on other sites

Another Problem!

 

I got the following error today when trying to view my site and admin:

 

FATAL ERROR: register_globals is disabled in php.ini, please enable it!

 

To rectify the problem i installed version 1.3 of:

 

http://www.oscommerce.com/community/contributions,2097/category,all/search,register+globals

 

I just wanted to know if somebody has had a similiar problem as some of SPPC is not working correctly now.

 

The bits that I have found (so far) that do not work are the customer list sorting arrows in admin. (the ones that sort out the customers by name, date etc).

 

Your help would be much appreciated.

 

I think, the problem come from the side of your host....

John

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

osCommerce 2.3.4 Bootstrap Edge

Link to comment
Share on other sites

Another Problem!

 

I got the following error today when trying to view my site and admin:

 

FATAL ERROR: register_globals is disabled in php.ini, please enable it!

 

To rectify the problem i installed version 1.3 of:

 

http://www.oscommerce.com/community/contributions,2097/category,all/search,register+globals

 

I just wanted to know if somebody has had a similiar problem as some of SPPC is not working correctly now.

 

The bits that I have found (so far) that do not work are the customer list sorting arrows in admin. (the ones that sort out the customers by name, date etc).

 

Your help would be much appreciated.

 

I have fixed it! Woohoo!

 

I modified this:

 

 

// BOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer

switch ($listing) {

 

to this:

 

// BOF customer_sort_admin_v1 adapted for Separate Pricing Per Customer

switch ($_GET['listing']) {

 

Can any one recommend a decent php book, so i get to know what all this scripting means?

Edited by blagger
Link to comment
Share on other sites

Can any one recommend a decent php book, so i get to know what all this scripting means?
I hold Matt Zandstra's Sams Teach Yourself PHP in 24 Hours in very high standing. Excellent book. I keep it close whenever I'm coding.
Link to comment
Share on other sites

Fabulous contribution and works magic since my shop will be mainly targeted at wholesale customers. I have been testing all day and SPPC v4.1 works with no problem at all. Very pleased. However, I have just finished installing version 2.1 of Add Multiple Products to Cart, in Columns, for SPPC (another great addition), but when filling up my own shopping cart in my own shop (once again with many DVDs of 'Something about Mary', 'Courage under fire', The wheel of Time' (?), etc, etc: the standard OSC stock!!) there was one crucial thing I happen to notice. When selecting items via the infoboxes one skips viewing the whole category with the quantity Buy Now boxes. Consequently, when adding items to the cart by selecting Add to Cart, zero items are added to it (since quantity is set at 0) and hence item is not featured in the cart.

 

A clue comes from comparing line 360 from the original \includes\application_top.php to the modded one. Hence I changed ($HTTP_POST_VARS['cart_quantity']) to ($HTTP_POST_VARS['cart_quantity'])+1. This seems to work now on another virtual shopping tour (in the hardware museum this time!). JanZ, Stew, could I pass this on to you for rubber stamping?

 

Thanks all!

 

Skylla

Edited by skylla
Link to comment
Share on other sites

Fabulous contribution and works magic since my shop will be mainly targeted at wholesale customers. I have been testing all day and SPPC v4.1 works with no problem at all. Very pleased. However, I have just finished installing version 2.1 of Add Multiple Products to Cart, in Columns, for SPPC (another great addition), but when filling up my own shopping cart in my own shop (once again with many DVDs of 'Something about Mary', 'Courage under fire', The wheel of Time' (?), etc, etc: the standard OSC stock!!) there was one crucial thing I happen to notice. When selecting items via the infoboxes one skips viewing the whole category with the quantity Buy Now boxes. Consequently, when adding items to the cart by selecting Add to Cart, zero items are added to it (since quantity is set at 0) and hence item is not featured in the cart.

 

A clue comes from comparing line 360 from the original \includes\application_top.php to the modded one. Hence I changed ($HTTP_POST_VARS['cart_quantity']) to ($HTTP_POST_VARS['cart_quantity'])+1. This seems to work now on another virtual shopping tour (in the hardware museum this time!). JanZ, Stew, could I pass this on to you for rubber stamping?

 

Thanks all!

 

Skylla

 

Well if only it was really that easy. This does not seem to work when similar items are already in the cart. i.e. if one would choose to add multiple items of the same product already in the cart via the quantity Buy Now button only one item however is added. Multiple items can only be added that way when no similar products are in the cart... any ideas anyone?

Link to comment
Share on other sites

Hi. I just installed this contribution, and I'm having some problems. When I attempt to go to a category listing page, I get this error:

1054 - Unknown column 'p.products_id' in 'on clause'

select count(p.products_id) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials_retail_prices s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '52'

[TEP STOP]

 

I double-checked that I'd run the included sql statements correctly, but they are appearing correctly in phpmyadmin, so I'm not sure what's up here.

Always BACK UP your files and your database before making any changes. Before asking questions, check out the Knowledge Base. Check out the contributions to see if your problem's solved there. Search the forums.

 

Useful threads: Store Speed Optimization How to make a horrible shop Basics for design change How to search the forums

 

Useful contributions: Easypopulate Fast, Easy Checkout Header Tag Controller

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...