Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multi-Stores Multiple Shops Support


hobbzilla

Recommended Posts

Hi all,

 

It will be interesting that the shopping_carts will be shared between stores, isn't it?

I replaced the original shopping_cart.php of /includes/functions/ and the other one on /catalog/ and carts are shared now. But product_info and another things don't work fine, and orders, and prices are not correctly shown.

 

Please if you want to share carts like me, please reply this. Maybe about this reason hoobzill awill implement it! :) Thanks Hoob for this great contrib but we nedd to share carts between stores :(

 

Regards from Spain.

Link to comment
Share on other sites

I've just download v1.7 ms contribution and found the following code in admin/includes/categories.php around line 467

 

//rmh M-S_multi-stores edited next line

$product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_popup_image, p.products_price, p.products_cog1, p.products_cog2, p.products_qty_blocks, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.distributors_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd " . ($admin_allowed_stores[0] == '*' ? " " : " LEFT JOIN " . TABLE_PRODUCTS_TO_STORES . " p2s ON p.products_id = p2s.products_id ") . "where p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'". ($admin_allowed_stores[0] == '*' ? " " : " and p2s.stores_id in(" . implode(',' , $admin_allowed_stores) . ") "));

 

There're some fields: proudcts_popup_image, cog1, cog2, ... I have no ideas about these fields and they didn't exist in my original os commerce database in my product table. And I checked the update.sql in the contribution, there's no codes to add these fields too. So when I get in to my store admin panel and try to edit an existing prouct, an sql error comes out:

 

1054 - Unknown column 'p.products_cog1' in 'field list'

 

select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_popup_image, p.products_price, p.products_cog1, p.products_cog2, p.products_qty_blocks, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.distributors_id, p.manufacturers_id from products p, products_description pd where p.products_id = '26' and p.products_id = pd.products_id and pd.language_id = '1'

 

May anyone help me to solve this problem? Thanks a lot! :)

Link to comment
Share on other sites

I think that COG is cost of good. Here is the field definitions

products_cog1			  | varchar(64)		 | YES  |	 | NULL
products_cog2			  | varchar(64)		 | YES  |	 | NULL

osCommerce is a great piece of software with wonderful contributions.

Spend some time in the contribution area. There are a lot of gems there.

Link to comment
Share on other sites

Ryan, you know how to share carts between the stores?

 

They are in the same domain. It is possible?

 

I had this working at one point in time on my development machine, but it looks like I got rid of it on the production site. I think you just have to change some to the code that looks for customers_basket_stores_id in a few place, but I can't remeber for sure.

osCommerce is a great piece of software with wonderful contributions.

Spend some time in the contribution area. There are a lot of gems there.

Link to comment
Share on other sites

Hi all,

I guess I'll start by asking if anyone has managed to get this contrib working with register_globals off? I know it's been asked before but I can't find any responses.

Having played around with OSC for a few weeks, I came to the conclusion the other day that this contrib might be just what I was looking for, so I have deleted my previous installation (though kept my install notes) so I could start again properly.

I've just installed the latest version of this contrib over a fresh install of OSC, and then hand inserted the changes suggested in the register_globals contrib. Once the register_globals contrib was in, I uploaded everything & ran the install. Then I ran update.sql included in this contrib - all worked great.

I have double checked my configure.php files so many times I'll probably be repeating them in my sleep, and they all look fine.

I have no problem with getting to my catalog, and no products show (as expected) but when I try to access any admin page my browser goes nuts trying to get to the admin login page & then returns the following error: CGI Error

The specified CGI application misbehaved by not returning a complete set of HTTP headers

 

I have also made a few mods to things like english.php & address files to convert OSC to UK English, but that's all the mods I have done so far on this install.

 

Any ideas? I getting seriously doolally trying to figure out what going on.

 

My specific install method was as follows:

1. download & unpack os commerce files to the local machine

2. overwrite with contents of UK-Based osCommerce 2.2

3. overwrite with contents of multi stores contribution, except:

a. catalog/create_account.php:

i. insert line 172 from contribution

ii. overwrite lines 213 to ?//restore cart contents?

b. catalog/includes/language/English.php

i. insert line 168 from contribution (change ?Inquiry? to ?Enquiry?)

ii. insert line 265 from contribution

iii. insert line 319 from contribution

iv. make any other ?UK English? changes to this file if required (eg ?Catalogue?, ?Special Offers?, ?New Products?, footer text.

c. Catalog/admin/includes/language/English.php

i. insert line 73 from contribution

ii. insert lines 80-84 from contribution

iii. overwrite line 88 from contribution

iv. insert lines 90-94 from contribution

v. insert lines 127-136 from contribution

vi. insert lines 210-216 from contribution

vii. insert line 265 from contribution

viii. insert lines 293-294 from contribution

ix. insert line 304 from contribution

x. insert line 325 from contribution

xi. insert line 331 from contribution

xii. insert lines 335-343 from contribution

xiii. make any other ?UK English? changes to this file if required (eg ?Catalogue?, ?Special Offers?, ?New Products?, footer text.

4. overwrite with contents of register_globals patch zip (from Contributions), except:

a. catalog/includes/ application_top.php

i. replace lines 19-23 with lines 19-24 from contribution

b. catalog/includes/classes/order.php

i. insert lines 26-33 from contribution

c. catalog/includes/functions/general.php

i. replace lines 245-247 with lines 245-249 from contribution

ii. insert lines 1264-1292 from contribution before end ?> tag.

d. catalog/admin/includes/ application_top.php

i. replace lines 19-23 with lines 19-24 from contribution

e. catalog/admin/includes/functions/general.php

i. replace line 303 from contribution

ii. insert lines 1318-1346 from contribution before end ?> tag.

5. upload via ftp

6. run install

7. access the Administration tool

8. manually configure catalog/includes/configure.php & catalog/admin/includes/configure.php to reflect correct URLs etc & set Store_session to 'mysql'

9. Run update.sql from Multi Stores Contribution

 

I carried on to step 9 in case that was my issue, but to no avail.

 

Any help very gratefully received, & the speedier the better: I've taken time off work to get OSC running and everything uploaded & I'm rapidly running out of time.

Cheers

H

Link to comment
Share on other sites

I've been trying to install this contribution (vger's 1.7 zip). My manual attempt got messy so I restarted with a clean osc 2.2 and integrated all the files and added global registers workaround (and did sql update). The catalog loads and as expected shows no products. However, when I try the admin I get a browser redirect error on the login. I've found two other previous posts about this but no responses. I know I have to reinstall SQL from 5 to 4.1 since I was getting errors on subcategory listings (without MS), could this be causing the problem? (but I think the last post about this had 4.1 and still had this issue). I'm pretty sure this isn't a path error since I don't even get the login to show up. Any help would be very much appreciated, thanks. :blink:

Link to comment
Share on other sites

Hi dsamis,

Just to let you know that I've tried deliberately putting in an error in admin/includes/application_top.php & the browser does pick that up, so I know things are in the right place.

 

I've had two possible ideas on what might be causing the problem - might it either be that something is being called that relies on register_globals being on, or might it be something to do with the code block that has been moved in the Multi Shops version of admin/includes/application_top.php?

 

I've tried fiddling around with admin/includes/application_top.php & admin/login.php using the register_globals workaround of declaring variables in the $_REQUEST["foo"] format as opposed to the $foo format, but I'm no php person & I'm not really sure when/where I should be using it. Anyway, the variations I've tried have not had any noticeable effects at all. (this was mentioned in a ream of code posted in Post #13 of the "install crashes at step 2" thread in installation & support)

 

I'm now about to see if moving the code block back to it's original position has any effect, will let you know.

Cheers

H

 

BTW, my hosting company runs MySQL 4.1.10-standard & PHP Version 4.3.11 and I'm still getting the issue... fun!

Edited by hannahv
Link to comment
Share on other sites

Firstly may I add my congratulations & praise for all the work you have put into creating this useful contribution and for the continued support in this forum.

 

I have tried searching through this topic for an answer to my query but have struggled to find one, so here goes:

 

My hosting company for my main catalog/database etc don't allow remote access to the database. I want to have two sites - retail and wholesale. I currently have this set up as two entirely different installations (which currently means quite a lot of duplicated effort to change descriptions or add/remove products). Through this contribution I want to run both sites through one databse but on two different domains, currently hosted by different companies.

 

The sites are fairly modified and the wholesale site is password protected through subscription/customer management software. I have tried sharing one database before by creating products_price and products_price1 and changing the databse info from 'localhost' to 'mysql.mydomain.com' but I was restricted remote access through the second site!

 

Before I start trying to implement the contrib and can I just make sure it will work for me even though I don't have remote access (i.e. will need to use 'localhost' on both sites config files)? If it is possible, maybe you could disclose how you got around this potential problem - it may be easier to try my original attempt again rather than starting the site again with this excellent contrib.

 

Thanks

 

:thumbsup:

Link to comment
Share on other sites

Hi David,

I tried adding the Multi Stores code into application_top.php one chunk at a time. The last bit of the MS amendments calls functions/administrators.php. This seems to be the bit that sends the browser in circles as without it the login page loads (though of course doesn't work, but at least it's closer).

So I started to have a look at functions/administrators.php. Line 61 has a references to "global $PHP_SELF", which is one of those nice bits that doesn't work without register_globals being switched on. I did a bit of searching on the web & trawled up a couple of alternative formats (eg $_SERVER['PHP_SELF'] & $HTTP_SERVER_VAR['PHP_SELF'] ) but they still caused a parse problem at line 61. Also (randomly, cos you never know) just tried deleting the "global" & the "global $" bit, as I'd noticed that application_top (or somewhere, machine crashed before I'd noted it) had declared a "PHP_SELF" variable.

 

I'm happy to do all the legwork of tracking down of the bits of code that needs changing, but as you can no doubt tell I'm no PHP coder so would need some guidance as to what to change it to - anybody got any ideas?

Cheers

H

Link to comment
Share on other sites

I'm happy to do all the legwork of tracking down of the bits of code that needs changing, but as you can no doubt tell I'm no PHP coder so would need some guidance as to what to change it to - anybody got any ideas?

Cheers

H

 

http://www.kcpa-tv.com/oscommerce-2.2ms2/o...?products_id=64

 

 

Can anyone tell me how to stop this from putting into the shopping cart a product from both of the suppliers?

 

Any advice appreciated!

DKM

Doctor Mason, World's #1 "Temporary Webmaster"

Link to comment
Share on other sites

I have a big problem with Multistore and Featured Products.

 

This is the Query from featured_box.php

 

if ($random_product = tep_random_select("select p.products_id, p.products_image, p.products_price, p.products_tax_class_id, s.specials_new_products_price, specials_new_products_price, p.products_date_added from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS)) {

 

This is the Query from featured.php (module)

 

$featured_products_query = tep_db_query("select p.products_id, p.products_free_shipping, p.products_image, p.products_quantity, p.products_verfuegbarkeit, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_status = '1' and f.status = '1' order by rand($mtm) DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);

} else {

$info_box_contents[] = array('align' => 'left', 'text' => sprintf(TABLE_HEADING_FEATURED_PRODUCTS_CATEGORY, $cat_name));

$featured_products_query = tep_db_query("select distinct p.products_id, p.products_free_shipping, p.products_quantity, p.products_verfuegbarkeit, p.products_image, p.products_tax_class_id, s.status as specstat, s.specials_new_products_price, p.products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c left join " . TABLE_FEATURED . " f on p.products_id = f.products_id where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . $featured_products_category_id . "' and p.products_status = '1' and f.status = '1' order by rand() DESC limit " . MAX_DISPLAY_FEATURED_PRODUCTS);

}

 

The Querys is not for Multistore. I need this in Multistore.

 

Please help me.

 

Thanks from Germany

Joerg

Link to comment
Share on other sites

Simply take the updated catalog and copy it. Move it to another domain account or rename it if you are planing on using it on the same server

 

for example if you are using this to accomplish a distributor separation such as http://domain.com/europe http://domain.com/usa

 

Is this contribution suitable for the following situation? And if not, are you able to suggest which one we should consider using?

 

Our local politicians have our city divided into two zones, and to get a particular service you must contract with one of two service providers.

 

Each service provider provides exactly the same service as the other service provider does, but their fees are vastly different.

 

 

We are attempting to offer a "One Stop Shop" where you may order the desired service, and select an option (the coding challenge) to indicate which service provider you wish to employ.

 

When we've tried (unsuccessfully) product attributes, listing the fees from both service providers, you can correctly imagine that the shopping cart carried a selection from both service providers instead of just the desired one.

 

One solution would likely be to add a seperate category on the main page, listing both service providers. Prospects would receive the same choices of services, and of course, would get the correct amount added to their shopping cart. And, since we could simply duplicate the services offered, this solution would work.

 

But why do that when there is likely to be a contribution that does what we want, with little or no extra work? Certainly someone knows how to adjust the product attributes page (?) to allow selecting the servic wanted, and from which of the two suppliers it is to be ordered.

 

Any advice is appreciated!

Doctor Mason, World's #1 "Temporary Webmaster"

Link to comment
Share on other sites

I have a couple of questions regarding this contribution.

 

About my plan:

I have a oscommerce site with 3000 products. I call this the master site.

I will be making 10 other oscommerce pages, this will be seperate pages. I call this the slaves.

The slaves will have different log in information, different contact us etc.

 

The problem:

I want to have the product database/photos from the master site, on these seperate pages.

I want to update the master site, and all the slaves will automaticly be updated as well.

I do not want the customer database to be shared between the slaves, nor the master page.

 

If I understand correctly, is this contrubution the right for me?

Edited by czt
Link to comment
Share on other sites

I have a couple of questions regarding this contribution.

 

About my plan:

I have a oscommerce site with 3000 products. I call this the master site.

I will be making 10 other oscommerce pages, this will be seperate pages. I call this the slaves.

The slaves will have different log in information, different contact us etc.

 

The problem:

I want to have the product database/photos from the master site, on these seperate pages.

I want to update the master site, and all the slaves will automaticly be updated as well.

I do not want the customer database to be shared between the slaves, nor the master page.

 

If I understand correctly, is this contrubution the right for me?

 

From the default install, everything seems to be right for you except the customer database is shared between stores. I'm sure that you can easily modify this so that it isn't, but it could end up being quite a bit of custom coding.

osCommerce is a great piece of software with wonderful contributions.

Spend some time in the contribution area. There are a lot of gems there.

Link to comment
Share on other sites

From the default install, everything seems to be right for you except the customer database is shared between stores. I'm sure that you can easily modify this so that it isn't, but it could end up being quite a bit of custom coding.

 

Thank you for your answer.

Im not exactly a code-warriro so do you know how I can proceed on this?

Link to comment
Share on other sites

i use a store with mutch contriebs (creloaded 6.15 with SPPC/Hide-Products/Price-Break).

Now i will add the multistore contrieb in my store but in the mutistore 1.7.1 is to many features insert. ( i have some features in my store )

 

can i add a basic-version of multistore, i will have only the multistore feature.

Link to comment
Share on other sites

Ok, i found it out myself.

 

I did a clean instal OSC MS2. After that i Added Multi-Stores contrib. That worked fine after the patch.

After that i added the Easy Populate contrib and there the problem occured.

 

The problem was that EP could not find the right Directory. This was because the DIR_FS_DOCUMENT_ROOT

was putted in a database table for the multi-Stores system.

 

The errors i saw were: ( i coppied the error message elsewhere from the forum, because i don't want to reproduce it)

 

Warning: move_uploaded_file($DOCUMENT_ROOT/dev/temp/EP2005Jul28-1604.txt): failed to open stream: No such file or directory in /home/.jarhad/elnino/hurricanecomp.com/dev/admin/easypopulate_functions.php on line 32

 

Warning: move_uploaded_file(): Unable to move '/tmp/phpzFVEW1' to '$DOCUMENT_ROOT/dev/temp/EP2005Jul28-1604.txt' in /home/.jarhad/elnino/hurricanecomp.com/dev/admin/easypopulate_functions.php on line 32

 

 

File uploaded.

Temporary filename: /tmp/phpzFVEW1

User filename: EP2005Jul28-1604.txt

Size: 3461

 

Warning: file($DOCUMENT_ROOT/dev/temp/EP2005Jul28-1604.txt): failed to open stream: No such file or directory in /home/.jarhad/elnino/hurricanecomp.com/dev/admin/easypopulate.php on line 666

 

Warning: Invalid argument supplied for foreach() in /home/.jarhad/elnino/hurricanecomp.com/dev/admin/easypopulate.php on line 689

 

My configure.php

 

=====

 

My sollution for the problem was to remove te following text from the easypopulate.php file

 

removed text: DIR_FS_DOCUMENT_ROOT

 

Now it works fine overhere.

 

I'm not a die hard coder so if this don't work for you i can't help you any further.

Link to comment
Share on other sites

Hi all,

 

I've been setting up a couple of these shops for proof of concept for a client and they work wonderfully. However, now I'm playing with a few more features rather than the simple ones...

 

I have discovered a minor bug though. (from what I can tell)

 

How to replicate i:

 

When you have a couple of stores and you are logged in as 'an admin', not THE ADMIN, I've noticed that you can't individually select a product to go in a store.

 

Under the FULL ADMIN, this option is possible.

 

 

Please correct me if I'm wrong. I'm not a php coder, so I'm not going to try and fix it. I'm sure it's something to do with the permissions, but yeah, that's my bug.

 

Any good coders, or people who know how to fix this?

 

Apart from that, it works well! Ta.

 

Cheers,

 

Steve

 

Further to my last, It's not possible to delete mass categories too... maybe products too, - I gave up using my login and have gone back to the full admin.

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