David
I currently have two categories called:
1) Consoles And Toys
2) Toys
I am currently using the 'Drop record' 'Category' filter to drop the second category 'Toys' but as the category 'Consoles and Toys' includes the word toys it is dropping the products in this category aswell which I don't want.
Is there any way in which I can just remove the category Toys without removing the other?
Tasha
Hi David
I tried this solution and it did not work (Drop Record If Not RegExp).
I am definately sure that i wish to remove the 'Toys' category as we are creating an area specific to games such as computer games etc and need to remove any other entries such as Toys.
Both the two categories 'Consoles and Toys' and 'Toys are in the same feed from the same company.
Do you have any other suggestions?
Tasha
Hi Tasha,
Sure - the easiest thing to do would be to add a new filter - Drop Record Exact Match - which you can use just like Drop Record, except the entire field must match rather than just a substring. Here's the code - paste this into includes/filter.php (just inside the closing PHP tag) to add the new filter:
$filter_names["dropRecordExactMatch"] = "Drop Record Exact Match";
function filter_dropRecordExactMatchConfigure($filter_data)
{
print "Drop record if field matches:<br />";
print "<input type='text' size='40' name='text' value='".widget_safe($filter_data["text"])."' />";
widget_errorGet("text");
}
function filter_dropRecordExactMatchValidate($filter_data)
{
}
function filter_dropRecordExactMatchExec($filter_data,$text)
{
global $filter_dropRecordFlag;
if ($text == $filter_data["text"])
{
$filter_dropRecordFlag = TRUE;
}
return $text;
}
If you're not sure about adding the code, feel free to email me the file and i'll make the modification for you...
Hope this helps!
Cheers,
David.
Hi Tasha,
A modification of the "Drop Record If Not RegExp" would work - but firstly, are you sure you want to be dropping products with the "Toys" category; as the Drop Record filter will not import the product at all - it doesn't just ignore the category field. Another option of course is Category Mapping. If you create a new master category called "Consoles And Toys", and then add "Toys" as an alternative, you will find products with the "Toys" category are then imported with "Consoles And Toys" as the category (after the next import)...
Cheers,
David.