♥ecartz Posted March 1, 2004 Share Posted March 1, 2004 This is the support thread for the 1.2 version of http://www.oscommerce.com/community/contributions,577 Quote Always back up before making changes. Link to comment Share on other sites More sharing options...
azer Posted March 2, 2004 Share Posted March 2, 2004 (edited) would it be possible to share a demo virtual shop for memeber to try the features added ? thanks in advance for your work by the way , why , dont we continue on : http://www.oscommerce.com/forums/index.php?showtopic=23246 Edited March 2, 2004 by azer Quote MS2 Link to comment Share on other sites More sharing options...
♥ecartz Posted March 3, 2004 Author Share Posted March 3, 2004 by the way , why , dont we continue on :The forum moderators have asked that we start new threads with each new version of the contribution. This helps avoid the 40 page threads of some older contributions. Thanks for posting the older thread link. It is useful for reference purposes. Cheers, Matt Quote Always back up before making changes. Link to comment Share on other sites More sharing options...
pengrus Posted March 11, 2004 Share Posted March 11, 2004 I would also like to see an example site if there is no demo available. Thank you! Quote Link to comment Share on other sites More sharing options...
gelali Posted March 23, 2004 Share Posted March 23, 2004 (edited) Hi Matt, I have installed the latest one on a modified cart. No errors, except it does not allow me to enter the admin side. I tried the user name and password in the sql file you included, no luck. I even inserted new user name and password in the table, still no luck. please help. Terry Edited March 23, 2004 by gelali Quote Link to comment Share on other sites More sharing options...
gelali Posted March 23, 2004 Share Posted March 23, 2004 Ok, never mind, I found it in the administrators contribution you integrated it with. Thanks, Terry Quote Link to comment Share on other sites More sharing options...
gelali Posted March 23, 2004 Share Posted March 23, 2004 It is me again, In the instruction, you said I should create top category for each store with same name, how would I do that? When I create new category it does not let me choose under which store it should be? Terry Quote Link to comment Share on other sites More sharing options...
con4mity Posted May 2, 2004 Share Posted May 2, 2004 what was the password, I can't find it, and I can't find the older access version that it originated from either. Thanks in advance. Quote Link to comment Share on other sites More sharing options...
lost1 Posted May 4, 2004 Share Posted May 4, 2004 Hi, I thought I had successfully installed this virtual mall release over top of an already existing os commerce set-up that I have also running image_html_package_1.2. I had to make some additional alterations to the categories page, and make my own changes to the products already in the database. I am not sure if I've missed something, or messed up something. I added 3 stores which I set up with a matching top level category I put their products in. Products all have store_id. I set up an additional administrator through the tool with only catalog access and limiting them to their own store. All 3 categories/stores showed up in my_products area. When I went to the 3rd store to administer logged in as the other admin. I was able to edit categories and products in the third store not belonging to the user I was logged in as. :unsure: I hope this makes sense-my brain's a bit scrabled from all this--Can someone give me a clue to where my error may be? Thanks! Quote Link to comment Share on other sites More sharing options...
♥ecartz Posted May 4, 2004 Author Share Posted May 4, 2004 I would try checking the query lines. That's where the restriction is. Also check that the store ID is being set by the login process properly. Hth, Matt Quote Always back up before making changes. Link to comment Share on other sites More sharing options...
lost1 Posted May 4, 2004 Share Posted May 4, 2004 Thanks for the speedy reply! will do. Quote Link to comment Share on other sites More sharing options...
Yari Gio Posted May 13, 2004 Share Posted May 13, 2004 Arrg, Big problems, after making all the modifications to the files as requested in mall_instr_update.txt then installed oscom as normal but when i go in to the catelog i get: Categories 1146 - Table 'velond5_oscom.products' doesn't exist select count(*) as total from products p, products_to_categories p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '1' and when i open the admin tool i get: Administration | Online Catalog | Support Site osCommerce Support Site Support Forums Mailing Lists Bug Reports FAQ Live Discussions CVS Repository Information Portal Orders Pending: 0 Processing: 0 Delivered: 0 1146 - Table 'velond5_oscom.products' doesn't exist select count(*) as count from products where products_status = '1' [TEP STOP] I have no idea why im getting that. Also there was no instructions as to what to do with the rest of the files in the catalog folder nor what to do with "Administrators.sql". What should i be doing with these files and what might of whent wrong above ? Please help Quote Link to comment Share on other sites More sharing options...
♥ecartz Posted May 13, 2004 Author Share Posted May 13, 2004 Did you get any errors during the osCommerce install? It's saying that it can't find one of the basic osCommerce tables. I would check that the tables were created properly with something like phpMyAdmin. You would upload the Adminstrators.sql file with phpMyAdmin or similar utility. Copy all the PHP files to the equivalent places in the store's admin area. Hth, Matt Quote Always back up before making changes. Link to comment Share on other sites More sharing options...
Yari Gio Posted May 13, 2004 Share Posted May 13, 2004 I did not get any kind of errors during the installation but im wondering if it's part of the manula changes i made to the files. I will try to remake them this morning and hopefully it goes smooth. I'll let you know in 20. Quote Link to comment Share on other sites More sharing options...
con4mity Posted May 13, 2004 Share Posted May 13, 2004 I'm working on this also. And after several weeks of checking and rechecking, I can't find out what I did that isn't enforcing the restricts to store admins, all my admins can edit all products. It says above to check the queries, can you be more specific? Also, rather than assign a top level category to each store, I'd like to have just regular categories and my vendors able to add products to any category. Anyone know of a good way to facilitate this? I really want one store with independant administrators. Quote Link to comment Share on other sites More sharing options...
Yari Gio Posted May 13, 2004 Share Posted May 13, 2004 Alright, deleted the data base and started over again. Installed all the files from the download (virtual_mall v 1.2) in to the respective category. Then made all of the changes as per instructions and then i tryed to upload and run Administrators.sql and i get this error in myphpadmin: SQL-query : ALTER TABLE `products` ADD `store_id` INT( 11 ) DEFAULT '0' NOT NULL AFTER `manufacturers_id` MySQL said: #1146 - Table 'velond5_oscom.products' doesn't exist And if i try to get to the catalog i get the catalog page but on the left side all i see is: Categories 1146 - Table 'velond5_oscom.products' doesn't exist select count(*) as total from products p, products_to_categories p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '1' [TEP STOP] And if i try to log in to the admin area i do get the admin log in screen now but i do not know the pass word or log in name and admin@localhost / admin does not work. Sorry for the newbee questions and thanks upfront for all your help. Quote Link to comment Share on other sites More sharing options...
con4mity Posted May 13, 2004 Share Posted May 13, 2004 deleted the data base and started over again. Installed all the files from the download (virtual_mall v 1.2) in to the respective category. Then made all of the changes as per instructions and then i tryed to upload and run Administrators.sql and i get this error in myphpadmin: SQL-query : ALTER TABLE `products` ADD `store_id` INT( 11 ) DEFAULT '0' NOT NULL AFTER `manufacturers_id` MySQL said: #1146 - Table 'velond5_oscom.products' doesn't exist Well, if you deleted the database and didn't recreate it using the script prior to running the administrator.sql script then the 'product' in fact doesn't yet exist, and your errors are normal. But you actually have to run the first script, and then modify the administrator.sql a bit. It doesn't work right as is. Quote Link to comment Share on other sites More sharing options...
Yari Gio Posted May 13, 2004 Share Posted May 13, 2004 (edited) What script should i be running after running the normal installation of OSCom ? and do you rember off hand what changes are needed to the administrator slq to get things to run right ? Thanks Edited May 13, 2004 by Yari Gio Quote Link to comment Share on other sites More sharing options...
Yari Gio Posted May 13, 2004 Share Posted May 13, 2004 I just ran the installation with out making any mods (so basicaly a tottaly clean installation of OScom) and the products table was created perfectly. I'm wondering if there is just something in the changes that are made for the store that i'm doing wrong. Also would i be better off not installing the admin part of this contribution and getting a newer version of multi admin/ access ? Quote Link to comment Share on other sites More sharing options...
Yari Gio Posted May 13, 2004 Share Posted May 13, 2004 Just realized, do i need to have a difirent version of osc comm ? i have 2.2 ME (the clean download from oscommerce.com. Quote Link to comment Share on other sites More sharing options...
Yari Gio Posted May 14, 2004 Share Posted May 14, 2004 Alright!!! Got some where, I was able to get the admin module working. Now i just need to figure out why the products category is not getting created. Any one have any insight as to where i should look for an answer ? This is the error i get when i look at the admin module: 1146 - Table 'velond5_oscom.products' doesn't exist select count(*) as count from products where products_status = '1' [TEP STOP] And this is on the catalog page: 1146 - Table 'velond5_oscom.products' doesn't exist select count(*) as total from products p, products_to_categories p2c where p.products_id = p2c.products_id and p.products_status = '1' and p2c.categories_id = '1' [TEP STOP] Also, if i manage to get to the stores page i get this message: TEXT_DISPLAY_NUMBER_OF_STORES So I figure that for some reason the create part of the tables stops short at products or something ... Thanks ahead for the help. Quote Link to comment Share on other sites More sharing options...
con4mity Posted May 14, 2004 Share Posted May 14, 2004 Well, I basically merged the administrators.sql before I did the install. I've documented my way in this version of instructions, which I made myself, so have a peak at the oscommerce.sql changes mostly, but this might not be perfect. ***** mail_instr_update_plus_admin.txt ********************** ---- UPDATED INFORMATION STARTS HERE -------- Copy the included files (admin/stores.php, admin/includes/languages/english/stores.php) into their correct directories. Administration section changes admin/categories.php a) In the section for "update products" (line 206), change the sql_data_array compilation 'manufacturers_id' line (222) from: 'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id'])); to (lines 222-3): 'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']), 'store_id' => tep_db_prepare_input($HTTP_POST_VARS['store_id'])); B) In the product query line (Line 378), add ", p.store_id" into the query following ", p.manufacturers_id" and before the "from" statement. c) After the manufacturers array retrieval (line 388-93) add the following code: $store_array =array(array('id' => '', 'text' => TEXT_NONE)); $store_query=tep_db_query("SELECT store_name, store_id FROM " . TABLE_STORES . " order by store_name"); while ($stores = tep_db_fetch_array($store_query)) { $store_array[] = array('id' => $stores['store_id'], 'text' => $stores['store_name']); } d) Add another line into the table to hold the store link after the manufacturers link in the left column box (line 492-98) <td class="main"><?php echo TEXT_PRODUCTS_STORE; ?></td> <td class="main"><?php echo tep_draw_separator('pixel_trans_gif', '24', '15') . ' ' . tep_draw_pull_down_menu('store_id', $store_array, $pInfo->store_id); ?></td> admin/includes/filenames.php a) Add a line (about 32) define('FILENAME_MY_PRODUCTS', 'my_products.php'); B) Add a line (about 47) define('FILENAME_STORES', 'stores.php'); admin/includes/database_tables.php a) Add a line (about 16) define('TABLE_ADMINISTRATORS', 'administrators'); B) Add a line (about 52) define('TABLE_STORES', 'stores'); admin/includes/boxes/catalog.php a) After the manufacturers line (about 26), add the following link for the store entry page: '<a href="' . tep_href_link(FILENAME_STORES, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_STORES . '</a><br>' . admin/includes/languages/english.php a) After the definition for CATALOG_MANUFACTURERS (line 74) add the line: define('BOX_CATALOG_STORES', 'Stores'); B) After the definition for TEXT_DISPLAY...SPECIALS (line 273) add the line: define('TEXT_DISPLAY_NUMBER_OF_STORES', 'Displaying <b>%d</b> to <b>%d</b> (of <b>%d</b> stores)'); admin/includes/languages/english/categories.php a) after the definition for TEXT_PRODUCTS_MANUFACTURER (line 75) add the line: define('TEXT_PRODUCTS_STORE', 'Store Location'); Catalog section changes Catalog/checkout_process.php a) when updating the orders_products tables for bestsellers, add the following line to retrieve the store id, after the products_tax line (about 166) in the sql retrieval string: 'store_id' => $order->$products[$i]['store_id'] B) after adding the current product into the running total string (line 220) add the following array declaration/assignment to fill an associative array with elements for purchases from individual stores: $store_index = $order->products[$i]['store_id'] if (!is_array($store_totals[$store_index])) { $store_totals[$store_index] = array(); $store_totals[$store_index]['store_id'] = $store_index; } //------- Stuff the store array with the data needed to create individual store emails------ $store_totals[$store_index]['store_products'] .= $order->products[$i]['qty'] . ' x ' . $order->products[$i]['name'] . ' (' . $order->products[$i]['model'] . ') = ' . $currencies->display_price($order->products[$i]['final_price'], $order->products[$i]['tax'], $order->products[$i]['qty']) . $products_ordered_attributes . "\n"; $store_totals[$store_index]['store_weight'] += ($order->products[$i]['qty'] * $order->products[$i]['weight']); $store_totals[$store_index]['store_tax'] += tep_calculate_tax($total_products_price, $products_tax) * $order->products[$i]['qty']; $store_totals[$store_index]['store_cost'] += $total_products_price; } c) After the section to send extra order emails out, add the following code to send emails to each store owner: (Line 220) // now send emails to each individual store owner showing purchases from their shops $missing_store = ''; reset($store_totals); while(list($si) = each($store_totals)){ $store_info_query = tep_db_query("SELECT store_owner_fname, store_owner_lname, store_email_address FROM " . TABLE_STORES . " where store_id = '" . $store_totals[$si]['store_id'] . "'"); $store_info = tep_db_fetch_array($store_info_query); if (is_array($store_info)) { $email_order = STORE_NAME . "\n" . EMAIL_SEPARATOR . "\n" . EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" . EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n"; if ($order->info['comments']) { $email_order .= $order->info['comments'] . "\n\n"; } $email_order .= EMAIL_TEXT_PRODUCTS . "\n" . EMAIL_SEPARATOR . "\n" . $store_totals[$si]['store_products'] . EMAIL_SEPARATOR . "\n"; $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" . EMAIL_SEPARATOR . "\n" . tep_address_label($customer_id, $sendto, 0, '', "\n") . "\n\n"; if (is_object($$payment)) { $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . EMAIL_SEPARATOR . "\n"; $payment_class = $$payment; $email_order .= $payment_class->title . "\n\n"; if ($payment_class->email_footer) { $email_order .= $payment_class->email_footer . "\n\n"; } } tep_mail($store_info['store_owner_fname'] . ' ' . $store_info['store_owner_lname'], $store_info['store_email_address'], EMAIL_TEXT_SUBJECT, nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, ''); } else { /* $fp = fopen("./mailit.txt", "a+"); fwrite($fp, "No query retrieved for order " . $si . "\n"); fwrite($fp, "Store ID: " . $store_totals[$si]['store_id'] . "\n"); fwrite($fp, $store_info_query . "\n"); fclose($fp);*/ // this section doesn't work in all setups, uncomment if you prefer file logging $missing_store .= STORE_MISSING . $store_totals[$si]['store_id'] . "\n"; } } d) After the line that emails the customer (around line 317, shown here): tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS); Add: $email_order .= $missing_store; The next line should check if SEND_EXTRA_ORDER_EMAILS_TO is set. IMO you should always have SEND_EXTRA_ORDER_EMAILS_TO set if you are using the contribution in this way. YMMV. catalog/product_info.php a) On line 72, add the following into the query, after p.manufacturers_id: , p.store_id B) Add the following hidden input to the "in cart" button (Line 213) . tep_draw_hidden_field('store_id', $product_info['store_id']) catalog/includes/database_tables.php a) Add the definition: define('TABLE_STORES', 'stores'); catalog/includes/classes/order.php a) add the line: 'store_id' => $products[$i]['store_id'], into the products array (Line 223) catalog/includes/classes/shopping_cart.php a) Add the store_id into the products query (Line 273): , p.store_id B) add the line: 'store_id' => $products['store_id'], into the products_array array. (Line 288) catalog/install/oscommerce.sql a.) Add the following table definition DROP TABLE IF EXISTS administrators; CREATE TABLE administrators ( administrators_id int(11) DEFAULT '0' NOT NULL auto_increment, store_id int(11) DEFAULT '0' NOT NULL, administrators_username varchar(20) NOT NULL, administrators_password varchar(40) NOT NULL, administrators_allowed_pages varchar(255) DEFAULT '*' NOT NULL, PRIMARY KEY (administrators_id) ); INSERT INTO administrators VALUES ( '1', 'admin', '21232f297a57a5a743894a0e4a801fc3', '*'); DROP TABLE IF EXISTS stores; CREATE TABLE stores ( store_id int NOT NULL auto_increment, store_name varchar(40) NOT NULL, store_image varchar(64), store_owner_fname varchar(25) NOT NULL, store_owner_lname varchar(30) NOT NULL, store_email_address varchar(40) NOT NULL, store_add_one varchar(50) NOT NULL, store_add_two varchar(50), store_city varchar(30) NOT NULL, store_state varchar(15) NOT NULL, store_zipcode varchar(10) NOT NULL, store_country varchar(30) NOT NULL, store_telephone varchar(15) NOT NULL, store_fax varchar(15), date_added datetime, last_modified datetime, PRIMARY KEY (store_id) ); INSERT INTO stores VALUES (1, 'High Tide Aquatics', '', 'Joe', 'Smith', 'nowhere@4u.com', '1234 Anywhere St.', '', 'Location', 'Co', '12345', 'USA', '5551212', '', now(), now()); ALTER TABLE `products` ADD `store_id` INT( 11 ) DEFAULT '1' NOT NULL AFTER `manufacturers_id` ; ALTER TABLE `orders_products` ADD `store_id` INT( 11 ) NOT NULL AFTER `orders_id` ; INSERT INTO `configuration` ( `configuration_id` , `configuration_title` , `configuration_key` , `configuration_value` , `configuration_description` , `configuration_group_id` , `sort_order` , `last_modified` , `date_added` , `use_function` , `set_function` ) VALUES ( '', 'E-Mail Address for Category Changes', 'CATEGORIES_EMAIL_ADDRESS', 'root@localhost', 'The E-Mail Address to which store owners will email any needed category changes.', '1', '25', '2004-02-27 20:39:56', 'NOW()', NULL , NULL ); This step I just removed. In the ALTER TABLBE 'products' line above I changed the default to '1' so that they are 1 when the column is created. Now all the products currently in the catalog will be assigned to the store created in the INSERT INTO stores statement. But I left this here for example purposes. B) In all the insertions of demonstration products, add a value of 1 after the last current value. Example: INSERT INTO products VALUES (1,32,'MG200MMS','matrox/mg200mms.gif',299.99, now(),null,'',23.00,1,1,1,0,1); ********** END .txt ************************ Let me know how that works. But do all this to the docs before an install, and it should work out for you. Quote Link to comment Share on other sites More sharing options...
Yari Gio Posted May 14, 2004 Share Posted May 14, 2004 con4mity, thanks a TUN. Give me a few mins and i will give this a try and report back. Quote Link to comment Share on other sites More sharing options...
con4mity Posted May 14, 2004 Share Posted May 14, 2004 Here is my full instru if you want to have it. I fixed a few things, like the admin password hash, removed redundancies in the sql scripts, and kinda standardized the way the instructions where formated. http://www.ecorey.com/mall_instr_update_plus_admin.txt Quote Link to comment Share on other sites More sharing options...
Yari Gio Posted May 14, 2004 Share Posted May 14, 2004 Haa that worked perfectly. The only problem was that at the end i could not log in with admin/admin so i ran under slq: DROP TABLE IF EXISTS administrators; CREATE TABLE administrators ( administrators_id int(11) DEFAULT '0' NOT NULL auto_increment, administrators_username varchar(20) NOT NULL, administrators_password varchar(40) NOT NULL, administrators_allowed_pages varchar(255) DEFAULT '*' NOT NULL, PRIMARY KEY (administrators_id) ); INSERT INTO administrators VALUES ( '1', 'admin', '21232f297a57a5a743894a0e4a801fc3', '*'); and then ALTER TABLE `administrators` ADD `store_id` INT( 11 ) DEFAULT '0' NOT NULL ; and that worked perfect. I'm in and it looks like everything is working perfectly. Thanks for all the help. 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.