You are here:  » Filter SQL Script

Support Forum



Filter SQL Script

Submitted by babyuniverse on Thu, 2009-04-23 04:21 in

Hi David,

Any ideas iof a script would work to mass add filters,
I currently add a filter now to search and replace a standard affiliate ID to a different ID
Example: Search and Replace Buy URL (XXXX with 1234)

I have to do this for every feed, all with exactly the same filter,
I have had a look at the filter table in the database, but I cant get a SQL query to do the job.

Thanks
Richard

Submitted by support on Thu, 2009-04-23 07:49

Hi Richard,

The easiest thing to do if you don't mind managing this in the code would be to write the filter code into import record handler in includes/admin.php. Look for the following comment on line 258:

/* create product record */

...and then immediately before that line, add the following code to do the search and replace as per your example:

$record[$admin_importFeed["field_buy_url"]] = str_replace("XXXX","1234",$record[$admin_importFeed["field_buy_url"]]);

Cheers,
David.

Submitted by babyuniverse on Fri, 2009-04-24 10:20

Thanks David,

At what point will this add the filter - during register or during import?

Also any idea on a quick way to register multiple feeds, assuming of course that they are all mapped the same way

Richard

Edit: It didnt seem to work at point of register or import.

Submitted by support on Fri, 2009-04-24 10:26

Hi Richard,

It should be applied during import. Could you perhaps email me your modified includes/admin.php and i'll check it out for you, and also send you back some info about quicker registration of similar feeds.

Cheers,
David.