Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seperate Pricing Per Customer v3.1 Bug


ocularmagic

Recommended Posts

Well, the bugs just keep popping up in my contribution here. :? Apparently if you assign pricing to one group, then create another group after all of the pricing is entered, it erases all of the prices for the old group. :shock: I'm going to fix this asap and will release a new version when done. Sorry to all for the inconvenience.

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

Will this work with the newest cvs snapshot (12/03/2002) ?

It should, but I make no guarantees. :wink:

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

Released version 3.2. It's a pretty simple fix so I'll add the upgrade from 3.1a to 3.2 here.

 

In file admin/customers.php

 

Around line 25

 

Replace:

$multiple_groups_query = tep_db_query("select distinct customers_group_id from " . TABLE_PRODUCTS_GROUPS . " order by customers_group_id");

while ($group_ids = tep_db_fetch_array($multiple_groups_query)) {

 $multiple_customers_query = tep_db_query("select distinct customers_group_id from " . TABLE_CUSTOMERS . " where customers_group_id = " . $group_ids['customers_group_id'] . " ");

 $multiple_customers = tep_db_fetch_array($multiple_customers_query);

 tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = " . $multiple_customers['customers_group_id'] . " ");

}

 

With:

 

$multiple_groups_query = tep_db_query("select distinct customers_group_id from " . TABLE_PRODUCTS_GROUPS . " ");

while ($group_ids = tep_db_fetch_array($multiple_groups_query)) {

 $multiple_customers_query = tep_db_query("select distinct customers_group_id from " . TABLE_CUSTOMERS . " where customers_group_id = " . $group_ids['customers_group_id'] . " ");

 if (!($multiple_groups = tep_db_fetch_array($multiple_customers_query))) {

   tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '" . $group_ids['customers_group_id'] . "'");

 }

}

 

Around line 141

 

Replace:

 

$multiple_groups_query = tep_db_query("select distinct customers_group_id from " . TABLE_PRODUCTS_GROUPS . " order by customers_group_id");

while ($group_ids = tep_db_fetch_array($multiple_groups_query)) {

 $multiple_customers_query = tep_db_query("select distinct customers_group_id from " . TABLE_CUSTOMERS . " where customers_group_id = " . $group_ids['customers_group_id'] . " ");

 $multiple_customers = tep_db_fetch_array($multiple_customers_query);

 tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = " . $multiple_customers['customers_group_id'] . " ");

}

 

With:

 

$multiple_groups_query = tep_db_query("select distinct customers_group_id from " . TABLE_PRODUCTS_GROUPS . " ");

while ($group_ids = tep_db_fetch_array($multiple_groups_query)) {

 $multiple_customers_query = tep_db_query("select distinct customers_group_id from " . TABLE_CUSTOMERS . " where customers_group_id = " . $group_ids['customers_group_id'] . " ");

 if (!($multiple_groups = tep_db_fetch_array($multiple_customers_query))) {

   tep_db_query("delete from " . TABLE_PRODUCTS_GROUPS . " where customers_group_id = '" . $group_ids['customers_group_id'] . "'");

 }

}

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

Does anybody know why I would not have this in categories.php, the line I have to replace, it doesnt exist.

Anyone know why it wouldnt ?

 

Around line 690



Replace:



[b]if (!is_array($HTTP_POST_VARS[$key])) {[/b]

With:



if (is_array($value)) {

 while (list($k, $v) = each($value)) {

 echo tep_draw_hidden_field($key . '[' . $k . ']', htmlspecialchars(stripslashes($v)));

 }

} else {



A few lines after, delete:



}

$languages = tep_get_languages();

for ($i=0; $i<sizeof($languages); $i++) {

 echo tep_draw_hidden_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_name[$languages[$i]['id']])));

 echo tep_draw_hidden_field('products_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_description[$languages[$i]['id']])));

 echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']])));

 

It seems to work ok, but it doesnt remember my setting swhen I update a product. Also I have no option to create another pricing category.

 

My snapshot is April time, and I'm using 3.2 just released.

 

Cheers

 

CC.

Link to comment
Share on other sites

Ok, never mind I sorted that.

 

But I have another issue I believe is a bug.

 

When you run this hack along side the product attributes mod, they effect each other.

Mainly when you chose a pricing group and tick the box and enter the price, it doesnt alter the price, but it ticks the box of the first item in the product attributes box instead.

 

So the price group doesnt exist, all you get is a new attribute to the product in question.

Have you got any ideas as to what might cause this ocularmagic?

 

Or has anyone else experienced this?

 

CC.

Link to comment
Share on other sites

Sorry, I don't use the product attribute mod so I can't say for sure. I'll see if I can install the product attributes mod this weekend and see if I can duplicate it. Maybe they both use the same variable name for the checkbox?

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

Ok sorted that out but theres another bug i guess. I can't delete existing users or new users. I get this when i try to delete

1054 - Unknown column 'customer_id' in 'where clause'

 

select customers_group_id from customers where customer_id = '17'

Link to comment
Share on other sites

Do you want to share how you solved the problem??

 

I havent got round to looking yet.

 

I will look at the new one now.

But can you tell me how you solved the 1st problem, so I can recreate this new one?

 

CC.

Link to comment
Share on other sites

I'd like to share, but I can't cause i had no time to solve that for real. I just removed product attribute mod cause at this time the seperate price mod is more important for me

 

Sorry :oops:

 

Tom

Link to comment
Share on other sites

Argh ok

 

Well in that case that is all i have done for now as well.

 

But I dont get the error you are getting at this point.

 

Could you tell me exactly what you do that causes you this problem?

I will see if I can replicate it.

 

CC.

Link to comment
Share on other sites

I have installed the 3.2 version, but no matter what price I add to a customer group and it always changes back to zero. Does anyone know how can I solve this problem? Thanks

 

 

cheng

Link to comment
Share on other sites

  • 4 weeks later...

I'm getting the error mentioned in this thread whenever I attempt to delete a customer:

1054 - Unknown column 'customer_id' in 'where clause'

Other than this glitch, the seperate pricing contribution works great. I'm using version 3.2. Has anyone developed a solution to this issue?

Alan Pace

Link to comment
Share on other sites

Hi,

 

I was wondering if anyone has found a fix to the problems above (except for the deleting customer problem). I have installed version 3.3 and the problems related to this thread are still there. The price always stays at "0.0000" and it is affecting my Products Attributes Mod. Anyone have any ideas?

 

Thanks,

David

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