Hi David, trust all is well with you, i'm wondering is there a drop/delete script that can work from admin like product mapping for deleting products from any merchant that includes a term/product that I would prefer not to be on my site?
regards
Phil Stone
www.buy24-7.net
Hi,
Wouldn't it be better to have a new table, like in product or category mapping, where product names can be stored and then during the import process, the importing product names can be matched against values from this table and then not imported if they match? Doing it the other way would mean deleting products after every import which could be a bit of a pain.
Cheers.
Keeop
Hi Keeop,
Sure - I see you point. As an alternative of course, calls to delete.php could be included as part of an automation script; e.g.
wget -O /dev/null http://username:password@example.com/admin/delete.php?q=Red+Widget&confirm=1
wget -O /dev/null http://username:password@example.com/admin/delete.php?q=Blue+Widget&confirm=1
Cheers,
David.
Hi david
thanks for the delete.php script, was wondering is there a way to add delete terms to a list to stop them being imported every time, so that on the delete page you can search for more terms to delete but also show a list of terms currently being deleted on every import?
hope you know what i mean, similar layout to product map with a list of products already mapped under the search button
regards
Phil Stone
www.buy24-7.net
Hi Phil,
Are you looking for something that's global rather than using a Drop Record If Not RegExp filter - which you could add to the product name field for a merchant that you wanted to block import of certain products; using the same format as I often suggest to drop categories, i.e.:
(Product Name|Product Name|Product Name)
Cheers,
David.
Hi Dave
two examples of words i want dropped from all product feeds are "cable" and "bag", was looking a global action that would delete terms from all feeds without having to add a filter to all merchants individually if thats possible
regards
Phil Stone
www.buy24-7.net
Hi Phil,
This could quickly and easily be plumbed in to the import record handler function in includes/admin.php. Look for the following code at the very top of the admin__importRecordHandler() function - line 150 in the distribution:
global $filter_record;
...and then ADD, starting the next line the following code:
$stopWords = array("cable","bag");
foreach($stopWords as $stopWord)
{
if (strpos($record[$admin_importFeed["field_name"]],$stopWord) !== FALSE) return;
}
...simply add more words to the $stopWords array, in quotes and comma separated, as required!
Cheers,
David.
Hi Phil,
Here you go - download, unzip and upload delete.php to /admin/ and then browse to /admin/delete.php. Enter a query. The number of matching products will then be displayed with a link to confirm the deletion.
Hope this helps!
Cheers,
David.