Jump to content
hobbzilla

Multi-Stores Multiple Shops Support

Recommended Posts

Ryan,

 

I'm finally getting down to the nitty gritty of entering all our products in the various sizes, woods and such. I have a problem with the pop up image for the options.

 

It seems that which ever photo is first for each option (small, medium, large) is the photo that appears for each product. So my elephants are first, which have small, medium & large. The giraffes pop up is pulling the elephant photos.

 

In the popup_image.php file, it looks like it is pulling the pop up photo from products attribute table, options_values_id field and using the first instance of each. I'm guessing it needs to be changed to pull from the products_attributes_id field instead but I'm not sure how to properly do this. I tried just replacing the field name but it didn't work.

 

Can you help??? Thanks! Joanne - Infinity Limited

 

Here's the file

 

<?php
/*
 $Id: popup_image.php,v 1.18 2003/06/05 23:26:23 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 $navigation->remove_current_page();
//rmh M-S_attrib M-S_pics begin
 $pID = (isset($HTTP_GET_VARS['pID']) ? $HTTP_GET_VARS['pID'] : '');
 $peiID = (isset($HTTP_GET_VARS['peiID']) ? $HTTP_GET_VARS['peiID'] : '');
 $poiID = (isset($HTTP_GET_VARS['poiID']) ? $HTTP_GET_VARS['poiID'] : '');

 if (tep_not_null($pID)) {
   $products_query = tep_db_query("select pd.products_name as name, p.products_image as image, p.products_popup_image as popup_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id INNER JOIN " . TABLE_PRODUCTS_TO_STORES . " p2s ON p.products_id = p2s.products_id where p2s.stores_id = '" . STORES_ID . "' and p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'");
 } elseif (tep_not_null($peiID)) {
   $products_query = tep_db_query("select pd.products_name as name, p.products_image as image, p.products_popup_image as popup_image, pei.products_extra_image as extra_image, pei.products_extra_popup_image as extra_popup_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_EXTRA_IMAGES . " pei on p.products_id = pei.products_id left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id INNER JOIN " . TABLE_PRODUCTS_TO_STORES . " p2s ON p.products_id = p2s.products_id where p2s.stores_id = '" . STORES_ID . "' and p.products_status = '1' and pei.products_extra_images_id = '" . $HTTP_GET_VARS['peiID'] . "' and pd.language_id = '" . $languages_id . "'");
 } elseif (tep_not_null($poiID)) {
   $products_query = tep_db_query("select pov.products_options_values_name as name, pa.options_values_image as image from " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa ON pa.options_values_id = pov.products_options_values_id where pov.products_options_values_id = '" . (int)$HTTP_GET_VARS['poiID'] . "' and pov.language_id = '" . (int)$languages_id . "'");
 } else {
   quit;
 }
//rmh M-S_attrib M-S_pics end
 $products = tep_db_fetch_array($products_query);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo $products['products_name']; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<script language="javascript"><!--
var i=0;
function resize() {
 if (navigator.appName == 'Netscape') i=40;
 if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+60-i);
 self.focus();
}
//--></script>
<?php if (DISABLE_RIGHT_CLICK == 'true') { echo '<script language="javascript" src="includes/disable_right_click.js"></script>'; } //rmh M-S_click ?>
</head>
<?php //rmh M-S_attrib M-S_pics begin ?>
<body <?php echo (tep_not_null(POPUP_WINDOW_WIDTH) || tep_not_null(POPUP_WINDOW_HEIGHT) ? '' : 'onload="resize();"'); //rmh M-S_pics ?>>
<?php
if (tep_not_null($products['extra_popup_image'])) {
 $products_image = $products['extra_popup_image'];
} elseif (tep_not_null($products['extra_image'])) {
 $products_image = $products['extra_image'];
} elseif (tep_not_null($products['popup_image'])) {
 $products_image = $products['popup_image'];
} elseif (tep_not_null($products['image'])) {
 $products_image = $products['image'];
} else {
 $products_image = '';
}

if (tep_not_null($products_image)) {
 echo tep_image(DIR_WS_IMAGES . (tep_not_null($poiID) ? 'options/' : '' ) . $products_image, $products['name']);
}
?>
<?php //rmh M-S_attrib M-S_pics end ?>
</body>
</html>
<?php require('includes/application_bottom.php'); ?>

Share this post


Link to post
Share on other sites
Can you help???  Thanks!  Joanne - Infinity Limited

 

Can you send me the file via e-mail. If I discuss any version of M-S that is not available to download on the contributions section (which is what you are asking), the dev team spanks me with a wooden spoon.

Share this post


Link to post
Share on other sites

I just finished installing this contribution and it seems great. I just can't get it to work properly. When I assign a category to a store, it's viewed under that store fine. But if it so happens that a category has subcategories, the store says theres no products in that subcategory. I tried checking the box for enableing products for all subcategories and products under the admin category screen. But no success. Anyone experience this or have an idea what this is from?

Share this post


Link to post
Share on other sites

I love this contribution, but there are quite a few bugs especially regarding categories being added and removed from stores. I just cannot get it to work properly. Some cateogries will add ok, others will not. Some can be removed from a store, other cannot. I wish it was a consistent bug so I can pinpoint it, but random bugs are the worst.

 

Zilla, you are the man. I'd say this is probably on the top 5 best contributions for osCommerce by far. I'm really looking forward to v1.7. Will this version be easy to update from v1.4, or will this require complete uninstall and reinstall of v1.7 due to different framework in place? I'm hoping it will be an easy update so I can begin using 1.7 soon after its release. If you need help devising an installation, please let the board know and I'm sure someone will help. You can PM me too if you'd like. Thanks again for your contribution and further successing the business of us all. :)

Share this post


Link to post
Share on other sites

I got this contribution working exactly as I want bar one thing.

 

Im using Master Products and the Specials in the master products section show whichever store they are assigned to.

 

I tracked it down to the following code in Master_Products.php

 

      $master_sql = "select  " . $select_column_list . " p.products_id,  p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_id = pd.products_id and p.products_master = '" . $thisquery['products_master'] . "' and p.products_status = '1' and pd.language_id = '" . (int)$languages_id . "'";

 

changing that to

 

      $master_sql = "select  " . $select_column_list . " p.products_id,  p.manufacturers_id, p.products_tax_class_id, s.specials_new_products_price, s.status, p.products_price from ". TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id RIGHT JOIN " . TABLE_SPECIALS_TO_STORES . " s2s ON s.specials_id = s2s.specials_id where p.products_id = pd.products_id and p.products_master = '" . $thisquery['products_master'] . "' and p.products_status = '1' AND (s2s.stores_id = '" . STORES_ID . "') and pd.language_id = '" . (int)$languages_id . "'";

 

Will hide the specials not for that store but if I assign a special to the store it is adding a whole new set of slaves for each special. e.g. I have 4 slaves. I make one special and I end up with 8 slaves, one of which is my special. add another, 12 items, 2 of which are slaves.

 

So I added a s.specials_id = s2s.specials_id and it will ONLY give me the ones that are special ( obviously I guess! )

 

Has anyone tackled this before of can give me a poke in the right direction?

 

Cheers

Stot

Share this post


Link to post
Share on other sites

I am having a little difficulty......

 

I have the 3 sites setup, and they are communicating well with the main site, however for some reason when I put a product on site 1 it still goes across all 3 sites.

 

When I click on a product in any site, it takes me to the product description on the main site, site 1.

 

Is this normal for this addon? ....

 

Am wanting the 3 different sites to be totally seperate from each other.

Share this post


Link to post
Share on other sites

@MrBafner

 

Double check your configuration tables for each store and verify they don't all use the same "STORES_ID" (hint: search STORES_ID in configuration_title).

Share this post


Link to post
Share on other sites

Thanks heaps for the response, and your fantastic efforts.... they are remarkable. You should be highly commended for your efforts.

 

I cannot understand why they have decided to remove what seems to be vital threads to this contribution.

 

I do not understand why they have decided to remove the 1.6 version... there are plenty of contributions of OSC on the net which include combined contributions to make the one contribution. I sympathise for you, as I think you have exceeded the expectations of the other OSC developers.

 

But instead, maybe they should embrace the fact that many people out there are combining contributions to make the OSC more competitive to other cart systems out there.

 

NOW TO MY PROBLEM....

 

I have installed and reinstalled many times the 1.4 version, and have attempted to get the http://www.oscommerce.com/community/contributions,1242 product breaks module functioning.

 

I cannot get it functioning at all..... it is the only othe feature I am wanting besides the multi-store. I have been trying to impliment the 2 for over a week.

 

Yes, I have come close, but no banana......

 

Any suggestions on how to get the price break feature to work in conjunction with the multi-store feature.

 

(example buy 10 products = $5 each, 15 products = $4.75, 20 products = $4.50 each, 25 products = $4.25 each, 30 products = $4 each)

 

Has this been done before?

Share this post


Link to post
Share on other sites

Shop Logo:

 

I made a new shop with its own config table and i configured it this way, that all images for all shops are the same (no different products - I want to upload only one image which is visible to all other shops).

 

All ist working, but when I give in my admin mode (only one admin directory in /multishop/catalog/admin !) a new logo to this shop, there is always the osc-logo to see in multishop/kunde1/.

The Logo is uploaded successfully into my main-shop image directory in /multishop/catalog/images/.

 

The new shop ist under /multishop/kunde1/

 

What can I change, that the new generated shops have their own shoplogo and all the same product images ?


OSC Webmakers Edition modiefied with many other contribs and enhancements.

+ STS 4.5.7 for 2.2MS2 and RC1

Share this post


Link to post
Share on other sites
Shop Logo:

 

I made a new shop with its own config table and i configured it this way, that all images for all shops are the same (no different products - I want to upload only one image which is visible to all other shops).

 

All ist working, but when I give in my admin mode (only one admin directory in /multishop/catalog/admin !) a new logo to this shop, there is always the osc-logo to see in multishop/kunde1/.

The Logo is uploaded successfully into my main-shop image directory in /multishop/catalog/images/.

 

The new shop ist under /multishop/kunde1/

 

What can I change, that the new generated shops have their own shoplogo and all the same product images ?

 

I found this line in catalog/includes/header.php:

<td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?></td>

 

But what is it good for to choose an image in the admin section for new shops, when the image-path is built in the header.php ????


OSC Webmakers Edition modiefied with many other contribs and enhancements.

+ STS 4.5.7 for 2.2MS2 and RC1

Share this post


Link to post
Share on other sites
I found this line in catalog/includes/header.php:

    <td valign="middle"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce') . '</a>'; ?></td>

 

But what is it good for to choose an image in the admin section for new shops, when the image-path is built in the header.php ????

 

The shop logo is used for invoice & packing slips (as mentioned in the install guide). The catalog layout & images remain unchanged.

Share this post


Link to post
Share on other sites

Wouldn`t it be better, if the shop-logo for the "Multi-shops" would also be defined in the config-file of each shop and the header.php of the shops take the right shop-logo from config file ?

 

Perhaps this could be a modification for Version 1.7 ?


OSC Webmakers Edition modiefied with many other contribs and enhancements.

+ STS 4.5.7 for 2.2MS2 and RC1

Share this post


Link to post
Share on other sites

When I try to put in the sqlscript to the mysql 4.1.8 databas.

 

It stops in

 

CREATE TABLE newsdesk (

newsdesk_id int(11) NOT NULL auto_increment,

newsdesk_image varchar(64) default NULL,

newsdesk_image_two varchar(64) default NULL,

newsdesk_image_three varchar(64) default NULL,

newsdesk_date_added datetime NOT NULL default '0000-00-00 00:00:00',

newsdesk_last_modified datetime default NULL,

newsdesk_date_available datetime default NULL,

newsdesk_status tinyint(1) NOT NULL default '0',

newsdesk_sticky tinyint(1) NOT NULL default '1',

PRIMARY KEY (newsdesk_id),

KEY idx_newsdesk_date_added (newsdesk_date_added)

) TYPE=MyISAM AUTO_INCREMENT=4 ;

 

it says

 

 

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DROP TABLE IF EXISTS newsdesk;

CREATE TABLE newsdesk (

newsdesk_id int(11) N' at line 1

 

 

Whats wrong

 

Alfa

Share this post


Link to post
Share on other sites
When I try to put in the sqlscript to the mysql 4.1.8 databas.

 

It stops in

 

CREATE TABLE newsdesk (

newsdesk_id int(11) NOT NULL auto_increment,

newsdesk_image varchar(64) default NULL,

newsdesk_image_two varchar(64) default NULL,

newsdesk_image_three varchar(64) default NULL,

newsdesk_date_added datetime NOT NULL default '0000-00-00 00:00:00',

newsdesk_last_modified datetime default NULL,

newsdesk_date_available datetime default NULL,

newsdesk_status tinyint(1) NOT NULL default '0',

newsdesk_sticky tinyint(1) NOT NULL default '1',

PRIMARY KEY (newsdesk_id),

KEY idx_newsdesk_date_added (newsdesk_date_added)

) TYPE=MyISAM AUTO_INCREMENT=4 ;

 

it says

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DROP TABLE IF EXISTS newsdesk;

CREATE TABLE newsdesk (

newsdesk_id int(11) N' at line 1

Whats wrong

 

Alfa

 

And He says

Error nummer 1064

 

To

Share this post


Link to post
Share on other sites

alfa

 

I assume that you are using myphpadmin.

 

If you do have myphpadmin, check to see if the table is already there.

 

If it is, you have two choices, drop the table or check it for all the columns and use that table.

 

Oh what are you trying to add?

 

 

Greg

Edited by greg334

Share this post


Link to post
Share on other sites

When I looked in this forum

they say next ver 1.7

 

Then I looked at the contribution for the multishop

its ver 1.4

 

Where can I fond ver 1.6.

 

Alfa

Share this post


Link to post
Share on other sites
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DROP TABLE IF EXISTS newsdesk;

CREATE TABLE newsdesk (

newsdesk_id int(11) N' at line 1

Whats wrong

 

Alfa

 

If you are inserting a table named "newsdesk" then you might try to the support thread for that contribution. Multi-stores contains no such table.

 

When I looked in this forum

they say next ver 1.7

 

Then I looked at the contribution for the multishop

its ver 1.4

 

Where can I fond ver 1.6.

 

Alfa

 

*Edit* Due to an agreement with the osCommerce Team they have been taken offline

 

 

any demo store for this contribution?

i tried virtual mall version before but not that satisfy.

 

Currently, there is no demo store up and running where you have access to the admin panel, etc. but as soon as 1.7 is released, hopefully I can get one up and running (any of you that have offered hosting space, now might be a good time to set up an account for a demo site.... please contact me if interested). There are however plenty of live sites using the contrib (I have 7 or so myself)

Edited by Johnson

Share this post


Link to post
Share on other sites

Then are 1.7 release do you have a date.

 

But now to my qustens.

 

I install a new osc (name = shop) Done

? Shold I do anything whit the new shop before I install multishop.

 

Unpack the zip file to a temporary directory. Done

copy over maps (admin,catalog) into the osc map. Done

run update.sql in phpmyadmin Done

 

The first shop are

 

localhost/shop

 

Now I want a new shop

 

localhost/shop1

I create a new map shop1

copy catalog from shop

put it in shop1 map

Now I shold change the

catalog configure.php

admin configure.php

database_tables.php

 

Exactly what shold I change

Please show me for all the php files

I got 2 shops now shop and shop1

 

then I have change the files

is it more I shold do.

 

Alfa

Share this post


Link to post
Share on other sites

Hi there,

 

I am just a beginner of Oscommerce~ :'(

However, I found out this is an excellent contribution for my online shop :P

Before I install this contribution, there are few questions I wanna to make clear.

 

1. no matter how many store I setup. still use one SQL database(in one domain)? or able to separate and store in other domain SQL database.?

 

2. if our website already installed the Credit Class & Gift Voucher contribution.

is the credit able to share with our sub-store (with same membership record?)

 

3. no matter how many multi-shop we setup. is the membership record still able to share? or customer required to register again in other sub-shop?

 

Thanks for your help~

 

Regards

Share this post


Link to post
Share on other sites
Then are 1.7 release do you have a date.

Pushed back to Feb 1st (yes 2005).

 

I install a new osc (name = shop) Done

? Shold I do anything whit the new shop before I install multishop.

 

Exactly what shold I change

Please show me for all the php files

I got 2 shops now shop and shop1

 

then I have change the files

is it more I shold do.

 

Alfa

 

Okay, once you upload ms2 and install the first store (shop).and have copied over the directories (or integrated by hand - insane method) for M-S & ran the .sql filel.. you now have a M-S enabled storel (and should have 0 products). If you copy over the installation point of /shop and copy it to /shop2, you will have an exact copy of shop... so changing the catalog & admin config as well as the database_tables to reflect the changes in the path and configuration table.. you should have 2 stores (with 0 products) repeat for X number of stores.

 

In the admin & catalog configure.php files you need to update for the new path (i.e. shop becomes shop2 etc.) and for the db_tables.php you need to update config_table to whatever you defined in admin when you created a new store.

 

Hope that helps.

 

Hi there,

 

I am just a beginner of Oscommerce~  :'(

However, I found out this is an excellent contribution for my online shop  :P

Before I install this contribution, there are few questions I wanna to make clear.

 

1. no matter how many store I setup. still use one SQL database(in one domain)? or able to separate and store in other domain SQL database.?

 

2. if our website already installed the Credit Class & Gift Voucher contribution.

  is the credit able to share with our sub-store (with same membership record?)

 

3. no matter how many multi-shop we setup. is the membership record still able to  share? or customer required to register again in other sub-shop?

 

Thanks for your help~

 

Regards

 

1. Yes, all stores run off of 1 database.... each store with their own configuration table.. It can be www.shop.com| www.shop2.com OR shop.domain.com | shop2.domain.com OR www.domain.com/shop | www.domain.com/shop2 OR www.domain.com/~shop | www.domain.com/~shop2 (it all depends on how you set it up on the http server...

 

2. For version 1.7 there is a price class which will require any contribution that deals with price (CCGV, e.g.) to be modified to utilize this class.. otherwise only the default prices will be pulled and not store/customer group prices. Also, for CCGV (which I have already modifed it to work -- and can post required changes when 1.7 is released) you can define coupons and GV on a per store basis.

 

3. By default once a customer registers on one store the same user/password works on all stores.. this can be changed with a little effort.. but not implemented in this contribution.

Share this post


Link to post
Share on other sites

I install a new osc (name = shop)

localhost/shop Done

 

Copy multishop (admin&catalog) into shop Done

run update.sql in phpmyadmin done

 

Create a new map shop1

localhost/shop1

copy all in the map shop into shop1

 

Change shop1\catalog\includes\configure.php

 

define('HTTP_COOKIE_PATH', '/shop/catalog/');

to

define('HTTP_COOKIE_PATH', '/shop1/catalog/');

 

define('DIR_WS_HTTP_CATALOG', '/shop/catalog/');

to

define('DIR_WS_HTTP_CATALOG', '/shop1/catalog/');

 

define('DIR_FS_CATALOG', 'C:/Apache2/htdocs/shop/catalog/');

to

define('DIR_FS_CATALOG', 'C:/Apache2/htdocs/shop1/catalog/');

 

 

Is this all to do in shop1\catalog\includes\configure.php ????

 

 

Go to shop1\catalog\admin\includes\configure.php

change

 

 

define('DIR_FS_DOCUMENT_ROOT', 'C:/Apache2/htdocs/shop/catalog/');

to

define('DIR_FS_DOCUMENT_ROOT', 'C:/Apache2/htdocs/shop1/catalog/');

 

define('DIR_WS_ADMIN', '/shop/catalog/admin/');

to

define('DIR_WS_ADMIN', '/shop1/catalog/admin/');

 

define('DIR_FS_ADMIN', 'C:/Apache2/htdocs/shop/catalog/admin/');

to

define('DIR_FS_ADMIN', 'C:/Apache2/htdocs/shop1/catalog/admin/');

 

define('DIR_WS_CATALOG', '/shop/catalog/');

to

define('DIR_WS_CATALOG', '/shop1/catalog/');

 

define('DIR_FS_CATALOG', 'C:/Apache2/htdocs/shop/catalog/');

to

define('DIR_FS_CATALOG', 'C:/Apache2/htdocs/shop1/catalog/');

 

 

 

Is this all to do in shop1\catalog\admin\includes\configure.php

 

 

shop1\catalog\admin\includes\database_tables.php

 

define('TABLE_CONFIGURATION', 'shop1');

 

Is this all to do in shop1\catalog\admin\includes\database_tables.php

 

 

In ie

http://localhost/shop/catalog/admin/index.php

Go to Stores Admin

click on insert

 

Stores Name:

shop1

 

Stores URL:

http://localhost/shop1

 

 

Stores Config Table:

shop1

 

after this a click on Categories / Products

hardware click on store

chose default and Enable/Disable store to ALL sub-categories and sub-products

 

Do the same whit DVD Movies but take shop1 as the shop.

 

 

If I go to http://localhost/shop/catalog/ in ie all product comes up

http://localhost/shop1/catalog/ all products come up.

 

 

What has I do wrong.

 

Alfa

Edited by alfa

Share this post


Link to post
Share on other sites

I have the same problem as johnadurcan Posted on: Jul 21 2004, 11:43 PM in this thread.

 

2) I am finding that when I have a specials entry and select to have that entry show in multiple stores, it creates multiple entries of the product when I browse to the category. the amount of extra entries depends on how many stores I have selected it to be viewable in. It shows me one as discounted and the others at full price.

 

I can't find an answer to this problem.

Checked and double checked the query in index.htm...

But no result...

Can anyone give me some help?

 

Regards,

Alex

Share this post


Link to post
Share on other sites
:D

Hi. now the lastest version is 1.48 in the contribution page. right?

 

when will V1.7 will available?

please advise.

 

tks~

:lol:

 

He said Pushed back to Feb 1st (yes 2005)

on this side

 

Alfa

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

×