Community Add-Ons
Multi-Stores multiple shop system
for osCommerce Online Merchant v2.2
These modifications allow you to assign specific products and categories to multiple stores that you define in the administration panel. The products and categories
will not be able to be manipulated via the web-browsers address bar (like in most
other multi-shop implementations). Also, there is no "one store to rule them all".
You decide which categories you want displayed on which store-front. You decide
which products in that category you want displayed on which store-front. Shopping
carts are NOT shared between the sites.
Legend:
Download
Report
Full V2.0 package including security patch. Does not include the sitemap class from the previous contribution.
This is just one file patching a vulnerability in the admin login function. This fix prevents the user from accessing anything on the admin side of the website without actually logging in.
This is just the 1 file changed to make the http://addons.oscommerce.com/info/6583 contribution work with Multi-Stores.
This version is based on Multi-stores v2.0 with corrections by jugeti.
Only two files changed.
1. On admin site, modules.php was always updating on first shop configuration table. I changed querys to make updates only on active shop configuration table.
2. includes/classes/shopping_cart.php. Subtotal on shopping cart was shown as 0, even if checkout process subtotals where right.
After that, I hade to define this on aplication top of each new store defined to make it work:
define('STORES_ID', 3); //1, 2, 3... n, depending on store ID
define('TABLE_CONFIGURATION', 'configuration3'); // Configuration table you define for each shop.
After this little changes everything goes OK.
THANK YOU everybody for this amazing contribution.
------
Esta version está basada en Multi-stores v2.0 with corrections de jugeti.
se han cambiado solo 2 archivos. En admin/modules.php se han modificado las querys para que accedan a la tabla de configuración de cada una de las tiendas.
En includes/classes/shopping_cart.php se ha hecho una pequeña modificación que hacía que en el carrito de la compra el subtotal fuera cero.
Por último, comentaros que en los aplication_top de cada una de las tiendas he tenido que incluir estas líneas para que funcionasen.
define('STORES_ID', 3); // 1, 2, 3... n, dependiendo del store ID que tenga cada una
define('TABLE_CONFIGURATION', 'configuration3'); // Tabla de configuración definida para cada tienda.
Quitando estas pequeñas cosillas, todo lo demás, me funciona perfecto. Muchísimas gracias a todos los que habeis colaborado en esta contribución.
--------------------------------------------------------------------------------------------------------------
AUTOMATIC STORES GENERATION WITH OSCOMMERCE AND MULTI-STORES ADD-ON
USING A LAMPP ENVIRONMENT (Apache, MySQL and PHP under LINUX)
AUTHOR: Jose Ignacio Alvarez Ruiz
WEB: http://www.nacho-alvarez.es
--------------------------------------------------------------------------------------------------------------
Description:
The magnific Multi-Stores add-on (http://addons.oscommerce.com/info/1730) allow to modify the OsCommerce structure in order to maintenance different stores. For now, and it is all that I know, the only way for duplicate a store was copying manually the folder that contains the Oscommerce installation to a well-know path.
With the modifications I suggest, when stores are going to be created, the name and password of the manager can be specified and the following will be ocurr:
* An automatic copy of your master store will be made.
* A manager for the new store will be created, without visit the 'Administrators' menu.
* If you make changes in the master store, these changes will be showed in the rest of the stores, without need of aditional changes.
* When you delete a store, the data of the manager, the data of the store and the data of database relative to this store will be deleted.
To-Do:
Some new text is writed in english in order to don't modify various files of the OsCommerce structure. It is necessary to define constants for each language and text.
-------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------
GENERACIÓN AUTOMÁTICA DE TIENDAS CON OSCOMMERCE Y MULTI-STORES
UTILIZANDO UN ENTORNO LAMPP (Apache, MySQL y PHP bajo LINUX)
AUTOR: José Ignacio Álvarez Ruiz
WEB: http://www.nacho-alvarez.es
--------------------------------------------------------------------------------------------------
Descripción:
El magnífico add-on Multi-Stores (http://addons.oscommerce.com/info/1730) permite modificar la estructura de OsCommerce de forma que se puedan mantener varias tiendas. Hasta ahora, por lo que yo conozco, la única forma de replicar las tiendas era copiando manualmente la carpeta con la instalación de OsCommerce a una ubicación bien conocida.
Con las modificaciones que propongo, al crear tiendas, se puede especificar el nombre y el password del gestor y ocurrirá lo siguiente:
* Se realizará una copia automática de su tienda maestra.
* Se insertará el gestor de forma automática, sin tener que pasar por el menú 'Administradores'.
* Si usted realiza cambios en la tienda maestra, éstos se reflejan en el resto de tiendas del sistema sin necesidad de cambios adicionales.
* Cuando usted elimina una tienda, se eliminan tanto los datos del gestor que la mantiene como la carpeta que contiene los datos de la tienda, así como los datos contenidos en la base de datos relativos a dicha tienda.
Por hacer:
Algunos textos nuevos están escritos en inglés para no modificar varios ficheros de la estructura de OsCommerce. Es necesario definir constantes para cada idioma y cada texto.
-------------------------------------------------------------------------------------------------
Full package with fixes
Fixes the error message Error Message - 1054 - Unknown column 'p.products_id' in 'on clause' in products_new.php
Danish language module included
File is corrupt and I am having problem with zip. Trying to reload.
Here is what I changed. Hopefully monitors will allow code in description to stay in case file is corrupt again.
in original file by rmh at about line 107 look for:
# //rmh M-S_pricing
###########################
CREATE TABLE customers_groups (
customers_groups_id int NOT NULL auto_increment,
customers_groups_name varchar(32) NOT NULL DEFAULT '',
customers_groups_type char(1) NOT NULL DEFAULT '0',
customers_groups_discount varchar(4) DEFAULT NULL,
PRIMARY KEY (customers_groups_id)
);
INSERT INTO customers_groups (customers_groups_id, customers_groups_name) VALUES ('1', 'Retail');
INSERT INTO customers_groups (customers_groups_id, customers_groups_name) VALUES ('2', 'Wholesale');
Change it to:
###########################
CREATE TABLE customers_groups (
customers_groups_id int NOT NULL auto_increment,
customers_groups_name varchar(32) NOT NULL DEFAULT '',
customers_groups_type char(1) NOT NULL DEFAULT '0',
customers_groups_discount varchar(4) DEFAULT NULL,
PRIMARY KEY (customers_groups_id)
);
INSERT INTO customers_groups (customers_groups_id, customers_groups_name, customers_groups_type, customers_groups_discount) VALUES ('1', 'Retail','0', NULL);
INSERT INTO customers_groups (customers_groups_id, customers_groups_name, customers_groups_type, customers_groups_discount) VALUES ('2', 'Wholesale', '0', NULL);
Changed SQL "update.sql" Code.
customer_groups insert command corrected.
CONTENT OF PACKAGE
Multi-stores v2.0, with fix error 1064 on add specials and with database, (update.sql), with a corrected error in the table customers_groups and with complete packages of languages, (oscommerce more multi-stores) of Spanish, Catalan, English, French, German, Italian and Portuguese and also with easy instructions to use this contribution on oscommerce-2.2rc2a.
INSTRUCTIONS TO USE IN OSCOMMERCE-2.2RC2A
When you finish to install oscommerce-2.2rc2a, before install Multi-stores v2.0, using PHP MyAdmin, go to the created database and delete the administrators table, after simply begin to install Multi-stores v2.0, following the instructions included in the package
Database with a corrected error in the table customers_groups of the database update.sql
This solution was posted by Jean Pierre in the forums at: http://forums.oscommerce.com/index.php?s=&showtopic=70365&view=findpost&p=1079735
VERSIONS AFFECTED: Multistores version 2.0 (not v 1.9), any maybe only needed for mysql 5.xx and/or php 5.xx versions.
Problem: When clicking on the "New Products" button in the Specials page the following error occurs:
1064 - 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 'pd where p.products_id = pd.products_id and pd.language_id = '1' order by prod' at line 1
select p.products_id, pd.products_name, p.products_price from (products p, products_description) pd where p.products_id = pd.products_id and pd.language_id = '1' order by products_name
[TEP STOP]
Solution: Edit catalog/admin/includes/function/general.php line 209 (The parenthesis ")" before "pd" should be AFTER "pd".)
Original code: $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_price 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 = pd.products_id and pd.language_id = '" . (int)$languages_id . "' " . ($admin_allowed_stores[0] == '*' ? " " : " and p2s.stores_id in(" . implode(',' , $admin_allowed_stores) . ") ") . "order by products_name");
Corrected code: $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_price 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 = pd.products_id and pd.language_id = '" . (int)$languages_id . "' " . ($admin_allowed_stores[0] == '*' ? " " : " and p2s.stores_id in(" . implode(',' , $admin_allowed_stores) . ") ") . "order by products_name");
Thanks to Jean Pierre
Incidentally: This problem does not occur in Hobzilla's v 1.9. Line 209 in his file is as follows and also works:
$products_query = tep_db_query("select p.products_id, pd.products_name, p.products_price 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 = pd.products_id and pd.language_id = '" . (int)$languages_id . "' " . ($admin_allowed_stores[0] == '*' ? " " : " and p2s.stores_id in(" . implode(',' , $admin_allowed_stores) . ") ") . "order by products_name");
File attached is precisely the same as this text
Fix several queries MYSQL5.x in admin section
#1054 - Unknown column 'xxxx' in 'on clause'
Full package (excluding the patch below)
Price Schedules updates & bug fixes. Specials never used the pf class.
v1.9 - 10/27/06
Update stock code to use osCommerce 2.2 Milestone 2 Update 060817
Fix several queries with mySQL 5.x syntax
Included percentage based group discounts in stock MS
Add warning when renaming configuration table
Identify the "Super-Admin" in admin side
Disregards the last package, forgot to edit the admin/languages/XXX.php
Now are the right ones included.
Full package.
Nederlandse taal voor multistore 1.8
Let op! admin/customers.php moet nog aangepast worden naar eigen configuratie, dit geld ook voor de engelse !! (rondom lijn 40)
Duitse zijn alleen de aanpassingen in het engels. Dit dient nog vertaald te worden.
--------
Dutch language files for multistore 1.8
admin/customers.php should be edited for your needs starting around line 40
---
NL und deutsche sprache fuer multistore 1.8.
NL ist complet, nur deutsche sprache soll noch uberstetzt werden.. Habe nuer die extra englische text zugefeugt...
In admin/customers.php soll man ab linie 40 beachten in jeden sprache dass mann dass nach eigener config. ersetzen soll!!
Includes default directory structure with files that were updated.
Allows Customer Groups to be based on % discount (or % increase with a negative (-) discount) upto (99.9)% discount and 999% increase (-999)% OR based on the pre-existing price-schedule. The Customer group cannot be both. When you create a customer group if you enter in anything in the % discount textbox, it will use that. If you want to use the price schedule for a group leave that field blank. You can switch back and forth between the customer group typ with the green/red button under admin->customer->customer groups
This is ONLY the easypopulate file, you will want to use the base 2.79 version of Easy Populate submitted by myself on March 1st, 2006. Located here:
http://www.oscommerce.com/community/contributions,500
v1.8 - 02/07/06
Update stock code to use osCommerce 2.2 Milestone 2 Update 051113
Don't allow anyone but super-admin to view hidden configuration (gID=6)
In categories move & copy to product display enabled categories for store
and not just categories that are the same as the distributor assigned
to that admin
Bug fix for orders_products distrib_id (credit: ian oda - tahuti)
Bug fix for product price schedules
Bug fix for customer groups in admin (credit: Ole Hoppe - aragorn108)
The latest release only in zip format - for those who have never unpacked a tar file before.
includes single text file indicating 2 lines of code changes that if unmodified would give tep_stop errors.
v1.7 - 02/01/05
--------------------------
- Updated Admin to allow multiple logins
- Specials _really_ work now per store
- Added Quantity Pricing module that is customer based
- Pricing Schedules available per store
- Shopping cart box not displaying for non-logged in users
- Added Distributors for ease of administration of products & categories
- Included language multi-stores functionality
- Code optimization
- Display logged in user in title bar
- Don't show language box if only 1 language is enabled for store
- Auto populate lang_to_store values for default store
- Moved administration side catalog paths into DB
- Catalog logo pulled from Store logo (if exists)
Yes it is finally here the update to version 1.? and 1.? from 1.4!! Hopefully here to stay.... that is!
This is the modified version of the contribution newsdesk_v1.48.3 originally created by Carsten.
I have only added M-S functionality and renamed it newsdesk_v1.48.4 with modified install instructions, .sql file, and version changes. The two most notable bugs are listed in the version changes.
v1.4 - 06/24/04
Updated also_purchased_products
Added function to rolldown Store enable to subcategories & products of a top category in admin
Added store enable at category & product creation time
Fixed bugs in store creation / update
Use either v1.3 or v1.3b this file effectively makes it v1.3c. Simply overwrite catalog/includes/modules/new_products.php.
Fixed bug in sql statement on catalog/includes/modules/new_products.php (yes, again!)
v1.3b - 06/13/04
Fixed bug in sql statement on catalog/includes/modules/new_products.php
v1.3 - 06/07/04
Moved stores admin into its own box
Moved admin configuration selector into configuration section
Fixed Order History bug in Account
Fixed Stores to Specials Bug
There was an extra comma in the update.sql file in the last INSERT into STORES table. Please use this file to update your database instead of update.sql included in v1.2 (or remove the extra ,
'configuration', '1', ,'1', now());
becomes:
'configuration', '1', '1', now());
v1.2 - 02/06/04
Updated Installation Instructions
Included manufacturers_to_stores ability
Added super-admin functionality
Fixed several bugs relating to cPath being shown when product wasn't enabled for store
Optimized display of boxes relating to products
v1_1 zip file did not upload correctly.
Please download this file instead of one below.
v1.1 - 01/08/04
Updated Installation Instructions
Included specials_to_stores ability UPDATED/ADDED:
- catalog/specials.php
- catalog/includes/database_tables.php
- catalog/includes/boxes/specials.php
- admin/specials.php
- admin/includes/database_tables.php
- admin/includes/languages/english/specials.php
- ADDED specials_to_stores table creation in update.sql
Fixed bug in update.sql syntax for ALTER TABLE orders
Fixed bug where Store image wasn't displaying
- admin/categories.php
ENJOY!
These modifications allow you to assign specific products and categories to multiple stores that you define in the administration panel. The products and categories
will not be able to be manipulated via the web-browsers address bar (like in most
other multi-shop implementations). Also, there is no "one store to rule them all".
You decide which categories you want displayed on which store-front. You decide
which products in that category you want displayed on which store-front. Shopping
carts are NOT shared between the sites.
