osCommerce and osCMax shopping cart software forums

Shopping Cart Software

osCommerce with teeth!

 
 

Multi-Stores shop system for OSCMAX

This is a discussion on Multi-Stores shop system for OSCMAX within the osCMax Projects Discussion forums, part of the osCMax v2.0 Forums category; A new project_project entry has been added: Multi-Stores shop system for OSCMAX Version 1.4 ============= These modifications allow you to ...


Go Back   osCommerce and osCMax shopping cart software forums > osCMax v2.0 Forums > osCMax Projects Discussion

Register FAQ Members List Calendar Mark Forums Read


Free community membership! Fast easy FREE membership
Reply

 

LinkBack (2) Thread Tools
 
Old 04-26-2007, 09:11 PM
jpf's Avatar
jpf jpf is offline
Moderator

 
Join Date: Sep 2003
Location: Manitoba, Canada
Posts: 1,684
Thanks: 2
Thanked 94 Times in 80 Posts
Thanks: 2
Thanked 94 Times in 80 Posts
Rep Power: 12
jpf is a glorious beacon of lightjpf is a glorious beacon of lightjpf is a glorious beacon of lightjpf is a glorious beacon of lightjpf is a glorious beacon of lightjpf is a glorious beacon of light
Default Multi-Stores shop system for OSCMAX

A new project_project entry has been added:

Multi-Stores shop system for OSCMAX

Quote:
Version 1.4
=============
These modifications allow you to assign specific products and categories to multiple stores that you define in the administration panel. The products and categories
__________________
JPF - osCMax Fourm Moderator
Try out our osCMax at: Live Catalog Demo
Limited access Admin: Live Admin Demo
Feel free to add products they way you want and then purchase them -=+=- Sorry nothing will be billed or shipped!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
The Following 4 Users Say Thank You to jpf For This Useful Post:
ALElder (04-27-2007), altenter (05-18-2007), michael_s (04-26-2007), MindTwist (04-10-2008)
  #71  
Old 03-26-2008, 06:44 AM
osCMax Testing Team
 
Join Date: Oct 2006
Location: Atlanta GA
Posts: 148
Thanks: 8
Thanked 13 Times in 9 Posts
Rep Power: 2
ALElder
Smile Multi-Stores shop system for OSCMAX

I almost have this MOD running at 100% still having a little trouble can anyone help me on this.

1. The main site images are all working but on the sub sites I can see the main image only can't click and enlarge and Mo Pics not working?

I have SSH access but dont understand how to set it up

Thanks,

Adam
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Advertisement
  #72  
Old 04-03-2008, 09:40 AM
osCMax Testing Team
 
Join Date: Oct 2006
Location: Atlanta GA
Posts: 148
Thanks: 8
Thanked 13 Times in 9 Posts
Rep Power: 2
ALElder
Default Re: Multi-Stores shop system for OSCMAX

Any ideas on this please help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Advertisement
  #73  
Old 04-06-2008, 01:36 PM
MindTwist's Avatar
Active Member
 
Join Date: Jun 2007
Location: Barcelona, Spain
Posts: 338
Thanks: 9
Thanked 26 Times in 25 Posts
Rep Power: 3
MindTwist will become famous soon enoughMindTwist will become famous soon enough
Default Re: Multi-Stores shop system for OSCMAX

So I finally have been able to try to install multi stores myself, and for now I have not been so lucky.

I have carefully merged the downloaded 1.4.1 files with my current OSCMAX installation (it has been retouched on many places, so I can not just replace all the new files).

Apparently the installation has gone quite smooth (you might think I am crazy, because I am working on top of a live store), but on the cloned store things do not seem so good. I have created a test category with some test products. I have activated them on the new store. And on the new store I only see that category on the left column (categories box).

But if I try to see a product that is not active on the new store, I can still see it too. If I check out the new products, I still see products on the other store. If I try to open the new category, I get the 1054 - Unknown column 's.specials_id' in 'on clause' error message, which doesn't seem to go away installing the updated files from multishop_fixzip.zip (index.php is what is supposed to be wrong)

The two installations seem to get well along toguether. I have been able to use different templates on each one. I have different configuration tables on the database, I have different configure.php and database_tables.php on /includes and /admin/includes ...

It didn't go so bad, but I hoped it would be better/easier than it is coming out to be

I am running:
Linux 2.6.9-42.ELsmp
Apache/1.3.39
MySQL 5.0.45-community
PHP 5.2.2 (Zend: 2.2.0)
__________________
MindTwist of Twisted Reality and Twisted Tienda
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #74  
Old 04-06-2008, 03:18 PM
MindTwist's Avatar
Active Member
 
Join Date: Jun 2007
Location: Barcelona, Spain
Posts: 338
Thanks: 9
Thanked 26 Times in 25 Posts
Rep Power: 3
MindTwist will become famous soon enoughMindTwist will become famous soon enough
Default Re: Multi-Stores shop system for OSCMAX

Good for me, I must have done something better the second try. I have only done root and /includes folders "merging", while forgeting about the admin section (since I already had the needed info on the database), and just using the fallback template from my previous try.

I am still getting the 1054 - Unknown column 's.specials_id' in 'on clause' errors, but now at least when I try to go to a product that should not be active on this store, I get an error. products_new also only shows me the one product I have on this store.

allprods.php shows me all products (makes me wonder if it is a standard OSCMAX file), and trying to do a search gives me the error 1066 - Not unique table/alias: 'c', which tells me I still have a LOT of work to do before multistores is working 100% for me...
__________________
MindTwist of Twisted Reality and Twisted Tienda
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #75  
Old 04-07-2008, 12:27 PM
habelson's Avatar
Member
 
Join Date: Sep 2007
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
habelson is on a distinguished road
Default Re: Multi-Stores shop system for OSCMAX

OK,
first, ALEIder, I need to know more information about how you set up the second instance of your store in order to help you. Did you use symbolic links? Or did you copy files?

second, MindTwist, my first question to you is.. are you using MySQL 5? I have found that a handful of the queries in the multi-store mod are not MySQL 5 friendly. So if that is the case I can solve atleast one of your problems, as this is the most likely cause for the 1054 error.

You may also find that catalog_products_with_images needs to be modified in order to work with the multi-store mod.

I will look at my allprods.php file and see if I have any problems with it.

As far as your first question of symbolic links with php goes, I'm assuming you've figured that out?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #76  
Old 04-07-2008, 01:08 PM
osCMax Testing Team
 
Join Date: Oct 2006
Location: Atlanta GA
Posts: 148
Thanks: 8
Thanked 13 Times in 9 Posts
Rep Power: 2
ALElder
Default Re: Multi-Stores shop system for OSCMAX

I believe that it was symbolic links. How would I know for sure?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #77  
Old 04-07-2008, 01:31 PM
MindTwist's Avatar
Active Member
 
Join Date: Jun 2007
Location: Barcelona, Spain
Posts: 338
Thanks: 9
Thanked 26 Times in 25 Posts
Rep Power: 3
MindTwist will become famous soon enoughMindTwist will become famous soon enough
Default Re: Multi-Stores shop system for OSCMAX

habelson,

I haven't yet bothered with symbolic links, for now I have copied from one domain to the other the main dirs I neede:

/
/admin
/includes
/templates

After that I also copied /images so the web page wouldn't be too messed up, and then /FCKeditor because otherwise categories.php on admin would not work at all.

Live store is now set up on Twisted Tienda : Bienvenidos a www.twistedtienda.com , and the "copy" store is now on Twisted Tienda : Bienvenidos a www.twistedtienda.com

Both stores share host and database. Right now they are setup on folders /home/twistedt/public_html/ and /home/twistedr/public_html/ , first one is store id 1 and for now has 0 modifications on it. Second one is store id 2, and does have all the modified files with multi store support.

Store 1 uses configuration table on the DB, store 2 uses configuration_tr. They seem to be geting along toguether quite well, store 2 has a few different settings, like template, I am just using fallback template to avoid mistakes on my own template.

Both stores still share all the other tables like articles, newsdesk, etc. which I won't bother duplicating until the stores are working ok with the default multi stores things (categories, products, ...)

And yes, I am running MySQL 5.0.45-community , so I am quite sure the 1054 errors come from the sql queries on index.php and the () on the join. I have tried fixing them, but my SQL knowledge is poor to say the least.

Working on it right now!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #78  
Old 04-07-2008, 01:39 PM
MindTwist's Avatar
Active Member
 
Join Date: Jun 2007
Location: Barcelona, Spain
Posts: 338
Thanks: 9
Thanked 26 Times in 25 Posts
Rep Power: 3
MindTwist will become famous soon enoughMindTwist will become famous soon enough
Default Re: Multi-Stores shop system for OSCMAX

Oh, and I do not have shell access on my host. That's why I asked previously if anyone knew how to do symlinks with PHP, because I remember doing it before a few years ago when seting up a Postnuke multi site.

For now since I am just testing/seting it up, I do not mind copying the files. After I am done with everything and I know exactly what files will need to be diferent on what store, and what files will be exactly the same, I will worry about symlinking the directories that need to be linked. If I set up several stores I surely do not want to bother uploading several times every single file I need to change...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #79  
Old 04-07-2008, 02:36 PM
MindTwist's Avatar
Active Member
 
Join Date: Jun 2007
Location: Barcelona, Spain
Posts: 338
Thanks: 9
Thanked 26 Times in 25 Posts
Rep Power: 3
MindTwist will become famous soon enoughMindTwist will become famous soon enough
Default Re: Multi-Stores shop system for OSCMAX

Ok, so I do not get along with SQL. At all. Or MySQL 5. Or whatever it is that causes the 1054 error... I kinda know that it needs to be fixed by using () on the joins, but I am just unable to find out how to fix this queries. They are way too much for me. They would already be too much without the added "multi stores" parts.

In case anyone can lend me a hand, here is the 8 sql queries on index.php as I had them before MS (I guess they are as standard OSCMAX 2.0):

PHP Code:
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
  if (isset(
$HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
    if (
$status_product_prices_table == true) {
      
$listing_sql "select " $select_column_list " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from left join " $product_prices_table " as tmp_pp using(products_id), " TABLE_PRODUCTS " p, " TABLE_PRODUCTS_DESCRIPTION " pd, " TABLE_MANUFACTURERS " m, " TABLE_PRODUCTS_TO_CATEGORIES " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
    } else { 
// either retail or no need to get correct special prices
      
$listing_sql "select " $select_column_list " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " TABLE_PRODUCTS " p left join " TABLE_SPECIALS_RETAIL_PRICES " s on p.products_id = s.products_id, " TABLE_PRODUCTS_DESCRIPTION " pd, " TABLE_MANUFACTURERS " m, " TABLE_PRODUCTS_TO_CATEGORIES " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
    } 
// end else { // either retail...
  
} else {
    if (
$status_product_prices_table == true) {
      
$listing_sql "select " $select_column_list " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " TABLE_PRODUCTS " p left join " $product_prices_table " as tmp_pp using(products_id), " TABLE_PRODUCTS_DESCRIPTION " pd, " TABLE_MANUFACTURERS " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
    } else { 
// either retail or no need to get correct special prices
      
$listing_sql "select " $select_column_list " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " TABLE_PRODUCTS " p left join " TABLE_SPECIALS " s on p.products_id = s.products_id, " TABLE_PRODUCTS_DESCRIPTION " pd, " TABLE_MANUFACTURERS " m where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
    } 
// end else { // either retail...
  
}
} else {
  if (isset(
$HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
    if (
$status_product_prices_table == true) {
      
$listing_sql "select " $select_column_list " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " TABLE_PRODUCTS " p left join " $product_prices_table " as tmp_pp using(products_id), " TABLE_PRODUCTS_DESCRIPTION " pd, " TABLE_MANUFACTURERS " m, " TABLE_PRODUCTS_TO_CATEGORIES " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id "' and p2c.categories_id = '" . (int)$current_category_id "'";
    } else { 
// either retail or no need to get correct special prices
      
$listing_sql "select " $select_column_list " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " TABLE_PRODUCTS " p left join " TABLE_SPECIALS " s on p.products_id = s.products_id, " TABLE_PRODUCTS_DESCRIPTION " pd, " TABLE_MANUFACTURERS " m, " TABLE_PRODUCTS_TO_CATEGORIES " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id "' and p2c.categories_id = '" . (int)$current_category_id "'";
    } 
// end else { // either retail...
  
} else {
    if (
$status_product_prices_table == true) {
      
$listing_sql "select " $select_column_list " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status, tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status, tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " TABLE_PRODUCTS_DESCRIPTION " pd left join " $product_prices_table " as tmp_pp using(products_id), " TABLE_PRODUCTS " p left join " TABLE_MANUFACTURERS " m on p.manufacturers_id = m.manufacturers_id, " TABLE_PRODUCTS_TO_CATEGORIES " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id "' and p2c.categories_id = '" . (int)$current_category_id "'";
    } else { 
// either retail or no need to get correct special prices
      
$listing_sql "select " $select_column_list " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_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_RETAIL_PRICES " s on p.products_id = s.products_id, " TABLE_PRODUCTS_TO_CATEGORIES " p2c where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id "' and p2c.categories_id = '" . (int)$current_category_id "'";
    } 
// end else { // either retail...
  
}

OMG... message too long, I'll split it in two
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #80  
Old 04-07-2008, 02:37 PM
MindTwist's Avatar
Active Member
 
Join Date: Jun 2007
Location: Barcelona, Spain
Posts: 338
Thanks: 9
Thanked 26 Times in 25 Posts
Rep Power: 3
MindTwist will become famous soon enoughMindTwist will become famous soon enough
Default Re: Multi-Stores shop system for OSCMAX

Here are the same 8 queries as Multi Stores wants them. This queries have been taken from index.php on multi-stores_v1_4_1 MAX_0.zip (after some comments clean up)

These are the ones giving me the 1054 errors

PHP Code:
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
  if (isset(
$HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
    if (
$status_product_prices_table == true) {
      
$listing_sql "select " $select_column_list " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status = '1' AND s2s.stores_id = '" STORES_ID "', tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status = '1' AND s2s.stores_id = '" STORES_ID "', tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from (" $product_prices_table " as tmp_pp using(products_id), " TABLE_PRODUCTS " p, " TABLE_PRODUCTS_DESCRIPTION " pd, " TABLE_MANUFACTURERS " m, " TABLE_PRODUCTS_TO_CATEGORIES " p2c ) LEFT JOIN " TABLE_SPECIALS_TO_STORES " s2s ON s.specials_id = s2s.specials_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.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
    } else { 
// either retail or no need to get correct special prices
      
$listing_sql "select " $select_column_list " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status = '1' AND s2s.stores_id = '" STORES_ID "', s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status = '1' AND s2s.stores_id = '" STORES_ID "', s.specials_new_products_price, p.products_price) as final_price from (" TABLE_PRODUCTS " p left join " TABLE_SPECIALS_RETAIL_PRICES " s on p.products_id = s.products_id, " TABLE_PRODUCTS_DESCRIPTION " pd, " TABLE_MANUFACTURERS " m, " TABLE_PRODUCTS_TO_CATEGORIES " p2c ) LEFT JOIN " TABLE_SPECIALS_TO_STORES " s2s ON s.specials_id = s2s.specials_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.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
    } 
// end else { // either retail...
  
} else {
    if (
$status_product_prices_table == true) {
      
$listing_sql "select " $select_column_list " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status = '1' AND s2s.stores_id = '" STORES_ID "', tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status = '1' AND s2s.stores_id = '" STORES_ID "', tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from " TABLE_PRODUCTS " p, " TABLE_PRODUCTS_DESCRIPTION " pd, " TABLE_MANUFACTURERS " m left join " TABLE_SPECIALS " s on p.products_id = s.products_id LEFT JOIN " TABLE_SPECIALS_TO_STORES " s2s ON s.specials_id = s2s.specials_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 pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
    } else { 
// either retail or no need to get correct special prices
      
$listing_sql "select " $select_column_list " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status = '1' AND s2s.stores_id = '" STORES_ID "', s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status = '1' AND s2s.stores_id = '" STORES_ID "', s.specials_new_products_price, p.products_price) as final_price from " TABLE_PRODUCTS " p left join " TABLE_SPECIALS " s on p.products_id = s.products_id, " TABLE_PRODUCTS_DESCRIPTION " pd, " TABLE_MANUFACTURERS " m LEFT JOIN " TABLE_SPECIALS_TO_STORES " s2s ON s.specials_id = s2s.specials_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 pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
    } 
// end else { // either retail...
  
}
} else {
  if (isset(
$HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
    if (
$status_product_prices_table == true) {
      
$listing_sql "select " $select_column_list " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status = '1' AND s2s.stores_id = '" STORES_ID "', tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status = '1' AND s2s.stores_id = '" STORES_ID "', tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from (" TABLE_PRODUCTS " p left join " TABLE_SPECIALS " s on p.products_id = s.products_id, " TABLE_PRODUCTS_DESCRIPTION " pd, " TABLE_MANUFACTURERS " m, " TABLE_PRODUCTS_TO_CATEGORIES " p2c ) left join " $product_prices_table " as tmp_pp using(products_id), where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id "' and p2c.categories_id = '" . (int)$current_category_id "'";
    } else { 
// either retail or no need to get correct special prices
      
$listing_sql "select " $select_column_list " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status = '1' AND s2s.stores_id = '" STORES_ID "', s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status = '1' AND s2s.stores_id = '" STORES_ID "', s.specials_new_products_price, p.products_price) as final_price from " TABLE_PRODUCTS " p left join " TABLE_SPECIALS " s on p.products_id = s.products_id, " TABLE_PRODUCTS_DESCRIPTION " pd, " TABLE_MANUFACTURERS " m, " TABLE_PRODUCTS_TO_CATEGORIES " p2c where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id "' and p2c.categories_id = '" . (int)$current_category_id "'";
    } 
// end else { // either retail...
  
} else {
    if (
$status_product_prices_table == true) {
      
$listing_sql "select " $select_column_list " p.products_id, p.manufacturers_id, tmp_pp.products_price, p.products_tax_class_id, IF(tmp_pp.status = '1' AND s2s.stores_id = '" STORES_ID "', tmp_pp.specials_new_products_price, NULL) as specials_new_products_price, IF(tmp_pp.status = '1' AND s2s.stores_id = '" STORES_ID "', tmp_pp.specials_new_products_price, tmp_pp.products_price) as final_price from (" TABLE_PRODUCTS_DESCRIPTION " pd left join " $product_prices_table " as tmp_pp using(products_id), " TABLE_PRODUCTS " p left join " TABLE_MANUFACTURERS " m on p.manufacturers_id = m.manufacturers_id, " TABLE_PRODUCTS_TO_CATEGORIES " p2c ) LEFT JOIN " TABLE_SPECIALS_TO_STORES " s2s ON s.specials_id = s2s.specials_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 = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id "' and p2c.categories_id = '" . (int)$current_category_id "'";
    } else { 
// either retail or no need to get correct special prices
      
$listing_sql "select " $select_column_list " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status = '1' AND s2s.stores_id = '" STORES_ID "', s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status = '1' AND s2s.stores_id = '" STORES_ID "', s.specials_new_products_price, p.products_price) as final_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_RETAIL_PRICES " s on p.products_id = s.products_id, " TABLE_PRODUCTS_TO_CATEGORIES " p2c ) LEFT JOIN " TABLE_SPECIALS_TO_STORES " s2s ON s.specials_id = s2s.specials_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 = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id "' and p2c.categories_id = '" . (int)$current_category_id "'";
    } 
// end else { // either retail...
  
}

I also have 1054-problem.txt that should be fixing this but on the first try I didn't get it to work with that. On that fix they only give you 4 queries... But I'll give it a try again now and see if I can figure out exactly what changes they