
Originally Posted by
Tieske
Thank You Gerome, and many thanks for this Mod.
It is working fine for two sites now (live site
www.interieurbeslag.nl and test site
www.beslagwinkel.nl) except some little issues.
As discussed earlier:
Does anybody know if there is a way to change the "master catagorie ID" to the "proper catagorie ID" without changing a few hundred products manually in the database?
And is there a solution for the future so I can use easy populate if necessary?
For now I disactivated the cat_filter forthe live site (great define improvement).
Thanks in davance
I added this code at the really bottom of easypopulate.php
So everytime I use this easypopulate, set the master_categories_id to the new products.
PHP Code:
<?php
$sql = "SELECT products_id FROM " . TABLE_PRODUCTS . " where master_categories_id ='0'";
$check_products = $db->Execute($sql);
while (!$check_products->EOF) {
$sql = "SELECT products_id, categories_id FROM " . TABLE_PRODUCTS_TO_CATEGORIES . "
WHERE products_id='" . $check_products->fields['products_id'] . "' LIMIT 1";
$check_category = $db->Execute($sql);
$sql = "UPDATE " . TABLE_PRODUCTS . " SET master_categories_id='" . $check_category->fields['categories_id'] . "'
WHERE products_id='" . $check_products->fields['products_id'] . "'";
$db->Execute($sql);
$check_products->MoveNext();
}
?>
I think that I could maybe add that to the Multisite admin section, however, it is even simpler to add that in easypopulate.php, so you don't bother about that anymore ...
Bookmarks