You are here:  » CSV and XML import only half of the rows

Support Forum



CSV and XML import only half of the rows

Submitted by roberrington on Mon, 2009-08-10 12:39 in

I have uploaded three feeds into the /feeds/, via ftp(filezilla). Two of the feeds are csv and the other is an xml version of one of the csv files, i.e. two of the feeds have the same details in them just stored in a different format. The problem that I am encountering is when I click the import on /admin/index.php approx half the products are not being uploaded. One of the csv files contains 2625 rows, but imports 1280. Then the xml and csv files that contain the same data import different amounts, the xml imports 5449, the csv imports 5446, where as they both should import 9883. Is this a common problem that is encountered with datafeeds?

Submitted by support on Mon, 2009-08-10 12:46

Hi there,

Yes - it is quite common for the actual number of records imported to be significantly less than expected.

Primarily, the required fields must be present and valid - Product Name, Buy URL and Price.

However, the usual reason for a substantial difference is duplication of the product name as product name must be unique per merchant. A common example would be a clothing feed; where the product name might be "Jumper", and a separate field holds the colour and size.

In this scenario, you can use the Text After / Text Before filters with placeholders to combine the values of other fields with the product name. For example, if your feed has a field called COLOUR, you could combine this with the product name by adding a Text After filter with the following:

" %COLOUR%"

(without the quotes, and note the SPACE in the front - this is important otherwise there won't be a space between the product name and the colour in the combined product name).

With that in place, after the following import you might have product names like "Jumper Red" and "Jumper Blue" which would then be imported as separate products as required.

Hope this helps!

Cheers,
David.

Submitted by roberrington on Mon, 2009-08-10 13:54

Problem solved, my feed had multiple merchants supplying the same product, which like you said above was only reading in one of the same product name. Therefore I have broken the feeds down into individual merchants and evrything seems to work fine now, thanks for the quick response David, great help as usual.

Cheers
Rob

Submitted by huewmed on Mon, 2009-11-09 08:53

Hello,

I had the same problem and fixed it using a unique productID that is being submitted with each product in all feeds.
This unique productID is added after the product name using the filters.

That brings me to the next problem, that the script doesn't seem to recognize similar products for the price comparison any more.

Lets say I have 2 ipods from different feeds and stores returned as a search resuls:
no. 1: ipod nano 91254518
[shop: shop1, price: 99.99]
no. 2: ipod nano 95115245
[shop: shop2, price: 95.99]

The script shows both products independently without the option to compare the prices for both products at the different shop. Both products simply show a "more information" link instead of being grouped by the product name (which doesn't work cause they are different) and show "from 95.99" instead of "more information".

Any suggestions how I can make this work?

Submitted by support on Mon, 2009-11-09 09:48

Hi,

The new distribution of Price Tapestry being released tomorrow does support multi-merchant feeds; so if you're happy to hold on for that it would solve the problem. There have been no changes to the /html/ folder or default.css so if you have already worked on your site layout and design your changes will still work (just don't extract /html/ or default.css from the new version)...

Alternatively, it would be straight forward to patch the existing version to strip the last word from the product name at import time (i.e. after the unique filter has been applied). To do this, look for the following comment in includes/admin.php (around about line 258):

/* create product record */

...and then immediately AFTER that position, add the following new code:

$words = explode(" ",$record[$admin_importFeed["field_name"]]);
array_pop($words);
$record[$admin_importFeed["field_name"]] = implode(" ",$words);

If you need to make this merchant (i.e. feed specific) then the above can be wrapped within an IF statement checking the merchant name before applying the fix:

if (
   ($admin_importFeed["merchant"]=="Merchant 1")
   ||
   ($admin_importFeed["merchant"]=="Merchant 2")
   )
{
$words = explode(" ",$record[$admin_importFeed["field_name"]]);
array_pop($words);
$record[$admin_importFeed["field_name"]] = implode(" ",$words);
}

Hope this helps!

Cheers,
David.

Submitted by huewmed on Mon, 2009-11-09 15:51

Hi David,

Thanks for your immediate help!
Will wait and try the new release to avoid programming :)