Jump to content
scendent

Seperate Pricing Per Customer v3.5

Recommended Posts

Then obviously you haven't installed it correctly or you have some non-standard category box code...

 

I read the documentation for the SPPC and in it it says

 

This contribution has been written for osCommerce Milestone 2.2 It is unlikely that it will work with other versions of osCommerce. If you have a new installation of Milestone 2.2 then the easiest way to install this contribution is to upload the included files and run the spcc_v40_install.sql file on your MySql machine - that's all there is to it. This is the preferred method!!

 

Now my installation was new (using version 2.2 ms2 060817) and I have only added the register globals contrib so I simply copied and pasted the SPPC 4.16 files onto the directories then uploaded the latest Hidden Products and Categories contrib.

 

Could you be more specific than this?:

 

Then obviously you haven't installed it correctly or you have some non-standard category box code...

Share this post


Link to post
Share on other sites

Jan

 

In product_listings.php

 

 

Yes I do use $listing[$x]['field'] everywhere

 

 

Could this explain why the sold out product now does not display correctly

 

Thanking you all in advance

Share this post


Link to post
Share on other sites

Just to update I have now tried a manual install of SPPC and the Hide categories and come up with:

 

Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory.

 

What is it in the Hide category and product v2.02 contrib that disables my register globals contrib?

Share this post


Link to post
Share on other sites
What is it in the Hide category and product v2.02 contrib that disables my register globals contrib?

Nothing special as far as I can imagine. The error message comes from application_top.php so if the register_globals contribution does something with that (I suppose it does) and you took application_top from the Hide category contribution than you just nulled the things that the register_globals contribution was supposed to solve.

Share this post


Link to post
Share on other sites
In product_listings.php

Yes I do use $listing[$x]['field'] everywhere

Could this explain why the sold out product now does not display correctly

No, that is how it should be. But I'm not a claire-voyant and my crystal ball is broke so I can't tell you should fix lines 134-137 because I can't see your code.

Share this post


Link to post
Share on other sites
However, my specials problem still remains ie. I can't create a special for a single product for more than one group. Would you be able to advise as to what to check in admin/specials.php.

 

It looks like this at the moment:

I see all kinds of differences with my files but no differences that indicate that you added any contributions to that page yourself. So I would suggest using the one from the package. As a precaution (in view of the register globals issues) change this (around line 43):

		// BOF Separate Pricing Per Customer
	$customers_group=tep_db_prepare_input($HTTP_POST_VARS['customers_group']);

to:

		// BOF Separate Pricing Per Customer
	$customers_group = tep_db_prepare_input($_POST['customers_group']);

Share this post


Link to post
Share on other sites
From what you said above, it sounds like other edits might be necessary?

Yes, this tells me you didn't add cg_id in the correct place:

priceformatterstore Object
(
[pricebreaks] => Array
	(
		[75] => Array
			(
				[products_id] => 75
				[products_price] => 27.8000
				[products_name] => E04-747J00
				[products_model] => 
.....
			)

	)

[cg_id] => 1
)

If should be in the same array as all the other things under [75] in your example.

 

So the function addPriceBreakData in PriceFormatterStore should have been modified in this fashion:

	function addPriceBreakData ($products_id, $productinfo) {
		$this->pricebreaks[$products_id] = array('products_id' => tep_get_prid($productinfo['products_id']),
			'products_price' => $productinfo['products_price'],
			'products_name' => $productinfo['products_name'],
			'products_model' => $productinfo['products_model'],
			'cg_id' => $productinfo['categories_id'],
etcetera, etcetera

Share this post


Link to post
Share on other sites
I'm not sure what you mean by this, what module? A template of what?

You don't remember having acquired a template version of osC from some company instead of downloading the standard osC yourself?

 

The site you showed does not have the standard new products module look of osC, therefore it is a template version. It is a module because the code for it is found in catalog/includes/modules/new_products.php

Share this post


Link to post
Share on other sites
I see all kinds of differences with my files but no differences that indicate that you added any contributions to that page yourself. So I would suggest using the one from the package. As a precaution (in view of the register globals issues) change this (around line 43):

		// BOF Separate Pricing Per Customer
	$customers_group=tep_db_prepare_input($HTTP_POST_VARS['customers_group']);

to:

		// BOF Separate Pricing Per Customer
	$customers_group = tep_db_prepare_input($_POST['customers_group']);

 

Thankyou Jan, everything seem to be working.

 

:D

Share this post


Link to post
Share on other sites

Me again; another problem.

 

I posted this in the general support forum thinking it was nothing to do with SPPC:

http://forums.oscommerce.com/index.php?sho...p;#entry1114799

 

I've been setting up my store for a while now and all seems to work good.

 

However, I noticed a big bug today.

 

When I login as a customer and go to 'my account' and check my order history, the products that I have ordered are simply listed as 'x' with a value of £0.

 

Now, the entire order has the correct ammount, and the correct order history is shown in the order history box on the right.

 

This is what I am talking about:

errorag3.th.jpg

 

Order confirmation emails are all correct for admin and customer, it is just the actual order history page.

 

Really need help.

 

Thanks

 

Ah, ok.

 

This seems to be a problem with SPPC which I just installed.

 

The store works fine when someone is in the 'retail' group but if I buy something when the user is in another group or even just change there status, I get the above error.

 

Thanks for your time.

Share this post


Link to post
Share on other sites

I'm really sorry to waste your time Jan, I don't think this is a problem with SPPC after all.

 

It happens when I logout as the customer and then login again.

Share this post


Link to post
Share on other sites
Seems like it is an SPPC problem :mellow:

 

http://forums.oscommerce.com/index.php?sho...nt_history_info

 

I can't seem to fix it with these instructions though? Are they based on older code?

Actually, it was a left over from old code. Much, much later I realized it shouldn't be there because the history gets the (historic) prices from the database. Shouldn't get it from the recent prices.

 

I always assumed it did no harm. In the sppc_attributes install.txt I wrote this about it:

catalog/includes/classes/order.php

Line 4

**REPLACE**

adapted for Separate Pricing Per Customer v3.6 2005/02/06

**WITH**

adapted for Separate Pricing Per Customer v4.20 2006/11/12

Line 115-128

**REMOVE** (yes, remove: luckily it does nothing more than a useless query)

// BOF Separate Pricing Per Customer
 if(!tep_session_is_registered('sppc_customer_group_id')) { 
 $customer_group_id = '0';
 } else {
  $customer_group_id = $sppc_customer_group_id;
 }

  if ($customer_group_id != '0'){	
  $orders_customers_price = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '". $customer_group_id . "' and products_id = '" . $products[$i]['id'] . "'");		  
  if ($orders_customers = tep_db_fetch_array($orders_customers_price)){	
  $this->products[$index] = array('price' => $orders_customers['customers_group_price'], 'final_price' => $orders_customers['customers_group_price']);
 }							  
}
// EOF Separate Pricing Per Customer

I didn't know about it causing a problem. If it would have been posted in this thread I most likely would have seen it....

Share this post


Link to post
Share on other sites
You don't remember having acquired a template version of osC from some company instead of downloading the standard osC yourself?

 

The site you showed does not have the standard new products module look of osC, therefore it is a template version. It is a module because the code for it is found in catalog/includes/modules/new_products.php

 

 

I don't remember aquiring a template because I installed a fresh OSC myself on my linux server. I have modified the heck out of my installation, but mostly contributions and this could be why it does not fit your standard version.

 

Any other suggestions?

Share this post


Link to post
Share on other sites
Any other suggestions?

What are the customer_group_id's of retail and dealer? I can't see any difference between being logged-in or not. You say the CD-players should disappear. I tried product_id 408 and both as retail and logged-in as your test dealer I could add them to the cart.

Share this post


Link to post
Share on other sites

Hide products from customer groups for SPPC

 

When using function tep_has_category_subcategories($category_id), the nested categories appear in the query.

 

catalog/includes/functions/general.php

Change function tep_has_category_subcategories($category_id):

////
// Return true if the category has subcategories
// TABLES: categories
 function tep_has_category_subcategories($category_id) {
global $sppc_customer_group_id;
if(!tep_session_is_registered('sppc_customer_group_id')) {
$customer_group_id = '0';
} else {
 $customer_group_id = $sppc_customer_group_id;
}
$child_category_query = tep_db_query("select count(*) as count from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$category_id . "' and find_in_set('" . $customer_group_id . "', categories_hide_from_groups) = 0");
$child_category = tep_db_fetch_array($child_category_query);

if ($child_category['count'] > 0) {
  return true;
} else {
  return false;
}
 }

 

If in a catergory are no products and all subcategories of that category are hidden, the message "There are no products to list in this category." does not appear.

To get this message, the select in catalog/index.php - line 32 - needs the

and find_in_set('".$customer_group_id."', categories_hide_from_groups) = 0

statement.

 

catalog/index.php

// the following cPath references come from application_top.php
 $category_depth = 'top';
 if (isset($cPath) && tep_not_null($cPath)) {
$categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
$cateqories_products = tep_db_fetch_array($categories_products_query);
if ($cateqories_products['total'] > 0) {
  $category_depth = 'products'; // display products
} else {
  $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "' and find_in_set('".$customer_group_id."', categories_hide_from_groups) = 0");
  $category_parent = tep_db_fetch_array($category_parent_query);
  if ($category_parent['total'] > 0) {
	$category_depth = 'nested'; // navigate through the categories
  } else {
	$category_depth = 'products'; // category has no products, but display the 'no products' message
  }
}
 }

Share this post


Link to post
Share on other sites

I've just added this modification to my store but am now getting an error when I try to access the Newsletter Manager in my admin panel. Here's the error I'm getting:

 

1146 - Table 'pawshcom_osc1.TABLE_CUSTOMERS_GROUPS' doesn't exist

 

select customers_group_id, customers_group_name from TABLE_CUSTOMERS_GROUPS order by customers_group_id

 

[TEP STOP]

 

I've gone through and made sure that followed the instructions to a tee and that I've used phpMyAdmin to add the field send_to_customer_groups in the newsletters table using the following sql command:

 

ALTER TABLE `newsletters`

ADD send_to_customer_groups VARCHAR(32) DEFAULT NULL;

 

What am I doing wrong? :blink: I really want to use this Mod but can't get it to work! :( I'm using OSC v2.2 RC1.

 

Mandy

Share this post


Link to post
Share on other sites
1146 - Table 'pawshcom_osc1.TABLE_CUSTOMERS_GROUPS' doesn't exist

 

What am I doing wrong?

Classic example of not having added the defines for those new tables to admin/includes/database_tables.php.

 

Note that this file has at least one more table define (define('TABLE_ADMINISTRATORS', 'administrators');) than in the previous version (before RC1) so you can't upload the file from the package and be done with it!

So you have to do that manually.

Share this post


Link to post
Share on other sites
Classic example of not having added the defines for those new tables to admin/includes/database_tables.php.

 

Note that this file has at least one more table define (define('TABLE_ADMINISTRATORS', 'administrators');) than in the previous version (before RC1) so you can't upload the file from the package and be done with it!

So you have to do that manually.

 

Sorry, I'm a complete newbie when it comes to this stuff. :blush:

Share this post


Link to post
Share on other sites
Classic example of not having added the defines for those new tables to admin/includes/database_tables.php.

 

Note that this file has at least one more table define (define('TABLE_ADMINISTRATORS', 'administrators');) than in the previous version (before RC1) so you can't upload the file from the package and be done with it!

So you have to do that manually.

 

So, if I'm understanding correctly, I just have to go into the admin/includes/database_tables.php file and add the table define you detailed above and it should work, right?

Share this post


Link to post
Share on other sites

Hi All,

 

Wondering if someone can help me with a problem im having...

 

I just installed SPPC 4.16 on RC1 .. everything seemed to be merged correctly.. however im having this problem..

 

all the products in my catalog are showing up without images and with prices 0.00 .. so I assumed that Im supposed to add the products in my catalog to the retail group ? .. well just how do I do that.. I am looking in the admin site and I dont see anywhere that I can set which customers_group I can set the product to ..

 

can someone provide a screen show.. which file or where I would be able to specify which group the product belongs to ..

 

other than the new customers_groups link under the customers link on the left column.. the admin site hasnt changed even after all the changes...

 

J

Share this post


Link to post
Share on other sites
all the products in my catalog are showing up without images and with prices 0.00 .. so I assumed that Im supposed to add the products in my catalog to the retail group ? .. well just how do I do that.. I am looking in the admin site and I dont see anywhere that I can set which customers_group I can set the product to ..

 

can someone provide a screen show.. which file or where I would be able to specify which group the product belongs to ..

 

other than the new customers_groups link under the customers link on the left column.. the admin site hasnt changed even after all the changes...

For a general overview of how SPPC works you should download the Separate Pricing Per Customer V4.1 (Missing HTML-Overview from package) (April 27, 2005) in the contribution section. Retail is the default group so when you add SPPC to the site, the prices in the table products are the one for retail. Prices becoming zero usually has another cause. Check the forum, I've seen it come by many times (currency issue I believe). Or there is an error in the class shopping_cart.php...? There are so many modules that get their images with their own sql query that I cannot imagine they are gone everywhere.

You are probably referring to missing prices and images in a certain box (like new products).

Share this post


Link to post
Share on other sites
So, if I'm understanding correctly, I just have to go into the admin/includes/database_tables.php file and add the table define you detailed above and it should work, right?

 

I did this and am still getting the same error.... >_<

Share this post


Link to post
Share on other sites
I did this and am still getting the same error.... >_<

Just start with the original file you downloaded (if you don't have it anymore, download it again and keep it separate) and follow the instructions to add the SPPC specific table defines.

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

×