You are here:  » SQL command to remove specific merchant


SQL command to remove specific merchant

Submitted by ccgale on Thu, 2013-09-05 15:19 in

As per the title,

Is there an sql command which could be used to delete all records if the merchant equals x? The reason I ask is that I import from Affiliate Window using their category imports and for some reason it keeps importing a couple of merchants I am not a member of, nor do I want to be. For me, it is far easier to import the category feed and then remove the merchant after, rather than importing individual merchant feeds as I end up with both men and women's items that way.

Thanks,
Carl

Submitted by support on Thu, 2013-09-05 17:00

Hello Carl,

The "raw" SQL to remove specific merchants from the `pt_products` table would be:

DELETE FROM `pt_products` WHERE merchant IN ('Merchant 1','Merchant 2')

However, if you are receiving a feed that contains merchants you are not subscribed to or do not wish to feature on your site; you could alternatively apply a "Drop Record RegExp" filter to the Merchant field for that feed, and in the text box on the configuration page for the filter, enter:

(Merchant 1|Merchant 2)

...and then re-import, as filters are only applied at import time...

Hope this helps!

Cheers,
David.
--
PriceTapestry.com

Submitted by ccgale on Thu, 2013-09-05 17:16

The second solution sounds the best, however, I seem not to have a merchant filter in the drop down box.

Submitted by support on Thu, 2013-09-05 17:23

Sorry Carl, 'merchant' isn't filterable by default - it came up very recently so overlooked that - the modification is described in this comment but for your convenience, I will email you the mods as described in just a moment...

Cheers,
David.
--
PriceTapestry.com