Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Separate pricing per user


pmwright

Recommended Posts

I've downloaded and installed the Separate Pricing per User module (v3.3) and a large part of it works very well. In particular, the parts related to Customers seem to work exactly as they should.

 

However, I'm having trouble with the editing of products. When I create a new product or edit an existing product, some fields in the products databases get populated (product name and product description) but most do not. And in one case, the images field, the contents are always "Array" after the product is added. The new fields (in the products_groups table) do get added properly.

 

I've looked at the code until my eyes are nearly crossed and I'm not seeing the problem. I suspect a missing brace or something like that - any suggestions for tracking down this problem will be most appreciated!

 

thanks,

 

paul

Link to comment
Share on other sites

Paul, I have'nt heard of this problem popping up before but I'll tell you some things that have changed since that release. In catalog/includes/modules/product_listing.php the instructions say this:

catalog/includes/modules/product_listing.php



Around line 97



After:



if ($listing_numrows > 0) {

 $number_of_products = '0';

 $listing = tep_db_query($listing_sql);

 while ($listing_values = tep_db_fetch_array($listing)) {



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);

$customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $listing_values['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)) {

   $listing_values['products_price'] = $customer_group_price['customers_group_price'];

 }

}

 

Somewhere along the way $listing_values changed to just $listing so the updated version should read:

catalog/includes/modules/product_listing.php



Around line 97



After:



if ($listing_numrows > 0) {

 $number_of_products = '0';

 $listing = tep_db_query($listing_sql);

 while ($listing = tep_db_fetch_array($listing)) {



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);

$customer_group_price_query = tep_db_query("select customers_group_price from " . TABLE_PRODUCTS_GROUPS . " where products_id = '" . $listing['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)) {

   $listing['products_price'] = $customer_group_price['customers_group_price'];

 }

}

 

Also two lines of code in the instructions are missing ending semicolons. Specifically in catalog/includes/modules/products_new.php. You'll see it when you look at it. The other thing that has been pointed out to me is that catalog/includes/modules/new_products.php is shown twice in the install file. You only need to modify it once. As I've told a few people the company I work for is not doing so well so my support of the mod is limited. I'll try to help if I can though.

If every member of this board donated $1 to the dev team, that would be over $11,000.00. Don't you think this cart is worth at least a $1????

Link to comment
Share on other sites

Thanks for your kind offer of help! What I ended up doing was downloading the CVS version from last night and starting with that as a basis (before that I was working with the MS1 release and that might have been a large part of the problem). I then applied the patches detailed in v3.3 and made the changes you suggested for product_listing.php.

 

Following the install, I got a duplicate key error when I tried to enter a new product, but that took care of itself when I dropped and recreated the PRODUCTS_GROUPS table.

 

The only bug I have left is that product_info.php shows a zero price but that just looks like a variable assignment problem. There is one statement in the code that I don't understand:

 

$products_price = '<s>' . $currencies->display_price($product_info['products_price']

 

What does '<s>' mean?

 

I appreciate the help - this module is *exactly* what I needed to accomplish the goals for the site I am building.

 

regards,

 

paul

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...