You are here:  » Importing By SKU

Support Forum



Importing By SKU

Submitted by brentmitchell on Fri, 2011-09-02 23:41 in

Hey David,

I have a list of SKU numbers that I'd like to import into the system for each merchant and I've already added the SKU filter to the second page of my feed registration.

How do I use the filter to only bring in the SKU numbers that I want? Is there a way to create a mod that filters results to import vs results to drop? I could just plug in my list of SKUs...everything else would be dropped and I'd be left with my specific list of items. Please let me know if this is possible. Thanks!

Brent

Submitted by support on Sat, 2011-09-03 07:58

Hi Brent,

It's an easy mod to drop records that don't have a value for a particular field. To do this for "sku", look for the following code at line 342 of includes/admin.php

    if (!$importRecord["merchant"]) return;

...and REPLACE with:

    if (!$importRecord["merchant"]) return;
    if (!$importRecord["sku"]) return;

Cheers,
David.
--
PriceTapestry.com

Submitted by brentmitchell on Sat, 2011-09-03 08:25

Thanks David, I will use that.

I am also trying to use the 'drop record if not' filter or another one that will help me out. I am really trying to narrow down the amount of items imported by each merchant. What is the best way to filter out the rest?

Let's say I only want to import items that have the words printer, scanner or accessories....or items that happen to be in certain categories, like inkjet printers or flatbed scanners?

Which filter do I use and do I have to create a new one per word or category? I've seen in the forums using % to surround your words, but not sure if that applies here. Please let me know the best plan...thanks.

Brent

Submitted by support on Sat, 2011-09-03 08:50

Hello Brent,

Drop Record If Not RegExp is the most flexible filter to use in terms of narrowing down. You can specify a list of keywords, and then only when the field the filter is applied to contains those keywords will the record be imported.

It's most often used against the category field; bear in mind that filters are applied in the order in which they are created; so let's say you first want to restrict the categories imported from a feed to just "Inkjet Printers" and "Flatbed Scanners", you would create a new Drop Record If Not RegExp against the category field and in the text box on the configuration page for the filter, you would enter

(Inkjet Printers|Flatbed Scanners)

- it's basically a pipe separated list of matches, all enclosed in brackets - that's the "RegExp"!)

Then, if you find that doesn't narrow things down enough, you could do the same against the product name field, or more likely using Drop Record RegExp which works in the opposite sense - this would allow you to drop products if, for example the name contained "replacement" or "warranty" for example...

Cheers,
David.
--
PriceTapestry.com

Submitted by brentmitchell on Sun, 2011-09-04 01:56

Hey David,

I have been trying to filter a merchant and can't seem to figure out the right way to do it.

I only want to import products in the printers and scanners category. The category is listed as /printers-scanners...here's the link. http://www.newegg.com/Store/Category.aspx?Category=33&name=Printers-Scanners

I've tried Drop Record If Not RegExp to the Category field with these inputs, but can't get all the items from these categories to show up.

(Printers Scanners)
(PrintersScanners)
(Printers-Scanners)

How do you handle special characters when trying to filter results? Thanks for your help!

Submitted by support on Sun, 2011-09-04 08:28

Hi Brent,

Have a go with:

(Printers|Scanners)

That will treat them as separate keywords but should only match that category regardless of what exactly appears between them in the feed. If that imports more categories than required let me know the filename of the feed as you have uploaded it to your /feeds/ folder and I'll download it from your site to my test server and look at the original value in the feed and work out what filter value to use...

Cheers,
David.
--
PriceTapestry.com

Submitted by brentmitchell on Sun, 2011-09-04 17:12

That did it! Thanks!

Submitted by brentmitchell on Mon, 2011-09-05 19:00

Hey David,

Using (Printers|Scanners) hasn't pulled in all the necessary products. Here's the filename...

Newegg_com-Newegg_com_Product_Catalog.txt

Also, here is a link to one of the products that should be importing, but isn't.

http://www.newegg.com/Product/Product.aspx?Item=N82E16828405001

Please let me know what the best way to list in the filters would be...maybe list each subcategory?

Submitted by support on Tue, 2011-09-06 08:41

Hi Brent,

I just checked your site and it appears to have worked as expected; The Evolis Badgy BDG101FRU was imported from the Newegg.com feed and has been mapped to your "Label Printers". If you browse your /pt/ installation by that category, you'll find it on Page 18...

Cheers,
David.
--
PriceTapestry.com