VyReN Posted January 10, 2003 Author Share Posted January 10, 2003 I am having one problem... A customer_group will not appear on the catagories.php page until I go into the database and edit the customers table and change customers_group_id to the correct ID. It adds customer_group_name correctly, but not the ID. Other than this (Which may very well be another mistake on my part) everything is working perfectly... Thanks for the contrib! Quote Link to comment Share on other sites More sharing options...
VyReN Posted January 10, 2003 Author Share Posted January 10, 2003 Son of a ... Yes, again, my fault. I never could follow simple directions. I *SWEAR* no more working on the website after midnight. I guess the one good thing was finding a very real possibility of contribs messing with each other using the POST vars. Everyone should avoid common words (Such as 'price')... AH WELL. Thanks all! Quote Link to comment Share on other sites More sharing options...
ocularmagic Posted January 10, 2003 Share Posted January 10, 2003 Everyone should avoid common words (Such as 'price') I'll definitely do that in future mods. Thanks and sorry for the inconvenience. Quote 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 More sharing options...
frog Posted January 18, 2003 Share Posted January 18, 2003 Hello to all! I am writing a little modification to this mod to allow a per group percentage of discount when it will be finished i'll post it into contributions It is very basic but it works for me.... just one thing....when i have a new client and i put him into a non existent group (so i create a new group) the field customers_group_id on table "customers" is always initialized as 1. This prevents to create 'per groups discount' and to alter per groups price in categories.php suggestions? thanks Quote Link to comment Share on other sites More sharing options...
frog Posted January 18, 2003 Share Posted January 18, 2003 Hello to all! just one thing....when i have a new client and i put him into a non existent group (so i create a new group) the field customers_group_id on table "customers" is always initialized as 1. This prevents to create 'per groups discount' and to alter per groups price in categories.php suggestions? thanks Don't know if Iam wrong but: $multiple_groups_query = tep_db_query("select distinct customers_group_id from " . TABLE_PRODUCTS_GROUPS . " "); // select the single type of customer while ($group_ids = tep_db_fetch_array($multiple_groups_query)) { // if it is more than one group (the retail) have a loop $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'] . "'"); } } // just one customer? $customers_group_name = tep_db_prepare_input($HTTP_POST_VARS['customers_group_name']); $counter = 1; // counter is initilized at 1 and it remains at one: if you change it manually // to 1423 the new group has a customers_group_id of 1423 // even if $counter should increment to the bigger customers_group_id +1 any suggestion? thanks Quote Link to comment Share on other sites More sharing options...
Kristofor Posted January 20, 2003 Share Posted January 20, 2003 mmmm... i never got that problem but all i know is mine isnt retaining more then one set of seperate prices. Quote Don't die with the music in you!!! Failure is just another boundary to sucess!!! But that doesn't mean your getting somewhere... Link to comment Share on other sites More sharing options...
frog Posted January 20, 2003 Share Posted January 20, 2003 mmmm... i never got that problem but all i know is mine isnt retaining more then one set of seperate prices. Thanks for Your reply can You try with more than one? thanks Quote Link to comment Share on other sites More sharing options...
Kristofor Posted January 20, 2003 Share Posted January 20, 2003 yeh i can try with more then one but when i put the second seperate price it changes into the first seperat price Quote Don't die with the music in you!!! Failure is just another boundary to sucess!!! But that doesn't mean your getting somewhere... Link to comment Share on other sites More sharing options...
ocularmagic Posted January 20, 2003 Share Posted January 20, 2003 frog Without having the code in front of me, I may be wrong, but somewhere in the code when a new group is created, there is a query to the database to see what group_ids there are so far. Then when the new group is made it is assigned a value equal to one plus that value. Make sense? If that's not in there, I screwed up somewhere. I haven't heard anything like this from anyone else that I can remember. Can you tell me what file and lines that code is from? I will compare it to mine and see what the difference is. Kristofor I still haven't been able to look into your problem and I apologize for that. I'm swamped with moving things on my end. I know I ran into your problem before but I thought I had it fixed. I hope it's not something to do with code changes in other files. What snapshot are you using? Quote 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 More sharing options...
Kristofor Posted January 20, 2003 Share Posted January 20, 2003 thats cool, i know you fixed those file for me but i had the same result, its not really urgent at the moment caus ei can survive with only the one extra price. i was just wonmdering thats all. ok thanks Quote Don't die with the music in you!!! Failure is just another boundary to sucess!!! But that doesn't mean your getting somewhere... Link to comment Share on other sites More sharing options...
frog Posted January 21, 2003 Share Posted January 21, 2003 frog Without having the code in front of me, I may be wrong, but somewhere in the code when a new group is created, there is a query to the database to see what group_ids there are so far. Then when the new group is made it is assigned a value equal to one plus that value. Make sense? If that's not in there, I screwed up somewhere. I haven't heard anything like this from anyone else that I can remember. Can you tell me what file and lines that code is from? I will compare it to mine and see what the difference is. The file is admin/customers.php and in the query the value of customer table in customers_group_id is always = $counter (counter is =1 always) I am using the alternativa attribute handling contribution and patched as seen on this thread thanks Quote Link to comment Share on other sites More sharing options...
CyberOto Posted January 21, 2003 Share Posted January 21, 2003 This may sound stupid - can one post a link for download ? Quote Link to comment Share on other sites More sharing options...
ocularmagic Posted January 21, 2003 Share Posted January 21, 2003 CyberOto http://www.oscommerce.com/community/contri...ions,716/page,8 Frog I can't seem to find the code you mentioned unless you are doing an upgrade from a previous version or something. Here is the installation straight from the "Fresh Install" doc for admin/customers.php admin/customers.php Around line 25 After: case 'update': $customers_id = tep_db_prepare_input($HTTP_GET_VARS['cID']); $customers_firstname = tep_db_prepare_input($HTTP_POST_VARS['customers_firstname']); $customers_lastname = tep_db_prepare_input($HTTP_POST_VARS['customers_lastname']); $customers_email_address = tep_db_prepare_input($HTTP_POST_VARS['customers_email_address']); $customers_telephone = tep_db_prepare_input($HTTP_POST_VARS['customers_telephone']); $customers_fax = tep_db_prepare_input($HTTP_POST_VARS['customers_fax']); $customers_newsletter = tep_db_prepare_input($HTTP_POST_VARS['customers_newsletter']); Add: $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'] . "'"); } } $customers_group_name = tep_db_prepare_input($HTTP_POST_VARS['customers_group_name']); $counter = 0; $assigned = 0; $customers_group_name_query = tep_db_query("select distinct customers_group_name, customers_group_id from " . TABLE_CUSTOMERS . " order by customers_group_id"); while ($group_name_check = tep_db_fetch_array($customers_group_name_query)) { $counter = $group_name_check['customers_group_id']; if ($group_name_check['customers_group_name'] == $customers_group_name) { $customers_group_id = $group_name_check['customers_group_id']; $assigned = 1; break; } ++$counter; } if ($assigned == 0) { $customers_group_id = $counter; } Around line 55 After: $sql_data_array = array('customers_firstname' => $customers_firstname, 'customers_lastname' => $customers_lastname, 'customers_email_address' => $customers_email_address, 'customers_telephone' => $customers_telephone, 'customers_fax' => $customers_fax, 'customers_newsletter' => $customers_newsletter, Add: 'customers_group_id' => $customers_group_id, 'customers_group_name' => $customers_group_name); BE SURE TO MOVE THE SEMICOLON AND PARENTHESIS FROM AFTER $customers_newsletter AND REPLACE IT WITH A COMMA TO MAKE THE ASSIGNMENT CORRECT!!!! Around line 120 After: if ($HTTP_POST_VARS['delete_reviews'] == 'on') { $reviews_query = tep_db_query("select reviews_id from " . TABLE_REVIEWS . " where customers_id = '" . tep_db_input($customers_id) . "'"); while ($reviews = tep_db_fetch_array($reviews_query)) { tep_db_query("delete from " . TABLE_REVIEWS_DESCRIPTION . " where reviews_id = '" . $reviews['reviews_id'] . "'"); } tep_db_query("delete from " . TABLE_REVIEWS . " where customers_id = '" . tep_db_input($customers_id) . "'"); } else { tep_db_query("update " . TABLE_REVIEWS . " set customers_id = null where customers_id = '" . tep_db_input($customers_id) . "'"); } Add: $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 275 Find: $customers_query = tep_db_query("select c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, 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_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 = '" . $HTTP_GET_VARS['cID'] . "'"); Change to: $customers_query = tep_db_query("select c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, 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_name, 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 = '" . $HTTP_GET_VARS['cID'] . "'"); Right after the above line add: $existing_customers_query = tep_db_query("select distinct customers_group_name from " . TABLE_CUSTOMERS . " order by customers_group_id "); Around line 430 After: <tr> <td class="main"><?php echo ENTRY_NEWSLETTER; ?></td> <td class="main"><?php echo tep_draw_pull_down_menu('customers_newsletter', $newsletter_array, $cInfo->customers_newsletter); ?></td> </tr> Add: <tr> <td class="main"><?php echo ENTRY_CUSTOMERS_GROUP_NAME; ?></td> <td class="main"><?php echo tep_draw_input_field('customers_group_name', $cInfo->customers_group_name, 'maxlength="25"'); ?></td> </tr> <tr> <td class="main"><?php $index = 0; echo ("Existing Groups: "); while ($existing_customers = tep_db_fetch_array($existing_customers_query)) { echo ($existing_customers['customers_group_name']); echo (", "); ++$index; if ($index%10 == 0) { echo (" "); } }?> </td> </tr> I can't find the code you posted anywhere in the new docs. Is it from a past version? If so you should upgrade to the latest one as I've screwed up a few things. Quote 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 More sharing options...
Guest Posted July 28, 2003 Share Posted July 28, 2003 does thies work in the new milestone !? Reagrds Thorsten Quote Link to comment Share on other sites More sharing options...
mreish Posted July 29, 2003 Share Posted July 29, 2003 Hi Thorsten, I'm running MS2 and it almost works. Soooo close. I know that if I actually knew what I was doing with PHP that it'd be solved but I'm just not very bright. Maybe someone else can help us out here? Quote Roadracing makes heroin addiction look like a vague wish for something salty. Link to comment Share on other sites More sharing options...
Guest Posted July 30, 2003 Share Posted July 30, 2003 where is the problem :?: Quote Link to comment Share on other sites More sharing options...
mreish Posted July 30, 2003 Share Posted July 30, 2003 Well now I'm not so sure. At first I thought it wasn't reading the price for each group in. Now I look at the products_groups table and notice the customers_group_price field isn't getting updated. That means all my theories have just gone out the window. I recall (maybe in this thread even) something about the admin side not working properly but I'll have to read more. Maybe someone else has the solution already. If I edit the customers_group_price field by hand it works like a charm! Quote Roadracing makes heroin addiction look like a vague wish for something salty. Link to comment Share on other sites More sharing options...
Guest Posted July 30, 2003 Share Posted July 30, 2003 you mean it does not show the price on the catalog side as in 0.00 or maybe nothing !? mayby link ? Quote Link to comment Share on other sites More sharing options...
Guest Posted July 30, 2003 Share Posted July 30, 2003 give us some info :!: :?: no use saying my newsletter does not work :!: :?: :idea: :wink: Quote Link to comment Share on other sites More sharing options...
mreish Posted July 30, 2003 Share Posted July 30, 2003 Actually it seems to be working now. I did notice that the products_groups table was empty so I filled that in by hand via myPHPadmin. Now I can add groups through the admin panel. Works pretty well actually. Now, we don't use newsletter (yet) so I don't know if that's boogered or not. Not much help, I know. Sorry. I'll keep experiementing. Quote Roadracing makes heroin addiction look like a vague wish for something salty. Link to comment Share on other sites More sharing options...
TheFinnisher Posted August 11, 2003 Share Posted August 11, 2003 Has anyone here stumbled upon this?? The separate/individual prices show up fine everywhere and are processed properly. Only in the shopping cart the sub-total is calculated by the "real" prices... or is it only me? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.