Re: MultiSite Module Support Thread
Hello there,
I would advise that no one take the changes that I posted in consideration yet. There are still some problems with them. There are quite a few queries that return double products because it takes them from the products_to_categories db table as well. It is quite frustrating but I'm trusting in Him who is all wise to guide me and show me how to fix this.
If anyone has some tips or wants to join me in debugging this, you're most than welcome.
God bless you,
Iasmin
Re: MultiSite Module Support Thread
Quote:
Originally Posted by
HiPCTech
There are quite a few queries that return double products because it takes them from the products_to_categories db table as well.
The query returns double products when it finds more then 1 of the same product_id in the products_to_categories db table. I'll have to leave this until Sunday but I'd greatly appreciate any help. I know that God will help us solve this.
God bless you all and thank you.
Iasmin
Re: MultiSite Module Support Thread
Anyone running an upsell or cross sell mod with multisite?
Thanks
Re: MultiSite Module Support Thread
Quote:
Originally Posted by
HiPCTech
The query returns double products when it finds more then 1 of the same product_id in the products_to_categories db table. I'll have to leave this until Sunday but I'd greatly appreciate any help. I know that God will help us solve this.
Hello everyone!
I've been working on this and the good Lord has guided me to the solution. I've tested it on a few pages and it works but it might still need some testing.
Here is the code that replaced lines 90-95.
PHP Code:
/* Change added by Iasmin Balaj on July 21, 2008. iasminb###################### */
if($str_pos_p2c===false && $str_pos_desc===false)
{
$sql = substr($sql,0,$add_pos).
" INNER JOIN (".TABLE_CATEGORIES_DESCRIPTION." cd, ".TABLE_PRODUCTS_TO_CATEGORIES." p2c)
ON (p2c.categories_id = cd.categories_id
AND p.products_id = p2c.products_id
AND cd.language_id=".$_SESSION['languages_id']."
AND cd.categories_description LIKE '%-".SITE_NAME."-%') ".
substr($sql,$add_pos);
}
// put the new query in the WHERE statement. Find the categories description for this site, match it to p2c and then to the p_id.
elseif($str_pos_p2c!==false && $str_pos_desc!==false) {
$str_pos_where = strpos($sql,'where') + 5;
$sql = substr($sql,0,$str_pos_where).
" \n(cd.language_id=".$_SESSION['languages_id']."
AND cd.categories_description LIKE '%-".SITE_NAME."-%'
AND p2c.categories_id = cd.categories_id
AND p.products_id = p2c.products_id)\n ".
substr($sql,$str_pos_where);
}
// put the new query in the WHERE statement IF p2c is declared but CAT_DESC is not.
elseif($str_pos_p2c!==false) {
$str_pos_where = strpos($sql,'where');
$sql = substr($sql,0,$str_pos_where).
', '.TABLE_CATEGORIES_DESCRIPTION.' cd '.
substr($sql,$str_pos_where);
$str_pos_where = strpos($sql,'where') + 5;
$sql = substr($sql,0,$str_pos_where).
' (p2c.categories_id = cd.categories_id AND p.products_id = p2c.products_id AND cd.language_id=1 AND cd.categories_description LIKE \'%'.SITE_NAME.'%\') AND '.
substr($sql,$str_pos_where);
}
//
else {
$sql = substr($sql,0,$add_pos).
" INNER JOIN ".TABLE_CATEGORIES_DESCRIPTION." cd
ON (p.master_categories_id = cd.categories_id
AND cd.language_id=".$_SESSION['languages_id']."
AND cd.categories_description LIKE '%-".SITE_NAME."-%') ".
substr($sql,$add_pos);
$str_pos_where = strpos($sql,'where') + 5;
$sql = substr($sql,0,$str_pos_where).
" \n(p.products_id = p2c.products_id
AND p.master_categories_id = p2c.categories_id)\n ".
substr($sql,$str_pos_where);
}
I hope that this helps and please let me know if there are any errors.
God bless you,
Iasmin
Re: MultiSite Module Support Thread
Hi there, I'm having a problem with installing this mod to a site. The problem appears in includes/modules/sideboxes/featured.php. According to the instructions, I am supposed to find Line 25 and replace this:
PHP Code:
$random_featured_product = zen_random_select($random_featured_products_query);
with this:
PHP Code:
$random_featured_product = zen_random_select(cat_filter($random_featured_products_query));
However, this is how my file looks for lines 27-29:
PHP Code:
// randomly select ONE featured product from the list retrieved:
//$random_featured_product = zen_random_select($random_featured_products_query);
$random_featured_product = $db->ExecuteRandomMulti($random_featured_products_query, MAX_RANDOM_SELECT_FEATURED_PRODUCTS);
As you can see, the line I am supposed to edit is commented out. I do not believe I have installed any mods that would have edited this file but I do need assistance in what I should do next. Got any ideas? I am using Zen Cart 1.3.8a.
Thanks,
PAE2008
Re: MultiSite Module Support Thread
It appear to also happen at includes/modules/sideboxes/specials.php
PHP Code:
Line 34:
$random_specials_sidebox_product = zen_random_select($random_specials_sidebox_product_query);
Replace by:
$random_specials_sidebox_product = zen_random_select(cat_filter($random_specials_sidebox_product_query));
And this is what I have:
PHP Code:
// $random_specials_sidebox_product = zen_random_select($random_specials_sidebox_product_query);
$random_specials_sidebox_product = $db->ExecuteRandomMulti($random_specials_sidebox_product_query, MAX_RANDOM_SELECT_SPECIALS);
I'm beginning to think that there has been some changes in the Zen Cart code that have not been changed here yet... I would really like to use this mod so any suggestions would be helpful.
Re: MultiSite Module Support Thread
Quote:
Originally Posted by
PAE2008
It appear to also happen at includes/modules/sideboxes/specials.php
PHP Code:
Line 34:
$random_specials_sidebox_product = zen_random_select($random_specials_sidebox_product_query);
Replace by:
$random_specials_sidebox_product = zen_random_select(cat_filter($random_specials_sidebox_product_query));
And this is what I have:
PHP Code:
// $random_specials_sidebox_product = zen_random_select($random_specials_sidebox_product_query);
$random_specials_sidebox_product = $db->ExecuteRandomMulti($random_specials_sidebox_product_query, MAX_RANDOM_SELECT_SPECIALS);
I'm beginning to think that there has been some changes in the Zen Cart code that have not been changed here yet... I would really like to use this mod so any suggestions would be helpful.
Ha! I might be on to something... To properly update these files, would I just add cat_filter after ExecuteRandomMulti(?
For example (includes/modules/sideboxes/specials.php):
PHP Code:
$random_specials_sidebox_product = $db->ExecuteRandomMulti(cat_filter($random_specials_sidebox_product_query), MAX_RANDOM_SELECT_SPECIALS);
If someone could confirm this, it would be very helpful. Sorry for all of the messages... I did not mean to spam the thread if I did so. I could not find any reference anywhere else in here and my edit time kept expiring as I continued to edit files.
PAE2008
Re: MultiSite Module Support Thread
Quote:
Originally Posted by
PAE2008
Ha! I might be on to something... To properly update these files, would I just add cat_filter after ExecuteRandomMulti(?
For example (includes/modules/sideboxes/specials.php):
PHP Code:
$random_specials_sidebox_product = $db->ExecuteRandomMulti(cat_filter($random_specials_sidebox_product_query), MAX_RANDOM_SELECT_SPECIALS);
If someone could confirm this, it would be very helpful. Sorry for all of the messages... I did not mean to spam the thread if I did so. I could not find any reference anywhere else in here and my edit time kept expiring as I continued to edit files.
PAE2008
I haven't looked into these specific files since you've posted, but I've found the adding the (cat_filter......) has worked great for additional features that weren't included in the original mod. It definately doesn't hurt to try. It probably will work. Just remember what files you changed though, just in case it doesn't work.
Blessings,
Jaret
Re: MultiSite Module Support Thread
Quote:
Originally Posted by
PAE2008
Ha! I might be on to something... To properly update these files, would I just add cat_filter after ExecuteRandomMulti(?
For example (includes/modules/sideboxes/specials.php):
PHP Code:
$random_specials_sidebox_product = $db->ExecuteRandomMulti(cat_filter($random_specials_sidebox_product_query), MAX_RANDOM_SELECT_SPECIALS);
PAE2008
I didn't notice this at first, but I wouldn't close the bracket after $random_specials_sidebox_product_query, but rather following MAX_RANDOM_SELECT_SPECIALS)
PHP Code:
$random_specials_sidebox_product = $db->ExecuteRandomMulti(cat_filter($random_specials_sidebox_product_query, MAX_RANDOM_SELECT_SPECIALS));
Re: MultiSite Module Support Thread
Just want to thank those who helped me in this thread. I now have 12 stores running on one DB. All different domains, IPs. Its great. Thanks again..