Contributions

Features (Category Index)
Search: 

Multi-Stores multiple shop system

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.

Expand All / Collapse All

Fix error 1064 on add specials Dhananjaya 21 Sep 2007

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

Multi-Stores v2.0 dicendicks 3 May 2007
v1.9 Price Patch hobbzilla 3 Feb 2007
Multi-Stores v1.9 hobbzilla 27 Oct 2006
Dutch and German for multistore v1.8 msk69 2 Jul 2006
Dutch and German language files msk69 1 Jul 2006
Percentage based discountes - TAKE 2 hobbzilla 14 Mar 2006
Customer Groups Discounts by Percentage hobbzilla 11 Mar 2006
Easy Populate for M-S hobbzilla 1 Mar 2006
v1.8 hobbzilla 10 Feb 2006
Multi Stores v1.7 Vger 1 Sep 2005
Patch to bring v1.7 to 1.7.1 Ryan Hobbs 24 Feb 2005
Multi-Stores v1.7 Ryan Hobbs 1 Feb 2005
newsdesk_v1.48.4 for M-S multi stores Tim Buckner 29 Oct 2004
V1.4 Ryan Hobbs 24 Jun 2004
#2 fix of new_products.php Ryan Hobbs 14 Jun 2004
v 1.3b Ryan Hobbs 13 Jun 2004
Multi-Stores v1.3 Ryan Hobbs 8 Jun 2004
update.sql Ryan Hobbs 9 Feb 2004
multi-stores_v1_2.zip Ryan Hobbs 6 Feb 2004
multi-stores_v1_1b.zip Ryan Hobbs 8 Jan 2004
multi-stores_v1_1.zip Ryan Hobbs 8 Jan 2004
Multi-Stores multiple shop system Ryan Hobbs 15 Dec 2003

Note: Contributions are used at own risk.