Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OSC XML Feed - Help & Discussion


Guest

Recommended Posts

Hello i have one more problem

 

I get this message :

 

The XML page cannot be displayed

Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.

You can' t use the "<" character

 

Can any one help or point me in the correct direction - thanks

 

i ve noticed also that in xml2.php everytime the $category_container_name = "0";

around line 152

the problem dissapear.

 

also i tried the solution found in a previous post

$products_extra['products_description'] = ereg_replace ("xxx", "yyy",$products_extra['products_description']);

 

but i didn't have any result

 

 

could you please help me?

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 84
  • Created
  • Last Reply

Top Posters In This Topic

This may help someone else (maybe not) saw some info related to this here but not exact.

 

i installed this with no problems, great help files. i did not change any advance setting and went with the default config. i did get errors on first run of

 

"<b>Warning</b>

: ereg_replace(): REG_BADRPT in

xxxxxxx

on line

<b>201</b> "

 

etc for all the ereg_replace lines. i dont have illegal charactors in any fields except maybe descriptions which this dosent call so instead of going nuts on it i just commented out the ereg_replace lines

 

// search and replace characters from data which xml will not process

//if ($product_name == 1) {

//$row['products_name'] = ereg_replace ("&", " and ", $row['products_name']);

//$row['products_name'] = ereg_replace ("?", "®", $row['products_name']);

//$row['products_name'] = ereg_replace ("?", "", $row['products_name']);

//}

//if ($product_manufacturer == 1) {

//$row['manufacturers_name'] = ereg_replace ("&", " and ", $row['manufacturers_name']);

//$row['manufacturers_name'] = ereg_replace ("?", "®", $row['manufacturers_name']);

//$row['manufacturers_name'] = ereg_replace ("?", "", $row['manufacturers_name']);

//}

 

everything works fine and didnt seem to hurt anything.

hope this helps someone and/or saves them some time.

 

now im going to create a cron job to ping yahoo daily if you need it their manual ping address is "http://api.my.yahoo.com/rss/ping?u=[YOUR RSS URL]" without the quotes.

Link to comment
Share on other sites

Hi,

 

I'm having a view problems with this mod.

 

1st. problem

Products are displayed 2,3 or 4 times.

I've read that some user where having the same problems and that they were working on a solution but i couldn't find the solution in this thread.

 

2nd problem.

When i'm running the XML2.php file i'm getting an error like this:

De XML-pagina kan niet worden weergegeven

 

Kan XML-invoer niet lezen met opmaakmodel XSL. Herstel de fout en klik vervolgens op de knop Vernieuwen of probeer het later opnieuw.

--------------------------------------------------------------------------------

Vereiste spatie ontbreekt. Fout bij het verwerken van bron http://www.navco.nl/xml2.php. Regel 1, positie 4001

PRODUCT><PRODUCT ITEM='96'><NAME>MS4140RS Navigation Radio One Country + Europa 2005/2006</NAME><PRI...

Free translation of the lower part.

mandatory SPACE needed. Error during the processing of http://www.navco.nl/xml2.php. line 1, position 4001

I'm running a heavily modded OSC MS2.2 with both English and Dutch language.

Dutch is the primary language.

Could you please help me solve this problem.

Link to comment
Share on other sites

  • 4 weeks later...

Got to:

---------------------------------------------------------

$category_query = "SELECT

`categories_description`.`categories_name`

----------------------------------------------------------

Replace with:

---------------------------------------------------------

$category_query = "SELECT DISTINCT `categories_description`.`categories_name`

---------------------------------------------------------

 

Go to:

--------------------------------------------------------

$product_query = "SELECT `products`.`products_id`,`products`.

--------------------------------------------------------

 

Replace with:

--------------------------------------------------------

$product_query = "SELECT DISTINCT `products`.`products_id`,`products`.

--------------------------------------------------------

 

Then there will be no duplicated products when using more than 1 language.

You will have 1 time of each product in each language!

 

Hope this helps!

Spyros

Link to comment
Share on other sites

I have tried myself the addon and i had some problems that i solve without seen the solution inside this forum. So i should write them for anyone who has the same problems.

 

1) The XML Feed does not work for products that you don't have assing the manufacter. It will only feed the products that have a manufactor.

2) For greek language shops (and products name-detail) you have to change the echo line just after the

 

////////////////////////////////////////////////////////////////////////////////////////////////

// *** IF YOU NEED TO ADD CUSTOM TAGS AND NEED HELP PLEASE SEE ADVANCED.HTM OR VISIT:

// *** http://www.oscommerce.com/forums/index.php?showtopic=146810 ***

// *** PLEASE DO NOT EDIT PAST THIS POINT UNLESS YOU KNOW WHAT YOU ARE DOING ***

////////////////////////////////////////////////////////////////////////////////////////////////

 

echo '<?xml version="1.0"?>';

like this

 

echo '<?xml version="1.0" encoding="ISO-8859-7"?>';

 

If you need more info just email me !!

Link to comment
Share on other sites

  • 3 weeks later...

Great

 

This works a lot better

 

:thumbsup:

 

 

For swedish users you need ISO-8859-15 if u want swedish signs

 

 

And now to something complete different

 

I want to add language id to my XML2 file. I have 2 days of experence with XML and php but want to try at least once.

Link to comment
Share on other sites

  • 2 weeks later...
  • 4 weeks later...
Great

 

This works a lot better

 

:thumbsup:

For swedish users you need ISO-8859-15 if u want swedish signs

And now to something complete different

 

I want to add language id to my XML2 file. I have 2 days of experence with XML and php but want to try at least once.

 

 

I have now solved the multi language ID:s. You will only add this

 

Replace

$product_query = "SELECT `products`.`products_id`,`products`.`products_quantity`,`products`.`products_model`,`products`.`products_image`,`products`.`products_price`,`products`.`products_date_added`,`products`.`products_last_modified`,`products`.`products_date_available`,`products`.`products_weight`,`products`.`products_status`,`products`.`manufacturers_id`,`products_description`.`products_name`,`products_description`.`products_url`,`categories_description`.`categories_name`,`manufacturers`.`manufacturers_name` FROM `products` INNER JOIN `products_description` ON (`products`.`products_id` = `products_description`.`products_id`) INNER JOIN `products_to_categories` ON (`products_description`.`products_id` = `products_to_categories`.`products_id`) INNER JOIN `categories_description` ON (`products_to_categories`.`categories_id` = `categories_description`.`categories_id`) INNER JOIN `manufacturers` ON (`products`.`manufacturers_id` = `manufacturers`.`manufacturers_id`)

 

With

$product_query = "SELECT DISTINCT `products`.`products_id`,`products`.`products_quantity`,`products`.`products_model`,`products`.`products_image`,`products`.`products_price`,`products`.`products_date_added`,`products`.`products_last_modified`,`products`.`products_date_available`,`products`.`products_weight`,`products`.`products_status`,`products`.`manufacturers_id`,`products_description`.`products_name`,`products_description`.`products_url`,`categories_description`.`categories_name`,`products_description`.`language_id`,`manufacturers`.`manufacturers_name` FROM `products` INNER JOIN `products_description` ON (`products`.`products_id` = `products_description`.`products_id`) INNER JOIN `products_to_categories` ON (`products_description`.`products_id` = `products_to_categories`.`products_id`) INNER JOIN `categories_description` ON (`products_to_categories`.`categories_id` = `categories_description`.`categories_id`) INNER JOIN `manufacturers` ON (`products`.`manufacturers_id` = `manufacturers`.`manufacturers_id`)

 

 

Under insert any extra custom tags put:

 

echo '<LANG_ID>' . $row['language_id'] . '</LANG_ID>';

 

You will now have a product for every language and you will not get any duplicates

 

//Erik

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...

hello.

 

i think this contribution would be great if the xml output would be formatted like this...

 

<lang id=1>

<categorie id=xx>

<product></product>

<subcategorie id=xx>

<product></product>

...

</categorie>

</lang>

<lang id=2>

...

 

you follow me? i dunno if anyone out there can hear me just holla back or email me!

giannimoto at gmail dot com

 

ps. my desire is to use the xml for a osc flash frontend gallery

Link to comment
Share on other sites

  • 5 weeks later...

Hi,

will this contribution work with Ultimate SEO URLs ?

 

Because no matter what I try, all I get is this:

<SHOP>
<CREATED value="Tue Jun 6 12:44:10 CDT 2006"/>
</SHOP>

 

My shop is in site root. I tested on test site which is in catalog folder and without SEO URLs installed and it seems to work fine.

 

Thanks a lot.

Absinthe Original Liquor Store

Link to comment
Share on other sites

Not really, if I use fresh version and change only this bit:

//	Enter the url to your website - do not put 'http://' or enter any slashes
$domain_name 	= 	"www.myshop.com";	// NO SLASHES - EG: www.mysite.com 
//	Enter the folder name of your shop directory, this is normally 'catalog'
//	$catalog_folder	=	"catalog"; // default is 'catalog' - NO SLASHES!
//	If your shop is in your site root (EG: www.mysite.com/index.php) then uncomment the next line.
$catalog_folder	=	"";	
//	Enter the folder name of your product images directory, this is normally 'images'
$image_folder	=	"images"; // NO SLASHES!

All I get is this:

<STOREITEMS>
<CREATED value="Wed Jun 7 2:11:24 CDT 2006"/>
</STOREITEMS>

However is I rename the same file from xml.php to test.xml, I get the following error:

XML Parsing Error: not well-formed
Location: http://www.myshop.com/test.xml
Line Number 155, Column 7:
echo '<' . $xml_tags['master'] . '>';
------^

 

If it works well with SEO URLs and if it works fine in root, it must be something else and according to this thread I'm not the only one. Thinking about the error above, I got the feeling that it may have something to do with PHP4... does it work with it as well?

 

Alex

Absinthe Original Liquor Store

Link to comment
Share on other sites

"OUT OF THE BOX" with configuration of my shop, I am only getting the date displayed at the top. I haven't changed any variables with the exception of adding my site name, directory to shop instead of catalog.

Link to comment
Share on other sites

Nothing to do with PHP...

 

1st site in catalog folder, no SEO URLs, PHP4.4.2, MySQL 4.1.8 works as expected.

 

Same xml.php file used on site in the root with SEO URLs, PHP4.4.2, MySQL 4.1.18 and the following change:

from
$catalog_folder	=	"catalog";
to
$catalog_folder	=	"";
and $domain_name obviously

 

Does NOT work, all you get is this:

<STOREITEMS>
<CREATED value="Thu Jun 8 5:45:40 CDT 2006"/>
</STOREITEMS>

 

I cannot test on site placed in catalog folder with SEO URLs installed but I guess I don't have to if it works for Eyal. I've sent PM to Kenny but to no avail. I see no light at the end of the tunnel atm. :(

Absinthe Original Liquor Store

Link to comment
Share on other sites

I can see the person who created this must be away. Has anyone figured this out?

 

Hi,

 

I manged to talk with Kenny (author of the contribution), he is very busy these days but he promised to try and make time to visit this thread soon and help with problems. Little more patience please.

 

Eyal.

Link to comment
Share on other sites

  • 2 weeks later...

All I seem to be getting is this error:

 

XML Parsing Error: mismatched tag. Expected: </img>.
Location: http://www.txcampingoutfitters.com/xml.php
Line Number 1, Column 183:

 

Any know about this and how to fix it?

Search the forum and contributions before posting. If that doesn't work, keep looking, then post. The forum is for seeking help and advice NOT for someone to do your work for you. Try to do something on your on, if you are going to run a shop then learn how it works.

Link to comment
Share on other sites

  • 1 month later...

For those getting this output:

 

<STOREITEMS>
<CREATED value="Thu Jun 8 5:45:40 CDT 2006"/>
</STOREITEMS>

 

I don't know what the problem is, but I did not understand why the author used INNER JOINS in the sql, so I changed them to left joins and that solved my problem.

 

Change the two instances of "INNER" to "LEFT" and you should be good to go.

 

--gabe

Edited by ganast
Link to comment
Share on other sites

  • 3 weeks later...
I have now solved the multi language ID:s. You will only add this

 

Replace

$product_query = "SELECT `products`.`products_id`,`products`.`products_quantity`,`products`.`products_model`,`products`.`products_image`,`products`.`products_price`,`products`.`products_date_added`,`products`.`products_last_modified`,`products`.`products_date_available`,`products`.`products_weight`,`products`.`products_status`,`products`.`manufacturers_id`,`products_description`.`products_name`,`products_description`.`products_url`,`categories_description`.`categories_name`,`manufacturers`.`manufacturers_name` FROM `products` INNER JOIN `products_description` ON (`products`.`products_id` = `products_description`.`products_id`) INNER JOIN `products_to_categories` ON (`products_description`.`products_id` = `products_to_categories`.`products_id`) INNER JOIN `categories_description` ON (`products_to_categories`.`categories_id` = `categories_description`.`categories_id`) INNER JOIN `manufacturers` ON (`products`.`manufacturers_id` = `manufacturers`.`manufacturers_id`)

 

With

$product_query = "SELECT DISTINCT `products`.`products_id`,`products`.`products_quantity`,`products`.`products_model`,`products`.`products_image`,`products`.`products_price`,`products`.`products_date_added`,`products`.`products_last_modified`,`products`.`products_date_available`,`products`.`products_weight`,`products`.`products_status`,`products`.`manufacturers_id`,`products_description`.`products_name`,`products_description`.`products_url`,`categories_description`.`categories_name`,`products_description`.`language_id`,`manufacturers`.`manufacturers_name` FROM `products` INNER JOIN `products_description` ON (`products`.`products_id` = `products_description`.`products_id`) INNER JOIN `products_to_categories` ON (`products_description`.`products_id` = `products_to_categories`.`products_id`) INNER JOIN `categories_description` ON (`products_to_categories`.`categories_id` = `categories_description`.`categories_id`) INNER JOIN `manufacturers` ON (`products`.`manufacturers_id` = `manufacturers`.`manufacturers_id`)

Under insert any extra custom tags put:

 

echo '<LANG_ID>' . $row['language_id'] . '</LANG_ID>';

 

You will now have a product for every language and you will not get any duplicates

 

//Erik

 

 

 

To display only one language you must replace with

$category_query = "SELECT DISTINCT `categories_description`.`categories_name`,`categories_description`.`categories_id`,`categories`.`parent_id` FROM `categories_description`INNER JOIN `categories` ON (`categories_description`.`categories_id` = `categories`.`categories_id`) WHERE (`categories_description`.`language_id` = 1) ORDER BY `categories_id` ";

 

$product_query = "SELECT DISTINCT `products`.`products_id`,`products`.`products_quantity`,`products`.`products_model`,`products`.`products_image`,`products`.`products_price`,`products`.`products_date_added`,`products`.`products_last_modified`,`products`.`products_date_available`,`products`.`products_weight`,`products`.`products_status`,`products`.`manufacturers_id`,`products_description`.`products_name`,`products_description`.`products_url`,`categories_description`.`categories_name`,`products_description`.`language_id`,`manufacturers`.`manufacturers_name` FROM `products` INNER JOIN `products_description` ON (`products`.`products_id` = `products_description`.`products_id`) INNER JOIN `products_to_categories` ON (`products_description`.`products_id` = `products_to_categories`.`products_id`) INNER JOIN `categories_description` ON (`products_to_categories`.`categories_id` = `categories_description`.`categories_id`) INNER JOIN `manufacturers` ON (`products`.`manufacturers_id` = `manufacturers`.`manufacturers_id`)

WHERE (`products_description`.`language_id` = 1) AND (`categories_description`.`language_id` = 1) AND (`products_to_categories`.`categories_id` = " . $row['categories_id'] . ")";

 

 

i have choosen lanuage_id=1 if you have other you can put e.g. lanuage_id=4

Link to comment
Share on other sites

  • 3 months later...

Thanks for the great contribution.

I wonder if the category TAG can show more than 2 category levels of the product.

Actually in my case I need to take the entire category tree from the beginning (root category).

Any help is appreciated.

Link to comment
Share on other sites

  • 2 months later...

Hi all,

I did the multi-language thing slightly differently, with an HTTP GET parameter and using where clauses instead of SELECT DISTINCT (nominally for performance reasons, although I doubt it will make much of a difference). The first change allows the calling application to specify the language.

 

//	The feed will filter results for multi-language elements according to an input parameter
$feed_language = ($HTTP_GET_VARS['language_id']);

// check to make sure it is a valid number (since the OSC language_id is an int) 
if (!is_numeric($feed_language))	{
exit("OSC XML FEED FAILURE - must pass language_id as an integer parameter, e.g. http://myoscommerce/xml_ml?language_id=1");
}

 

Then, update your product query:

$product_query = "SELECT `products`.`products_id`,`products`.`products_quantity`,`products`.`products_model`,`products`.`products_image`,`products`.`products_price`,`products`.`products_date_added`,`products`.`products_last_modified`,`products`.`products_date_available`,`products`.`products_weight`,`products`.`products_status`,`products`.`manufacturers_id`,`products_description`.`products_name`,`products_description`.`products_url`,`categories_description`.`categories_name`,`manufacturers`.`manufacturers_name` FROM `products` INNER JOIN `products_description` ON (`products`.`products_id` = `products_description`.`products_id`) INNER JOIN `products_to_categories` ON (`products_description`.`products_id` = `products_to_categories`.`products_id`) INNER JOIN `categories_description` ON (`products_to_categories`.`categories_id` = `categories_description`.`categories_id`) INNER JOIN `manufacturers` ON (`products`.`manufacturers_id` = `manufacturers`.`manufacturers_id`)   WHERE (`products_description`.`language_id`={$feed_language}) AND (`categories_description`.`language_id`={$feed_language}) AND (`products_to_categories`.`categories_id` = " . $row['categories_id'] . ")";

 

...and your category query:

$category_query = "SELECT `categories_description`.`categories_name`,`categories_description`.`categories_id`,`categories`.`parent_id` FROM `categories_description`INNER JOIN `categories` ON (`categories_description`.`categories_id` = `categories`.`categories_id`) WHERE (`categories_description`.`language_id`={$feed_language})  ORDER BY `categories_id`";

 

Just an alternative approach. If you want the whole php file, email me at j kavanagh @ propelligence dot com.

 

Great contribution Kenny.

 

-Jeff

 

 

 

To display only one language you must replace with

$category_query = "SELECT DISTINCT `categories_description`.`categories_name`,`categories_description`.`categories_id`,`categories`.`parent_id` FROM `categories_description`INNER JOIN `categories` ON (`categories_description`.`categories_id` = `categories`.`categories_id`) WHERE (`categories_description`.`language_id` = 1) ORDER BY `categories_id` ";

 

$product_query = "SELECT DISTINCT `products`.`products_id`,`products`.`products_quantity`,`products`.`products_model`,`products`.`products_image`,`products`.`products_price`,`products`.`products_date_added`,`products`.`products_last_modified`,`products`.`products_date_available`,`products`.`products_weight`,`products`.`products_status`,`products`.`manufacturers_id`,`products_description`.`products_name`,`products_description`.`products_url`,`categories_description`.`categories_name`,`products_description`.`language_id`,`manufacturers`.`manufacturers_name` FROM `products` INNER JOIN `products_description` ON (`products`.`products_id` = `products_description`.`products_id`) INNER JOIN `products_to_categories` ON (`products_description`.`products_id` = `products_to_categories`.`products_id`) INNER JOIN `categories_description` ON (`products_to_categories`.`categories_id` = `categories_description`.`categories_id`) INNER JOIN `manufacturers` ON (`products`.`manufacturers_id` = `manufacturers`.`manufacturers_id`)

WHERE (`products_description`.`language_id` = 1) AND (`categories_description`.`language_id` = 1) AND (`products_to_categories`.`categories_id` = " . $row['categories_id'] . ")";

i have choosen lanuage_id=1 if you have other you can put e.g. lanuage_id=4

Link to comment
Share on other sites

  • 1 month later...

Hello I would like to ask if anyone knows how can i have two url foe images

 

The xml wants to create 2 images_url

One for the small images and one for the big images

Is it possible?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...