Jump to content
Sign in to follow this  
sputniknet

Multi-Store with RC2a

Recommended Posts

Thanks to everyone for posting their fixes!

 

I've been trying to make Multi-Store work with RC2a version of OScommerce. After reading through lots of postings, I hope this will sum up the errors & fixes encountered so far.

 

Using my own PC as a test setup, running VISTA with WAMP v2.0

 

So far:

 

1) unzipped OScomm file

2) copied entire CATALOG folder to WAMP's folder ('www' or 'public_html' or etc....)

3) copied entire CATALOG folder of Multistore v2.0 & write over the default OScomm folder

4) ran the INSTALL > fill in the info for your database, etc...

5) ran the UPDATE.SQL file in phpMyAdmin that will modify the database

6) tried to access ADMIN > ran into the 'register_globals are off' alert > In 'catalog/admin' folder, I edited the '.htacess' file

-- you will see on the last line "#php_value register_globals 1" > just delete the "#"

7) ran into the "includes/english/language... failed to open stream" error > In 'catalog/admin/includes/application_top.php'

-- around line 193 = "$current_page = basename($PHP_SELF);"

-- change to = "$current_page = basename($_SERVER['PHP_SELF']);"

8) after loggin admin, still displayed weird titles on the page, like "TEXT_BOX_HEADING" > In 'catalog/admin/includes/languages/english.php'

-- look for = "define('BOX_HEADING_CONFIGURATION', 'Configuration');"

-- add this below that line = "define('BOX_CONFIGURATION_ADMINISTRATORS', 'Administrators');"

9) ran into PHP code '} echo {....' displaying when you try to access the Administrators/Distributors left-side menu

-- In 'catalog/admin/administrators.php'

-- around line 454 = "<?"

-- change to = "<?php"

10) made sure on left-side menu, Configurations/Multi-stores, to input the correct paths

11) made sure on left-side menu, chose & added categories and added products (using default products for now)

 

I am at this point, so far it is working for now. Will try to add my 'second' store and see if things still works.

I will update as soon as possible.

 

Hope this helps anyone trying to install Multi-store with RC2a.


How much wood, would a woodchuck chuck wood, if a woodchuck could chuck wood?

 

My quest to make RC2a & Multi-store work together, click below:

http://forums.oscommerce.com/topic/349161-multi-store-with-rc2a/page__p__1459234#entry1459234

Share this post


Link to post
Share on other sites

I copied the CATALOG folder and created 'Store2' and 'Store3'.

-- for now, the ADMIN folder was not copied to the other stores

 

Per the instructions, I edited the 'admin/includes/configure.php'.

 

Per the instructions, I edited the 'catalog/includes/database_tables.php' at each store.

-- change = "define('TABLE_CONFIGURATION', 'configuration');" <---- default or Store1

-- change = "define('TABLE_CONFIGURATION', 'configuration2');" <---- Store2

-- change = "define('TABLE_CONFIGURATION', 'configuration3');" <---- Store3

 

But when trying to access the other stores via the URL, I got the "includes/english/.php... failed to open stream" errors.

The fix to this was to access the database with phpMyadmin:

-- select the "languages_to_stores" table

-- select "Insert" menu tab

-- add under "languages_id" > input "1" (for english, same for Store3)

-- add under "stores_id" > input "2" (for Store2, would input "3" for Store3)

-- repeat above for Store3

 

So now I can see Store2 and Store3 websites.

 

On left-side menu, CATALOG, I added categories & products to all 3 stores.

 

I can see all is working so far.

 

*** If you mess around with the "configuration" tables in your database, make sure you select "Browse" menu in each of them and check for

"Stores_ID". Make sure the "configuration_value" is set at the correct store number. ***

-- I messed around with that table and then notices the "Stores_ID" value was different than the store number

Example: STORES_ID = 5 >>> wrong <<<, suppose to be STORES_ID = 3 , for store number 3

Edited by sputniknet

How much wood, would a woodchuck chuck wood, if a woodchuck could chuck wood?

 

My quest to make RC2a & Multi-store work together, click below:

http://forums.oscommerce.com/topic/349161-multi-store-with-rc2a/page__p__1459234#entry1459234

Share this post


Link to post
Share on other sites

Added this addition (thanks to lifeisboost for this great addition!)

-- your choice to add this, but to me seems very helpful

 

 

In 'catalog/admin/categories.php' around line 965 look for =

"<td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' .

$products['products_id'] . '&action=new_product_preview&read=only') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif',

ICON_PREVIEW) . '</a> ' . $products['products_name']; ?>"

 

-- add this right after it on a new line =

"<td class="dataTableContent"><?php $stores_query_raw = "select stores_id,

stores_name from " . TABLE_STORES . ($admin_allowed_stores[0] == '*' ? " " : " where stores_id in(" . implode(',' ,

$admin_allowed_stores) . ") ") . "order by stores_id"; $stores_query = tep_db_query($stores_query_raw); while

($stores = tep_db_fetch_array($stores_query)) { $products_to_stores_query_raw = "select stores_id from " .

TABLE_PRODUCTS_TO_STORES . " where stores_id = '" . $stores['stores_id'] . "' and products_id =' ". $products['products_id']

."'"; $products_to_stores_query = tep_db_query($products_to_stores_query_raw); $products_to_stores =

tep_db_fetch_array($products_to_stores_query); if ($products_to_stores['stores_id'] == $stores['stores_id']) {echo

$stores['stores_name']; } } // rmh display category status in each store ?>"

 

-- when you look at the products in your categories, this mod will display "store1 store3 etc..." next to the products, so you can see

which products are included at each store

 

 

 

In 'catalog/admin/categories.php' around line 930 look for =

"<td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, tep_get_path($categories

['categories_id'])) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a> <b>' . $categories

['categories_name'] . '</b>'; ?></td>"

 

- add this right after it on a new line =

"<td class="dataTableContent"><?php $stores_query_raw = "select stores_id, stores_name from " . TABLE_STORES .

($admin_allowed_stores[0] == '*' ? " " : " where stores_id in(" . implode(',' , $admin_allowed_stores) . ") ") . "order by

stores_id"; $stores_query = tep_db_query($stores_query_raw); while ($stores = tep_db_fetch_array($stores_query))

{ $categories_to_stores_query_raw = "select stores_id from " . TABLE_CATEGORIES_TO_STORES . " where stores_id = '" .

$stores['stores_id'] . "' and categories_id =' ". $categories['categories_id'] ."'"; $categories_to_stores_query =

tep_db_query($categories_to_stores_query_raw); $categories_to_stores = tep_db_fetch_array

($categories_to_stores_query); if ($categories_to_stores['stores_id'] == $stores['stores_id']) {echo $stores

['stores_name']; } } // rmh display category status in each store ?>"

 

-- when you look at the categories, this mod will display "store1 store3 etc..." next to the categories, so you can see which

categories are included at each store

 

 

** Tested both and works great **

 

I'm at this point and I do still have some errors showing in the Admin pages, will post errors and fixes as I encounter them.


How much wood, would a woodchuck chuck wood, if a woodchuck could chuck wood?

 

My quest to make RC2a & Multi-store work together, click below:

http://forums.oscommerce.com/topic/349161-multi-store-with-rc2a/page__p__1459234#entry1459234

Share this post


Link to post
Share on other sites

Hope this helps anyone trying to install Multi-store with RC2a.

 

I found this part very helpful and I have no questions.

I copied the CATALOG folder and created 'Store2' and 'Store3'.

-- for now, the ADMIN folder was not copied to the other stores

At this moment I really stock and I have several questions.

1. Do I have to create 'Store2' and 'Store3' using absolutely the same catalog as Default Store has? This is what I did.

2. What database should I use? A new one or to install the same one as the Default Store has for 'Store2' and 'Store3'?

 

Per the instructions, I edited the 'catalog/includes/database_tables.php' at each store.

-- change = "define('TABLE_CONFIGURATION', 'configuration');" <---- default or Store1

-- change = "define('TABLE_CONFIGURATION', 'configuration2');" <---- Store2

-- change = "define('TABLE_CONFIGURATION', 'configuration3');" <---- Store3

Do I have to insert all of this bunch in every store's 'catalog/includes/database_tables.php'?, or just

"define('TABLE_CONFIGURATION', 'configuration');" in the 'catalog/includes/database_tables.php' only

"define('TABLE_CONFIGURATION', 'configuration2');" in the 'Store2/includes/database_tables.php' only

"define('TABLE_CONFIGURATION', 'configuration3');" in the 'Store3/includes/database_tables.php' only

 

But when trying to access the other stores via the URL, I got the "includes/english/.php... failed to open stream" errors.

I get this error, but "table_languages_to_stores" presents in each store's dadabase

1146 - Table 'store2.table_languages_to_stores' doesn't exist

select l.languages_id, l.name, l.code, l.image, l.directory from languages l LEFT JOIN TABLE_LANGUAGES_TO_STORES l2s ON l.languages_id = l2s.languages_id WHERE l2s.stores_id = '2' order by sort_order

Also I have couple of more questions, but they are useless without you answer, so I'm waiting for it impatiently. Thank you.

Share this post


Link to post
Share on other sites

I found this part very helpful and I have no questions.

 

At this moment I really stock and I have several questions.

1. Do I have to create 'Store2' and 'Store3' using absolutely the same catalog as Default Store has? This is what I did.

2. What database should I use? A new one or to install the same one as the Default Store has for 'Store2' and 'Store3'?

 

 

Do I have to insert all of this bunch in every store's 'catalog/includes/database_tables.php'?, or just

"define('TABLE_CONFIGURATION', 'configuration');" in the 'catalog/includes/database_tables.php' only

"define('TABLE_CONFIGURATION', 'configuration2');" in the 'Store2/includes/database_tables.php' only

"define('TABLE_CONFIGURATION', 'configuration3');" in the 'Store3/includes/database_tables.php' only

 

 

I get this error, but "table_languages_to_stores" presents in each store's dadabase

1146 - Table 'store2.table_languages_to_stores' doesn't exist

select l.languages_id, l.name, l.code, l.image, l.directory from languages l LEFT JOIN TABLE_LANGUAGES_TO_STORES l2s ON l.languages_id = l2s.languages_id WHERE l2s.stores_id = '2' order by sort_order

Also I have couple of more questions, but they are useless without you answer, so I'm waiting for it impatiently. Thank you.

 

To answer questions about the database:

1) yes, you do copy exactly the same 'catalog' folder from the first install and put in your other websites.

-- if your first ecommerce install was in 'www.hardcandies.com', then you copy everything in that 'catalog' folder over to your other website, like 'www.chocobars.com'. Repeat process for any other websites.

 

2) your other websites will use the SAME/SHARE database as the default store. Later you can add products that you can select/choose which store(website) that it will sell in.

 

 

Yes, you go into every store's catalog > edit the catalog/includes/database_tables.php

-- so in store2, you can name edit that file and change to > "define('TABLE_CONFIGURATION', 'configuration2');"

-- when you open 'database_tables.php' file, change this line "define('TABLE_CONFIGURATION', 'configuration');"

to this "define('TABLE_CONFIGURATION', 'configuration2');" for store2 and "configuration3" for store3, etc...

 

For that language to store error, do this below:

-- you need to set the 'language' for your other stores(store2 & store3)

-- and then make sure the 'store_id' is set correctly. store_id=2 will be store2, store_id=3 will be store3

 

>>>>>>>>>>>>>>>>>>>

But when trying to access the other stores via the URL, I got the "includes/english/.php... failed to open stream" errors.

The fix to this was to access the database with phpMyadmin:

-- select the "languages_to_stores" table

-- select "Insert" menu tab

-- add under "languages_id" > input "1" (for english, same for Store3)

-- add under "stores_id" > input "2" (for Store2, would input "3" for Store3)

-- repeat above for Store3

Edited by sputniknet

How much wood, would a woodchuck chuck wood, if a woodchuck could chuck wood?

 

My quest to make RC2a & Multi-store work together, click below:

http://forums.oscommerce.com/topic/349161-multi-store-with-rc2a/page__p__1459234#entry1459234

Share this post


Link to post
Share on other sites

To answer questions about the database:

1) yes, you do copy exactly the same 'catalog' folder from the first install and put in your other websites.

-- if your first ecommerce install was in 'www.hardcandies.com', then you copy everything in that 'catalog' folder over to your other website, like 'www.chocobars.com'. Repeat process for any other websites.

 

2) your other websites will use the SAME/SHARE database as the default store. Later you can add products that you can select/choose which store(website) that it will sell in.

 

 

Yes, you go into every store's catalog > edit the catalog/includes/database_tables.php

-- so in store2, you can name edit that file and change to > "define('TABLE_CONFIGURATION', 'configuration2');"

-- when you open 'database_tables.php' file, change this line "define('TABLE_CONFIGURATION', 'configuration');"

to this "define('TABLE_CONFIGURATION', 'configuration2');" for store2 and "configuration3" for store3, etc...

 

For that language to store error, do this below:

-- you need to set the 'language' for your other stores(store2 & store3)

-- and then make sure the 'store_id' is set correctly. store_id=2 will be store2, store_id=3 will be store3

 

>>>>>>>>>>>>>>>>>>>

But when trying to access the other stores via the URL, I got the "includes/english/.php... failed to open stream" errors.

The fix to this was to access the database with phpMyadmin:

-- select the "languages_to_stores" table

-- select "Insert" menu tab

-- add under "languages_id" > input "1" (for english, same for Store3)

-- add under "stores_id" > input "2" (for Store2, would input "3" for Store3)

-- repeat above for Store3

 

Hey, my friend!!! I so regret that your location is Pacific being on the other side. I would be glad to drink with you some beer in some place. You should know that your explanation how to install this wonderful and useful contribution is the best. Only yours postings (comments) drove me to finish this program working perfectly. Thank you so much.

Share this post


Link to post
Share on other sites

Hey, my friend!!! I so regret that your location is Pacific being on the other side. I would be glad to drink with you some beer in some place. You should know that your explanation how to install this wonderful and useful contribution is the best. Only yours postings (comments) drove me to finish this program working perfectly. Thank you so much.

 

 

 

Glad it helped you. A cold drink sounds nice... :)


How much wood, would a woodchuck chuck wood, if a woodchuck could chuck wood?

 

My quest to make RC2a & Multi-store work together, click below:

http://forums.oscommerce.com/topic/349161-multi-store-with-rc2a/page__p__1459234#entry1459234

Share this post


Link to post
Share on other sites

Hi sputniknet

 

I had just installed lifeisboosts piece of code and realised that it was missing the table header and also that it didn't show categories, i just added it my end and was looking for lifeisboost post to quote it and post my added code and stumbled across this post of yours where you had already done it :)

 

I pretty much have a working version now if i can be of any help?

 

The only problems I am currently trying to resolve is how to make other specials addons add the stores_id to the specials table, currently it just adds a zero as the stores id. This is the code in the current specials and the same code exists in other specials contributions (bar the stores_id bit) but just altering that code doesnt work. It gets the stores_id from somewhere I havent found yet.

 

tep_db_query("insert into " . TABLE_SPECIALS . " (products_id, specials_new_products_price, specials_date_added, expires_date, status, stores_id) values ('" . (int)$products_id . "', '" . tep_db_input($specials_price) . "', now(), '" . tep_db_input($expires_date) . "', '1', " .  (int)$selected_store_id . ")");

 

The last one is that if a product is linked to more than one category it will not update when I use 'Enable/Disable store to ALL sub-categories and sub-products?', e.g i have products on one store on a category called 'motorbike widgets' and then i have copied the same products into a different category called 'bicycle widgets' that i want to show on another store. But by using Enable/Disable store to ALL sub-categories and sub-products? on either parent folder doesent change the products stores_id, only the categories_stores_id

 

Any ideas?

 

Thanks

 

Dave

 

 

 

Added this addition (thanks to lifeisboost for this great addition!)

-- your choice to add this, but to me seems very helpful

 

 

In 'catalog/admin/categories.php' around line 965 look for =

"<td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' .

$products['products_id'] . '&action=new_product_preview&read=only') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif',

ICON_PREVIEW) . '</a> ' . $products['products_name']; ?>"

 

-- add this right after it on a new line =

"<td class="dataTableContent"><?php $stores_query_raw = "select stores_id,

stores_name from " . TABLE_STORES . ($admin_allowed_stores[0] == '*' ? " " : " where stores_id in(" . implode(',' ,

$admin_allowed_stores) . ") ") . "order by stores_id"; $stores_query = tep_db_query($stores_query_raw); while

($stores = tep_db_fetch_array($stores_query)) { $products_to_stores_query_raw = "select stores_id from " .

TABLE_PRODUCTS_TO_STORES . " where stores_id = '" . $stores['stores_id'] . "' and products_id =' ". $products['products_id']

."'"; $products_to_stores_query = tep_db_query($products_to_stores_query_raw); $products_to_stores =

tep_db_fetch_array($products_to_stores_query); if ($products_to_stores['stores_id'] == $stores['stores_id']) {echo

$stores['stores_name']; } } // rmh display category status in each store ?>"

 

-- when you look at the products in your categories, this mod will display "store1 store3 etc..." next to the products, so you can see

which products are included at each store

 

 

 

In 'catalog/admin/categories.php' around line 930 look for =

"<td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, tep_get_path($categories

['categories_id'])) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a> <b>' . $categories

['categories_name'] . '</b>'; ?></td>"

 

- add this right after it on a new line =

"<td class="dataTableContent"><?php $stores_query_raw = "select stores_id, stores_name from " . TABLE_STORES .

($admin_allowed_stores[0] == '*' ? " " : " where stores_id in(" . implode(',' , $admin_allowed_stores) . ") ") . "order by

stores_id"; $stores_query = tep_db_query($stores_query_raw); while ($stores = tep_db_fetch_array($stores_query))

{ $categories_to_stores_query_raw = "select stores_id from " . TABLE_CATEGORIES_TO_STORES . " where stores_id = '" .

$stores['stores_id'] . "' and categories_id =' ". $categories['categories_id'] ."'"; $categories_to_stores_query =

tep_db_query($categories_to_stores_query_raw); $categories_to_stores = tep_db_fetch_array

($categories_to_stores_query); if ($categories_to_stores['stores_id'] == $stores['stores_id']) {echo $stores

['stores_name']; } } // rmh display category status in each store ?>"

 

-- when you look at the categories, this mod will display "store1 store3 etc..." next to the categories, so you can see which

categories are included at each store

 

 

** Tested both and works great **

 

I'm at this point and I do still have some errors showing in the Admin pages, will post errors and fixes as I encounter them.

Edited by stubbsy

Share this post


Link to post
Share on other sites

I just realised why I hadnt seen your code before I went to post. Its because this is a new thread and not the original. :)

 

I didnt realise, I just searched google for a line of code from the amended code and it can up with this, i just thought it was the original thread.

 

:)

Share this post


Link to post
Share on other sites

Please Help...

Hello everyone, i just installed the multi-store contribution. Everything seems to have set up properly.

In reading through the forums, i think what i'm supposed to do is set up the main OSC, then copy the entire directory (without admin) into a new folder on my server which i have done. I then went into my main admin area and set the paths WS+FS to point to the proper folders for each store.

The only issue i seem to be having at this point is when i assign categories to the stores. When i add a category to the main store it shows up in both stores. When i add a category to the child store it doesn’t show up in either store. I do have them set to different configurations (configuration, configuration2) in the multi store admin.

Any help is greatly appreciated.

Best Regards,

Aaron

 

Share this post


Link to post
Share on other sites

Go into your database:

 

Check these :

- stores

- language_to_stores

- categoreis_to_stores

 

Make sure "store_id" is correctly designating your main and child website stores.

 

example:

store_id = 1 >>>> main OSC

store_id = 2 >>>> child site

 

OR

 

something is wrong with the path/configuration settings

 

Re-check and verify.


How much wood, would a woodchuck chuck wood, if a woodchuck could chuck wood?

 

My quest to make RC2a & Multi-store work together, click below:

http://forums.oscommerce.com/topic/349161-multi-store-with-rc2a/page__p__1459234#entry1459234

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×