Hello David, I would like to be able to add a list of product names to create a new category. Would that be possible?
It would be excellent if it was a similar function to the product mapping screen where you entered/created a category name, and then enter the products you want to appear in the category..
Thanks Mally
Hi David, that work's well thanks.
It would be great if you could work out an admin fix later when your back, no rush though, thanks very much for your help again
Mally
Hi David
Further to this request.
Would you be able to suggest a way that I can add products to one or more categories?
Thanks Mally
Hi Mally,
That's no so straight forward i'm afraid; as the products table has a single category field. I'll have a think about this for you; it may be possible to do something using multiple values in the category fields separated by | for example, and then changing category search to use LIKE rather than "=", and finally modify categories.php to build the full list.
I check this out on my test server and get back to you if it looks viable. I know you're running a niche site so it should be fine...
Cheers,
David.
Thanks David, your help is appreciated. Cheers Mally
Hi Mally,
Is the category only used for navigation on your site; or is it displayed anywhere in relation to a particular product as part of your site's design?
If the latter, let's say we store the mutli-category field as a comma separated list, would that be suitable for display? If it's not displayed anywhere other than during navigation it shouldn't be a problem...
Cheers,
David.
Hi Mally,
Sure, an admin interface could be created - i'm on the road at the moment but to get you started, it's easy to merge into the import record handler function. In includes/admin.php, look for the following section:
/* apply category mappings */
if (isset($admin_importCategoryMappings[$category]))
{
$category = $admin_importCategoryMappings[$category];
}
...and then ADD the following new code immediately after that:
$categorySet["Category Name 1"] = array("Product 1","Product 2","Product 3");
$categorySet["Category Name 2"] = array("Product 4","Product 5");
foreach($categorySet as $categoryName => $products)
{
if (in_array($record[$admin_importFeed["field_name"]],$products))
{
$category = $categoryName;
}
}
Hope this helps!
Cheers,
David.