Jump to content
Sign in to follow this  
expert

SUPPORT : XML Export contribution

Recommended Posts

This is support threat of XML Export contrib. Please post any query here if you need any assistance or help or comment,

 

Basicaly this contrib helps you creating XML feed for products in your db. You can export whole db or you can select any categories to export.

You can easily modify XML structure.

 

You can donwload it from http://www.oscommerce.com/community/contributions,5354

 

Now I'm focusing on XML Import feature. Importing XML is a little bit tedious for me but its time to create alternative for Easy Populate since Vendors start feeding in XML. Better to implement some XML maps to import from various vendor feeds. If there is any contributer to give me a hand it would be really apreciated.

Edited by expert

Share this post


Link to post
Share on other sites

expert >> i have make it launges to english and danish, and with the header and footer, so it look the rest a the admin. but i have som trouble when the file is generate, the header and footer is gone. Will you have the new files. ???

 

//Michael

Share this post


Link to post
Share on other sites
expert >> i have make it launges to english and danish, and with the header and footer, so it look the rest a the admin. but i have som trouble when the file is generate, the header and footer is gone. Will you have the new files. ???

 

//Michael

 

 

Hi,

 

Very good contrib ! Just what I needed and at the right time also ! Thanks expert !

 

 

a few hints for newies :

 

Just put an additional link in catalog/admin/includes/boxes/catalog.php (u can use also any other if you whish)

Add the filename in the filenames.php

Define translation in english.php ( and all other languages) for link in catalog.php

 

You can also put an additional BACK to Admin link like the following (easy way) at the very bottom of xml_export.php or you can tweak it to fit in original admin area if you want:

 

<td colspan="2"><p><a href="http://you path to catalog folder/catalog/admin/categories.php?selected_box=catalog"><b>... Back to ADMIN</b></a></p><input type="submit" value=" Go XML "></form></td>

 

Have fun!

Share this post


Link to post
Share on other sites

@suhy, Actually I was focusing on functionality, so some cosmetic changes can be done on this contrib as you suggested in order to make it easy use.

 

@TheExterminator Unfortunately I didn't work for full admin look and feel stuff. Please see suhy suggestions, so you can got it working it as an admin function over the left navigation.

 

Wen I complete import part of that I will focus on cosmetics, so in additon to functionality you may have nice looking screens :)

Share this post


Link to post
Share on other sites
Hi,

 

Very good contrib ! Just what I needed and at the right time also ! Thanks expert !

a few hints for newies :

 

Just put an additional link in catalog/admin/includes/boxes/catalog.php (u can use also any other if you whish)

Add the filename in the filenames.php

Define translation in english.php ( and all other languages) for link in catalog.php

 

You can also put an additional BACK to Admin link like the following (easy way) at the very bottom of xml_export.php or you can tweak it to fit in original admin area if you want:

 

<td colspan="2"><p><a href="http://you path to catalog folder/catalog/admin/categories.php?selected_box=catalog"><b>... Back to ADMIN</b></a></p><input type="submit" value=" Go XML "></form></td>

 

Have fun!

I did what you said here and keep getting this message when I click on xml Export in my admin: 404 not found

 

The requested resource could not be found.

 

Am I missing something or is there another way to run this php file to export my catalog.

Thanks

David

Share this post


Link to post
Share on other sites
I did what you said here and keep getting this message when I click on xml Export in my admin: 404 not found

 

The requested resource could not be found.

 

Am I missing something or is there another way to run this php file to export my catalog.

Thanks

David

 

That's cause your link xml export in admin panel is not working ...

 

Your link should look like this ( if you are using admin access, should work alos, but after you give permissions in admin file access .. ):

'<a href="' . tep_href_link(FILENAME_XML_EXPORT) . '" class="menuBoxContentLink">' . BOX_XML_EXPORT . '</a><br>' . // XML EXPORT

 

Still have to define filename and language definitions ...

 

Give it a try and comment if OK ...

 

I'd post my files, but they are so heavy modified they would ruin all ...

 

Best RGDS

Share this post


Link to post
Share on other sites
@TheExterminator Unfortunately I didn't work for full admin look and feel stuff. Please see suhy suggestions, so you can got it working it as an admin function over the left navigation.

 

Wen I complete import part of that I will focus on cosmetics, so in additon to functionality you may have nice looking screens :)

 

Okay, so you will not make it to other languars ??? I can mail you my files, so you have it.

Share this post


Link to post
Share on other sites
Hi,

I want to insert in the xml file the full image url (ex. http://www.mysite.com/image/image.jpg) and the full url to product (ex. http://www.mysite.com/product-p-160.html.). I use the chemo contrib to short the url's. It is possible?

Tnx.

 

Yes, partially yes. Both image file bane and full image path will be in XMl but full product path is not. It is possible but why do you need full product path in XML?

Here is a sample generated XML

 

<?xml version="1.0" encoding="windows-1254" ?>

- <Products>

- <Product>

<Main_Category_id>207</Main_Category_id>

<Main_Category_Name>Bahçe ve Hırdavat</Main_Category_Name>

<Sub_Category_1_id>244</Sub_Category_1_id>

<Sub_Category_1_Name>Bahçe</Sub_Category_1_Name>

<Sub_Category_2_id>254</Sub_Category_2_id>

<Sub_Category_2_Name>Benzinli Çim Biçme</Sub_Category_2_Name>

<Sub_Category_3_id>288</Sub_Category_3_id>

<Sub_Category_3_Name>MTD</Sub_Category_3_Name>

<Product_id>1304</Product_id>

<Product_Model>GLX105RH15</Product_Model>

<Product_Name>AAAA MTD GLX105RH15 Çim Biçme Traktörü</Product_Name>

<Product_Description><P>Product Specification bla bla bla</P></Product_Description>

<Product_Price>150.00</Product_Price>

<Product_Price_Special>105.00</Product_Price_Special>

<Product_Currency>USD</Product_Currency>

<Product_Vat_Rate>18</Product_Vat_Rate>

<Product_Image>200_105HT_n.jpg</Product_Image>

<Product_Image_Url>http://www.samplesite.com/images/200_105HT_n.jpg</Product_Image_Url>

<Product_Quantity>3</Product_Quantity>

<Product_Weight>0.00</Product_Weight>

<Product_Status>1</Product_Status>

<Product_Manufacturer>MTD</Product_Manufacturer>

<Product_Last_Modified>2007-09-13 00:28:32</Product_Last_Modified>

<Product_Date_Available />

</Product>

</Products>

Edited by expert

Share this post


Link to post
Share on other sites

@expert

 

Thank you for your reply. I want to subscribe my site to the romanian version of http://www.ucuzu.com. They told me that is necessary to make the xml file in this format. Can you help me to make those modifications ?

 

This is a part of my xml file:

 

<?xml version="1.0" encoding="windows-1254" ?>

- <Products>

- <Product>

<Main_Category_id>21</Main_Category_id>

<Main_Category_Name>Cadouri din argint</Main_Category_Name>

<Product_id>29</Product_id>

<Product_Model>Cod: 1.3</Product_Model>

<Product_Name>Pandantiv din chihlimbar</Product_Name>

<Product_Description><b>Pandantiv din chihlimbar cu agatatoare din argint</b><br> <b>Caracteristici produs:</b><br> Lungimea (L)= 4,4 cm<br> Latimea (l)= 1,6 cm<br> Inaltimea(H)= 0,8 cm</Product_Description>

<Product_Price>63.70</Product_Price>

<Product_Price_Special>0.00</Product_Price_Special>

<Product_Currency>RON</Product_Currency>

<Product_Vat_Rate>0</Product_Vat_Rate>

<Product_Image>brosa_m.jpg</Product_Image>

<Product_Image_Url>/images/brosa_m.jpg</Product_Image_Url>

<Product_Quantity>1</Product_Quantity>

<Product_Weight>0.00</Product_Weight>

<Product_Status>1</Product_Status>

<Product_Manufacturer />

<Product_Last_Modified>2007-08-06 15:02:22</Product_Last_Modified>

<Product_Date_Available />

</Product>

 

 

Thank you.

Edited by auro

Share this post


Link to post
Share on other sites

I look at your xml sample file. At <Product_Image_Url> you have the full url. In my file the url is not complete (<Product_Image_Url>/images/brosa_m.jpg</Product_Image_Url>).

Edited by auro

Share this post


Link to post
Share on other sites

Me again :). I solve the problem with the full image url. I added 'http://www.mysite.com' at line 137, before . DIR_WS_CATALOG . DIR_WS_IMAGES . $product['image'];. Is there a way to exclude the inactive products from the feed? I have several products with inactive status, I want to exclude them from the feed....

Edited by auro

Share this post


Link to post
Share on other sites

Hi expert,

 

Just curious as how you are doing with the XML Import? I have also started doing this and have got a working PHP Parser to put the values into an array. But, I am not sure on how to implement the inserting/updating of the database.

 

Any ideas on how i would go about this?

 

Thanks

 

Mike

Share this post


Link to post
Share on other sites
Can anyone help me? :rolleyes: I need to export the feed with the full product url (ex. http://www.mysite.com/product-p-160.html.).

 

I needed the same thing so I added in the file before this line

$xml_file.="\t"."</Product>\n";

this line of code

$xml_file.="\t\t".<product_url>".'http://www.yoursite.com/product_info.php?products_id='.($product['id'])."</product_url>\n";

 

Remember to change the url in whatever is your site's url. :thumbsup:

Share this post


Link to post
Share on other sites

@tcsoftware

:D Thank you. Do you have a solution for this: "Is there a way to exclude the inactive products from the feed? I have several products with inactive status, I want to exclude them from the feed...."

Many thanks.

Share this post


Link to post
Share on other sites
Hi expert,

 

Just curious as how you are doing with the XML Import? I have also started doing this and have got a working PHP Parser to put the values into an array. But, I am not sure on how to implement the inserting/updating of the database.

 

Any ideas on how i would go about this?

 

Thanks

 

Mike

 

Hi Mike,

 

Actually I was on a trip for a while and couldn't spend some time for import. Parsing the XML is not a problem. It is the easiest way but creating/implementing category structure is a bit tedious. I will work on it...

Share this post


Link to post
Share on other sites
@expert

 

Thank you for your reply. I want to subscribe my site to the romanian version of http://www.ucuzu.com. They told me that is necessary to make the xml file in this format. Can you help me to make those modifications ?

 

This is a part of my xml file:

 

<?xml version="1.0" encoding="windows-1254" ?>

- <Products>

- <Product>

<Main_Category_id>21</Main_Category_id>

<Main_Category_Name>Cadouri din argint</Main_Category_Name>

<Product_id>29</Product_id>

<Product_Model>Cod: 1.3</Product_Model>

<Product_Name>Pandantiv din chihlimbar</Product_Name>

<Product_Description><b>Pandantiv din chihlimbar cu agatatoare din argint</b><br> <b>Caracteristici produs:</b><br> Lungimea (L)= 4,4 cm<br> Latimea (l)= 1,6 cm<br> Inaltimea(H)= 0,8 cm</Product_Description>

<Product_Price>63.70</Product_Price>

<Product_Price_Special>0.00</Product_Price_Special>

<Product_Currency>RON</Product_Currency>

<Product_Vat_Rate>0</Product_Vat_Rate>

<Product_Image>brosa_m.jpg</Product_Image>

<Product_Image_Url>/images/brosa_m.jpg</Product_Image_Url>

<Product_Quantity>1</Product_Quantity>

<Product_Weight>0.00</Product_Weight>

<Product_Status>1</Product_Status>

<Product_Manufacturer />

<Product_Last_Modified>2007-08-06 15:02:22</Product_Last_Modified>

<Product_Date_Available />

</Product>

Thank you.

 

I don't know about www.ucuzu.com XML structure but you can modify the XML tags to their requirement. Btw, can you post their XML structure?

Share this post


Link to post
Share on other sites
@tcsoftware

:D Thank you. Do you have a solution for this: "Is there a way to exclude the inactive products from the feed? I have several products with inactive status, I want to exclude them from the feed...."

Many thanks.

 

Sure. Adding prd.products_status = '1' will do that. Change your "where clause part of the query " as following;

 

WHERE
( prd.products_id = prdsc.products_id AND prdsc.language_id = '" . $row_language_id['languages_id'] . "' )
AND prd.products_id = prdtocat.products_id
AND prdtocat.categories_id = " . TABLE_CATEGORIES . ".categories_id
AND ( catdesccurrent.categories_id = " . TABLE_CATEGORIES . ".categories_id AND catdesccurrent.language_id = '" . $row_language_id['languages_id'] . "' )
AND prdtocat.categories_id in (".implode($categories_ids, ', ').")
AND prd.products_status = '1' 
LIMIT 10000");

Edited by expert

Share this post


Link to post
Share on other sites

This is the structure for www.compari.ro (the romanian version of uzuncu). I added full product url and full image url. The xml file was accepted by the compari.ro admin's and the my products are online.

 

 

<Products>

- <Product>

<Main_Category_id>21</Main_Category_id>

<Main_Category_Name>Xxxxxxxx</Main_Category_Name>

<Product_id>29</Product_id>

<Product_Model>xxxxx</Product_Model>

<Product_Name>xxxxxxxxxx</Product_Name>

<Product_Description><b>xxxxxxxxxxxxxxxxxx</Product_Description>

<Product_Price>63.70</Product_Price>

<Product_Price_Special>0.00</Product_Price_Special>

<Product_Currency>RON</Product_Currency>

<product_url>http://www.mysite.com/product_info.php?products_id=100</product_url>

<Product_Image>brosa_m.jpg</Product_Image>

<Product_Image_Url>http://www.mysite.com/images/product.jpg</Product_Image_Url>

<Product_Quantity>1</Product_Quantity>

<Product_Status>1</Product_Status>

<Product_Manufacturer />

</Product>

 

 

Thank you, Erhan!

Edited by auro

Share this post


Link to post
Share on other sites

Is there a way to save the output in .txt format, tab delimited? The .txt file must contain the following fields: Product code, category, product manufacturer, product model, product description, price (with VAT), product currency, Product quantity, full product url and full image url.

 

The field will be delimited by the "|" character and ("\n") character for newline. Each product must be listed on a single line.

 

Thank you.

Edited by auro

Share this post


Link to post
Share on other sites
Is there a way to save the output in .txt format, tab delimited? The .txt file must contain the following fields: Product code, category, product manufacturer, product model, product description, price (with VAT), product currency, Product quantity, full product url and full image url.

 

The field will be delimited by the "|" character and ("\n") character for newline. Each product must be listed on a single line.

 

Thank you.

 

Sure. You have products data. You can use it in another format as well as XML tags that we used here.

 

Sample:

 

$csv_file = $product['model'] . '|' . $product['name'] . '|' . $product['description'] . '\n';

Share this post


Link to post
Share on other sites

I was wondering if there is a XML export mod. that will export your products with their respective .htaccess modified SEF URLs?

 

Hmmm... I know I need one!

 

I am sure their has to be others that need it also...

 

Looks like I am going to have to build one if its not developed already...

 

Expert...

 

Think you could give me a hand with your code so I could format the XML output to build the URL in the same pattern the Ultimate SEO url contrib uses?

 

Could be a great project... you have most of it written... just need to format the output...

 

if it is not already availible...

 

Adam

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×