You are here:  » Getting XML data


Getting XML data

Submitted by wimble on Mon, 2006-05-22 21:45 in

Can you suggest an easy way to get certain data out of my XML file? I need to get both a thumbnail and a large image from the file to be used on two different pages.

I know I can use the 'Extras' section on the admin page to turn on any tags I want to use, but in some cases I don't want them showing up on the product page.

Thanks,
Chris

Submitted by support on Tue, 2006-05-23 10:39

Hi Chris,

This involves creating a new field in the database and all the associated code to enable you to register a field from the feed against the new field and to import it. The easiest one to copy would be "Image URL" as it is not a required field.

Firstly, you would need to add a new column to the database with the required name, or perhaps a generic name like "misc1" for example. You can do this with a db tool like PHPMyAdmin, Webmin or from the "mysql" command line tool if you have shell access to your server.

After creating the new field, you would need to write code to enable it to be registered, and for it to be imported. Modifications would be required in admin/feeds_register_step2.php and includes/admin.php (in the admin_register() and admin_import() functions).

Finally, you would then need code to use the new variable in the html pages, where it would be available within the $product array with whatever name you created for the new field in the database, for example $product["misc1"].

Hope this helps..
Cheers,
David.