Melhor Posted September 11, 2010 Posted September 11, 2010 Is it possible to setup a shop that takes his products out other databases? thx Kozak
Guest Posted September 11, 2010 Posted September 11, 2010 Kozak, You MAY be able to accomplish this, but as George stated in your other post on this topic, it is easier to link to ONE database. As of right now, I do not believe there is any contribution that would allow you to access several databases from one store. Chris
Melhor Posted September 12, 2010 Author Posted September 12, 2010 thanks for reply, I dont want access to several databases, just the products has to been shown in the mainsite
radu34 Posted September 14, 2010 Posted September 14, 2010 Hello. I am beginner in osCommerce and I want to create a Multi Store shop, but with the possibility of admin / Categories / Products / New Product / insert to write multi database. Databases have different host. Eg Site 1 (insert_global )------------------> Site2 (ip 1.0.0.2) I Ip1.0.0.1 -----------------> Site3 (ip1.0.0.3) I tried to change in admin / categories.php Code: $sql_data_array = array_merge($sql_data_array, $insert_sql_data); // get category name if ($current_category_id) { $cat_qry = tep_db_query("select `categories_name` from " . TABLE_CATEGORIES_DESCRIPTION . " where `categories_id` = " . (int)$current_category_id); $cat_name = tep_db_result($cat_qry, 0, "categories_name"); $cat_qry = tep_db_query("select `parent_id` from " . TABLE_CATEGORIES . " where `categories_id` = " . (int)$current_category_id); $cat_parent = tep_db_result($cat_qry, 0, "parent_id"); } tep_db_close(); // save global mode $save_global = (isset($HTTP_POST_VARS['save_global']) ? (bool)$HTTP_POST_VARS['save_global'] : false); if ($save_global) { if ($_databases) { foreach ($_databases as $db) { // set a new database connection tep_db_connect($db['DB_SERVER'], $db['DB_SERVER_USERNAME'], $db['DB_SERVER_PASSWORD'], $db['DB_DATABASE']); // insert the product in the new database tep_db_perform(TABLE_PRODUCTS, $sql_data_array, 'insert', ''); $_prod_id = tep_db_insert_id(); if ($cat_name) { // check to see if category exists on this remote db $_qry = tep_db_query("select `categories_id` from " . TABLE_CATEGORIES_DESCRIPTION . " where `categories_name` = '" . $cat_name . "'"); $_cat_id = (tep_db_num_rows($_qry) ? (int)tep_db_result($_qry, 0, "categories_id") : 0); if (!$_cat_id) { // if not, add it // get romanian language id $_lang_qry = tep_db_query("select `languages_id` from `" . TABLE_LANGUAGES . "` where `code` = 'ro'"); $_lang_id = (tep_db_num_rows($_lang_qry) ? (int)tep_db_result($_lang_qry, 0, "languages_id") : 1); // if lang ro does not exist, set it to first language // add category tep_db_query("insert into " . TABLE_CATEGORIES . " (parent_id, date_added) values(" . $cat_parent . ", NOW())"); $_cat_id = tep_db_insert_id(); // add category name tep_db_query("insert into " . TABLE_CATEGORIES_DESCRIPTION . " (categories_id, language_id, categories_name) values(" . $_cat_id . ", " . $_lang_id . ", '" . $cat_name . "')"); } // make products-categories link tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$_prod_id . "', '" . (int)$_cat_id . "')"); } tep_db_close(); } } } tep_db_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD, DB_DATABASE); Sure appreciate any help. Thank you
Melhor Posted September 21, 2010 Author Posted September 21, 2010 Hi Radu, do you find a solution to write 1 shop with several databases? Grtz Kozak
Recommended Posts
Archived
This topic is now archived and is closed to further replies.