Hi David
Would like to exclude all products containing the word "Preowned". Can you please advise how to do this with includes/admin.php ??
Cheers
Adrian
Hi David,
Sorry should have said I'm looking to do this for all feeds and looking for a way to do it once rather than have to create a filter for each feed.
Is this possible ?
Cheers
Adrian
Hi Adrian,
Sure - you could plumb it into the import record handler function in includes/admin.php. Look for the following code around about line 152:
if ($admin_importFeed["field_category"])
..and INSERT the following new code immediately BEFORE that line:
if (strpos($importRecord["name"],"Preowned")!==FALSE) return;
Cheers,
David.
Hi David,
Many thanks for this. If I wanted to stop products with other words for example "console", could I plug that in to the code above with a pipe character, or would I need to repeat that line of code with the new word ?
Cheers
Adrian
Hi Adrian,
Just repeating the line is the easiest way, but a slightly neater way of doing things would be:
$stopWords = array("Preowned","second hand","resale");
foreach($stopWords as $stopWord)
{
if (strpos($importRecord["name"],$stopWord)!==FALSE) return;
}
...then just edit the $stopWords array with the words / phrases in quotes, comma separated.
Cheers,
David.
Hi Adrian,
Add a "Drop Record" filter to the Product Name field, and enter "preowned". At the next import anything with Preowned in the title will not be imported!
Cheers,
David.