You are here:  » XML datafeed fields not shown

Support Forum



XML datafeed fields not shown

Submitted by marco@flapper on Tue, 2011-06-28 12:28 in

Hi,
I have a feed where not all the fields are shown when I register the feed. If I look into the datafeed I can see the field (<extra3>) is there, but Pricetapestry doesn't recognize it.

Please don't show the following:
datafeed link (it is a very big file aprox 180MB):
{link saved}

Submitted by support on Tue, 2011-06-28 16:56

Hi Marco,

The correct Format String for your feed is

xml|PRODUCTS/PRODUCT/

..but additional information in the feed may be fooling the autodetection.

On Feed Registration (Step 1), make sure that the autodetected Format String shown in the text box is as above, and after editing if necessary click Next and all fields should appear as expected...

Cheers,
David.
--
PriceTapestry.com

Submitted by marco@flapper on Tue, 2011-06-28 19:22

I did, but then the field extra3 isn't showing.

Submitted by support on Tue, 2011-06-28 19:34

Hi Marco,

I see what's happening, extra3 is only in some records, so the auto-detection does not pick it up. I have downloaded a full copy of the feed to my test server and I will work out the best way to handle this, I'll follow up by email for you...

Cheers,
David.
--
PriceTapestry.com

Submitted by support on Wed, 2011-06-29 08:27

Hi Marco,

Here's a modification to make sure that the sample data contains every field present in the XML, even if not present in the first record. In admin/feeds_register_step2.php, look for the following function, beginning around line 99:

  function myRecordHandler($record)
  {
    global $productRecord;
    $productRecord = $record;
    return 1;
  }

...and REPLACE with:

  function myRecordHandler($record)
  {
    global $productRecord;
    foreach($record as $k => $v)
    {
      $productRecord[$k] = $v;
    }
  }

Cheers,
David.
--
PriceTapestry.com

Submitted by marco@flapper on Wed, 2011-06-29 12:44

Hi,
it works. What is the impact on system load? I guess this step is only at the initial registration so it has no impact on import and the system load during import? So this is a mod I would copy over to new price tapestry sites. Right?

Thanks.

Submitted by support on Wed, 2011-06-29 13:16

Hi Marco,

The only effect will be that moving from Feed Registration Step 1 to Step 2 takes about the same time as going to Step 1 in the first place as it has to read the entire feed to get a full example record.

You're correct, there is no impact on load during import from this mod so you can copy it across to other installs as required!

Cheers,
David.
--
PriceTapestry.com