Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

OSC XML Feed - Help & Discussion


Guest

Recommended Posts

hey,

 

I'm thinking it's probably an illegal character - what sort of data is in your new tag? can you show me some examples - thanks.

 

Kenny

 

this is the data from the description tag:

<P>Wielofunkcyjny odbiornik GPS z możliwością korzystania z dodatkowych map. Posiada podświetlany wyświetlacz o rozdzielczości 120 x 160 pikseli. 
<P>Dostępna pamięć na mapy 256 MB. Poza wbudowaną og?lną mapą świata, Silva oferuje jako opcję karty InfoMMC. Zawierają one szczeg?łowe mapy oraz informacje o restauracjach, hotelach, schroniskach, lotniskach, kinach, teatrach, sklepach itd. 
<P><B>Dane techniczne:</B> 
<P>Nawigacja 
<UL>
<LI>Punkty drogi: 1 000 
<LI>42 r?żne ikony do oznaczania punkt?w na mapie 
<LI>Znaczniki zdarzeń na mapie: 1 000 
<LI>Trasy: 10 odwracalnych, każda do 100 punkt?w drogi. 
<LI>Prosta obsługa nawigacji i planowania tras. 
<LI>Szlaki: 10 wykres?w, każdy do 10 000 punkt?w. 
<LI>Oryginalna funkcja "Find Home". 
<LI>Map datums: More than 170 local map datums 
<LI>Układ odniesienia: ponad 10 siatek, w tym UTM, MGRS. </LI></UL>
<P>Mapy 
<UL>
<LI>Wbudowana mapy: mapa drogowa USA, og?lna mapa świata. 
<LI>Mapy na kartach pamięci: szczeg?łowe mapy z zaznaczonymi ważniejszymi punktami (POI - points of interest) np: lotniska, kina, restauracje, sklepy itp.<BR>MMC1 - Niemcy, <BR>MMC2 - Francja/Monako<BR>MMC3 - Wielka Brytania/Irlandia,<BR>MMC4 - Dania/Norwegia/Szwecja/Finlandia,<BR>MMC5 - Włochy/Liechtenstein/San Marino/Szwajcaria,<BR>MMC6 - BeNeLux,<BR>MMC7 - Hiszpania/Andora/Portugalia,<BR>MMC8 - Czechy/Polska/Austria. 
<LI>Możliwe powiększenie: 0,02km-4000m </LI></UL>
<P>Odbiornik GPS 
<UL>
<LI>Typ: 12-kanałowy, możliwość obsłygi systemu WAAS 
<LI>Uaktualnianie: raz na sekundę w trybie pracy GPS, raz na 10 sekund w trybie oszczędzania energi. 
<LI>Możliwość wprowadzania poprawek r?żnicowych i wsp?łpracy z systemem WAAS. 
<LI>Antena: wbudowana, możliwość podłączenia anteny zewnętrznej. 
<LI>Dokładność: 15 metr?w, z włączoną obsługą DGPS/WAAS 1-5 metr?w. </LI></UL>
<P>Układ we/wy danych 
<UL>
<LI>Wyjście: NMEA 0183 
<LI>Wejście: RTCM-SC104 DGPS </LI></UL>
<P>Cechy 
<UL>
<LI>Wysokontrastowy podświetlany ekran LCD, 4 poziomy szarości 
<LI>Rozdzielczość matrycy LCD: 120x160 px, 19 200 px. 
<LI>Zasilanie wewn. 2 baterie AA 
<LI>Zasilanie zewn. 8-30 V napięcie stałe 
<LI>Czas działania na komplecie baterii: ciągły pomiar: do 12 godzin; tryb oszczędzania energii: do 20 godzin 
<LI>Obsługiwane języki: angielski, francuski, niemiecki, hiszpański, włoski, duński, szwedzki, rosyjski, holenderski, fiński 
<LI>Zakres temperatur: od –10?C do +60?C 
<LI>Wymiary: 142x65x25 mm 
<LI>Masa: 153 g (bez baterii) 
<LI>Kod towaru SILVA: 22581-901 </LI></UL>
<P><B>Do pobrania</B><BR>Instrukcja obsługi w języku: <A href="http://www.silva.se/manuals/gps/atlas_eng.pdf">angielskim</A></P>

Edited by soloo
Link to comment
Share on other sites

  • Replies 84
  • Created
  • Last Reply

Top Posters In This Topic

This is a good contribution.

 

Now we need to find a way to turn it into an RSS The current RSS contribs leave alot to be desired

If you choose not to decide you still have made a choice, I will choose a purpose clear, I will choose Free Will. --Neal Peart - Rush

Link to comment
Share on other sites

this is the data from the description tag:

<P>Wielofunkcyjny odbiornik GPS z możliwością korzystania z dodatkowych map. Posiada podświetlany wyświetlacz o rozdzielczości 120 x 160 pikseli. 
<P>Dostępna pamięć na mapy 256 MB. Poza wbudowaną og?lną mapą świata, Silva oferuje jako opcję karty InfoMMC. Zawierają one szczeg?łowe mapy oraz informacje o restauracjach, hotelach, schroniskach, lotniskach, kinach, teatrach, sklepach itd. 
<P><B>Dane techniczne:</B> 
<P>Nawigacja 
<UL>
<LI>Punkty drogi: 1 000 
<LI>42 r?żne ikony do oznaczania punkt?w na mapie 
<LI>Znaczniki zdarzeń na mapie: 1 000 
<LI>Trasy: 10 odwracalnych, każda do 100 punkt?w drogi. 
<LI>Prosta obsługa nawigacji i planowania tras. 
<LI>Szlaki: 10 wykres?w, każdy do 10 000 punkt?w. 
<LI>Oryginalna funkcja "Find Home". 
<LI>Map datums: More than 170 local map datums 
<LI>Układ odniesienia: ponad 10 siatek, w tym UTM, MGRS. </LI></UL>
<P>Mapy 
<UL>
<LI>Wbudowana mapy: mapa drogowa USA, og?lna mapa świata. 
<LI>Mapy na kartach pamięci: szczeg?łowe mapy z zaznaczonymi ważniejszymi punktami (POI - points of interest) np: lotniska, kina, restauracje, sklepy itp.<BR>MMC1 - Niemcy, <BR>MMC2 - Francja/Monako<BR>MMC3 - Wielka Brytania/Irlandia,<BR>MMC4 - Dania/Norwegia/Szwecja/Finlandia,<BR>MMC5 - Włochy/Liechtenstein/San Marino/Szwajcaria,<BR>MMC6 - BeNeLux,<BR>MMC7 - Hiszpania/Andora/Portugalia,<BR>MMC8 - Czechy/Polska/Austria. 
<LI>Możliwe powiększenie: 0,02km-4000m </LI></UL>
<P>Odbiornik GPS 
<UL>
<LI>Typ: 12-kanałowy, możliwość obsłygi systemu WAAS 
<LI>Uaktualnianie: raz na sekundę w trybie pracy GPS, raz na 10 sekund w trybie oszczędzania energi. 
<LI>Możliwość wprowadzania poprawek r?żnicowych i wsp?łpracy z systemem WAAS. 
<LI>Antena: wbudowana, możliwość podłączenia anteny zewnętrznej. 
<LI>Dokładność: 15 metr?w, z włączoną obsługą DGPS/WAAS 1-5 metr?w. </LI></UL>
<P>Układ we/wy danych 
<UL>
<LI>Wyjście: NMEA 0183 
<LI>Wejście: RTCM-SC104 DGPS </LI></UL>
<P>Cechy 
<UL>
<LI>Wysokontrastowy podświetlany ekran LCD, 4 poziomy szarości 
<LI>Rozdzielczość matrycy LCD: 120x160 px, 19 200 px. 
<LI>Zasilanie wewn. 2 baterie AA 
<LI>Zasilanie zewn. 8-30 V napięcie stałe 
<LI>Czas działania na komplecie baterii: ciągły pomiar: do 12 godzin; tryb oszczędzania energii: do 20 godzin 
<LI>Obsługiwane języki: angielski, francuski, niemiecki, hiszpański, włoski, duński, szwedzki, rosyjski, holenderski, fiński 
<LI>Zakres temperatur: od ?10?C do +60?C 
<LI>Wymiary: 142x65x25 mm 
<LI>Masa: 153 g (bez baterii) 
<LI>Kod towaru SILVA: 22581-901 </LI></UL>
<P><B>Do pobrania</B><BR>Instrukcja obsługi w języku: <A href="http://www.silva.se/manuals/gps/atlas_eng.pdf">angielskim</A></P>

 

Hi Soloo,

 

Thanks for that, I will try and recreate the error using the data you have provided - be in touch soon.

 

Thanks

Kenny

Link to comment
Share on other sites

This is a good contribution.

 

Now we need to find a way to turn it into an RSS The current RSS contribs leave alot to be desired

 

Hi JD,

 

Thaks for your comments, appreciated. I had thought of making it into RSS but because of the other contribs I decided just to stick to basic xml.

 

That being said if there is enough demand for this contrib in RSS form then I will do it, time is very tight right now but I would try and fit in the time to do it.

 

cheers

Kenny

Link to comment
Share on other sites

Hi Soloo,

 

Thanks for that, I will try and recreate the error using the data you have provided  - be in touch soon.

 

Thanks

Kenny

 

Hi Soloo,

 

As I expected looking from the code you pasted the description contains illegal characters which xml cannot process. This was the original reason for not including an option to display product description data due to amount of possible characters that may be inculded in the description that xml will not allow.

 

As your language uses special characters it is most probably thoose that are causing the problems.

 

You can try this, maybe it will help

 

In xml/xml2.php look for the following section:

 

	// 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 ("?", "(R)", $row['products_name']);
	 $row['products_name']	= ereg_replace ("?", "(TM)", $row['products_name']);
 }
if ($product_manufacturer == 1) {
$row['manufacturers_name']	= ereg_replace ("&", " and ", $row['manufacturers_name']);
	 $row['manufacturers_name']	= ereg_replace ("?", "(R)", $row['manufacturers_name']);
	 $row['manufacturers_name']	= ereg_replace ("?", "(TM)", $row['manufacturers_name']);
}

 

just after this section paste the following:

 

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

 

where xxx = the illegal character and yyy = a legal repalcement

 

check the 6th post down on this forum:

Link

 

there you can see some of the characters which i think your language uses so maybe you could try and add thoose characters to the above statement and replace them with characters like forum poster has eg: ae

 

hope that helps a bit

 

regards,

Kenny

Link to comment
Share on other sites

  • 1 month later...

Hey,

 

I have noticed that the categories listing will only display the current category and its parent category (i.e. only up to 2 levels).

Does anyone know how to get it to display the FULL category path? I only have 3 category levels on my site.

 

Any help would be greatly appreciated.

 

Cheers,

Chris

Link to comment
Share on other sites

hi..

 

just would like a quick note on how to add product description onto the XML FEED.

 

I have experimented a few ways without success... your help would be much appreciated.

 

Thanks.

PS

Link to comment
Share on other sites

  • 2 weeks later...

Hello,

 

When I call both files (XML/XML2.php) from my browser, I only get this:

<?xml version="1.0" encoding="ISO-8859-1" ?> 
- <STOREITEMS>
 <CREATED value="Sun Aug 14 15:01:48 EDT 2005" /> 
 </STOREITEMS>

 

Could anyone tell me how can I get XML feed files working?

 

Thank you.

Link to comment
Share on other sites

Hello,

 

I would like to know are what the change to be made on the file so that he(it) is multi languages.

 

Thank you for your help(assistant)

 

Philippe

 

France

 

----------

 

Bonjour,

 

Je voudrais savoir quelle sont le changement ? faire sur le fichier pour qu?il soit multi langues.

 

Merci de votre aide

 

Philippe

 

France

:thumbsup:

IEUFLR2000

Link to comment
Share on other sites

Hello,

 

When I call both files (XML/XML2.php) from my browser, I only get this:

<?xml version="1.0" encoding="ISO-8859-1" ?> 
- <STOREITEMS>
?<CREATED value="Sun Aug 14 15:01:48 EDT 2005" /> 
?</STOREITEMS>

 

Could anyone tell me how can I get XML feed files working?

 

Thank you.

 

 

Hi,

 

Can you post xml2.php so we can take a look at it?

 

Eyal.

Link to comment
Share on other sites

Thanks Eyal. Here is what my XML2.php file looks like:

<?php
/*
 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com
 
 Released under the GNU General Public License
 Copyright (c) 2003 The Internet Foundry (http://www.theinternetfoundry.com)
 -----------------------------------------------------------------
 OSCommerce Product XML Feed - V2.0B - XML2.PHP | CATEGORY BASED VERSION
 -----------------------------------------------------------------
 Version 2.0B - 17/04/2005
 -----------------------------------------------------------------
 Developed by:  Kenny Boyd, Senior Developer, The Internet Foundry, United Kingdom
 Email & MSN:  [email protected]
 Web:    http://www.theinternetfoundry.com

 Version 2 Feature Ideas & Beta Testing provided by:
 Eyal Shoabi, ([email protected] - http://www.volt.co.il, Israel)
 -------------------------------------------------------------------------------------
 CHANGELOG 
 17/03/05	v2.0b - Kenny Boyd - Complete rewrite of original All Products addon along with better SQL and  improved configuration
 17/03/05	v2.0a - Kenny Boyd - Complete rewrite of addon to offer Category based products, better SQL and improved configuration
 25/08/04  v1.1  - Kenny Boyd - added more character checks and some code tidied
 21/01/03	v1.0  - Created by Kenny Boyd as a rework of Patrick Veverka's great OSC Anywhere addon
 -----------------------------------------------------------------
 OFFICAL SUPPORT FORUM
 Please visit:
 http://www.oscommerce.com/forums/index.php?showtopic=146810
 -------------------------------------------------------------------------------
 NEW FEATURES 
 + NEW ALL PRODUCTS BASED system to allow output of all products in your shop
 + User Re-nameable XML Tag Names
 + Database Queires entirely rewritten for faster loading
 + All Product Data available by default
 + New Configuration Code allows more control over feed and tag output
 + New Support for displaying Specials Price & TAX/VAT onto products price 
 -----------------------------------------------------------------------------------
 INSTALATTION & CONFIGURATION HELP:
 
 A COMPLETE HTML HELP GUIDE IS INCLUDED IN THE ADDON ZIP FILE
 Please read README.HTM before using this addon.
 ---------------------------------------------------------------------------------------
*/
//---------------------------------------------------------------------------------------
// THE FOLLOWING OPTIONS MUST BE CONFIGURED!
//----------------------------------------------------------------------------------------

//----------------------------------------------------------------------------------------
//  1. Setup OSC Link
//----------------------------------------------------------------------------------------
//  If you have placed this file in the SAME directory as your OS Commerce shop then 
//  SKIP TO SECTION 2

//  If you have placed this file away from your OS Commerce directory please enter the path
//  to the file "application_top.php" which is in the includes directory of your OSC installation:

$osc_path = "includes/application_top.php";

//---------------------------------------------------------------------------------------------
//	2. Configure Site Info
//---------------------------------------------------------------------------------------------
//Enter the url to your website - do not put 'http://' or enter any slashes
$domain_name = "www.********.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!

//-----------------------------------------------------------------------------
//	3. Ouput Options:
//-----------------------------------------------------------------------------
//	I have rewrote the sql queries to allow easier configuration of which values you wish to be 
//	included in the XML output. These options can easily be turned on or off.
//-----------------------------------------------------------------------------
//	For each value you wish to be included in the feed change the value to 1 like:
//	$product_price = "1";  // Include Product's Price - (1 = YES | 0 = NO) 
//	For each value you DO NOT want to be included in the feed change the value to 0 like:
//	
                $product_price = "1";  // Include Product's Price - (1 = YES | 0 = NO) 
//-----------------------------------------------------------------------------
$show_creation_time	= "1";  // Include date and time tag that displays when the xml feed was run. - (1 = YES | 0 = NO)

               $product_name = "1";   // Include Product's Name/Title - (1 = YES | 0 = NO) 

               $product_price = "1";  // Include Product's Price - (1 = YES | 0 = NO) 

               $product_manufacturer= "0";  // Include Product's Manufacturer Name - (1 = YES | 0 = NO) 

                $product_weight= "0";  // Include Product's Weight - (1 = YES | 0 = NO)  

                $product_model= "0";  // Include Product's Model Number - (1 = YES | 0 = NO)    

                $product_quantity = "1";  // Include Quantity In Stock - (1 = YES | 0 = NO) 

                $product_image= "1";  // Include link to products image? - (1 = YES | 0 = NO)    

                $product_info_link = "1";  // Include link to product_info.php at your website? - (1 = YES | 0 = NO) 

                $product_date_added = "0";  // Include date product was added - (1 = YES | 0 = NO)    

                $product_date_modified= "1";  // Include date product was modified - (1 = YES | 0 = NO)    

                $product_date_available= "0";  // Include date product is available - (1 = YES | 0 = NO)    

// By default the XML feed will only display products which are set as active 
//  (green light next to product name in OSC Admin) - If you wish to output INACTIVE products then
//  change the following value to 1 (eg: $allow_all = "1"; ), otherwise leave unchanged.
$allow_all	= "0"; 

// By default only products that are in stock and have a quantity of 1 or more will be displayed.
//  If you wish to output OUT OF STOCK (0 quantity) products then change the following value to 1 
//  (eg:  $allow_no_stock = "1"; ), otherwise leave unchanged.
$allow_no_stock= "0"; 
//-----------------------------------------------------------------------------
//	4. XML Element Names
//-----------------------------------------------------------------------------	
//	This section is provided for users who will use xml parsers that require predetermined tag names
//  or tag names that need to be in other languages apart from English. 
//  DO NOT CHANGE THESE NAMES UNLESS YOU HAVE TO!	
$xml_tags['master']= "STOREITEMS";// Master tag: <STOREITEMS>
$xml_tags['time']= "CREATED";// Feed creation date/time Tag: <CREATED>
$xml_tags['product']= "PRODUCT";// Product Container Tag: <PRODUCT ITEM="xxx">
$xml_tags['name']= "NAME";// Product's Name/Title in Product Container:	<NAME>
$xml_tags['price']= "PRICE";// Price tag in Product Container: <PRICE>
$xml_tags['manufacturer']= "MANUFACTURER";// Product Image URL in Product Container: <IMAGE_URL>
$xml_tags['weight']= "WEIGHT";// Weight tag in Product Container: <WEIGHT>
$xml_tags['model']= "MODEL";// Model tag in Product Container:   	 <MODEL>
$xml_tags['quantity']= "QUANTITY";// Quantity tag in Product Container: <QUANTITY>
$xml_tags['url']= "URL";// Product Info Page URL in Product Container:<URL>    
$xml_tags['image_url']="IMAGE_URL";// Product Image URL in Product Container: <IMAGE_URL>
$xml_tags['added']= "ADDED";// Date Product Added in Product Container: <ADDED>
$xml_tags['modified']= "MODIFIED";// Date Product Modfied in Product Container: <MODIFIED>
$xml_tags['available']="AVAILABLE";// Date Product Available in Product Container:<AVAILABLE>
//-----------------------------------------------------------------------------
//	5. PRICING
//-----------------------------------------------------------------------------	
//	This section controls pricing options. You can set a TAX rate then activate it so that all 
//  default product prices with have the tax added on to the products price. You can also specify
// if you want to disp[lay special discounted prices or not.
//-----------------------------------------------------------------------------	
// VAT OPTIONS:

$pricing_vat_rate= "00.00";  // Enter Tax Rate to add to Products Price 
    	 
// (e.g: To add 17.5% on all product prices enter "17.5"
    	 
// NOTE: To activate VAT you must TURN ON the next option below!

$pricing_add_vat= "0";  // Activate TAX on all product prices - DEFAULT IS OFF || (1 = YES | 0 = NO)
    	 
// To activate TAX change the value to 1 (e.g: $pricing_add_vat = "1";

//---------------------------------------------------------------------------------------	
// PRICE SPECIALS OPTIONS:

$pricing_show_specials="1";  // Show products special discounted price instead of normal; product price
    	 
// when available - DEFAULT IS OFF || (1 = YES | 0 = NO)
//-----------------------------------------------------------------------------
//	6. Include CATEGORY element container
//-----------------------------------------------------------------------------
//	If you turn this on each new category cycle will contain a CATEGORY tag eg:
//<CATEGORY id="1" name="Books > Non Fiction">
//<PRODUCT>....</PRODUCT>
//</CATEGORY> 
$category_container= "1";// (1 = YES | 0 = NO) 
$category_container_id= "1";  // Include Category ID (eg: id="1") in <CATEGORY> tag
$category_container_name= "1";  // Include Category Name (eg: name="Books > Non Fiction") in <CATEGORY> tag
$xml_tags['category']= "CATEGORY";  // Category Container Tag Name:<CATEGORY id="xx" name="xxx">

//-----------------------------------------------------------------------------
// END OF CONFIGURATION AREA 
//-----------------------------------------------------------------------------

////////////////////////////////////////////////////////////////////////////////////////////////
// *** 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                 ***
////////////////////////////////////////////////////////////////////////////////////////////////
require($osc_path);
Header( 'Content-Type: text/xml' ); 
echo '<?xml version="1.0" encoding="ISO-8859-1" ?>'; 
echo '<' . $xml_tags['master'] . '>';
if ($show_creation_time == 1) {
$timestamp = date("D M j G:i:s T Y"); 
echo '<' . $xml_tags['time'] . ' value="' . $timestamp . '">';
}
$connection = mysql_connect(DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD) or die("OSC XML FEED FAILURE - Couldn't make connection to local database.");
$db = mysql_select_db(DB_DATABASE, $connection) or exit("OSC XML FEED FAILURE - Error code: " . mysql_errno($connection) . " Error: " . mysql_error($connection)  . ".");
$category_query = "SELECT `categories_description`.`categories_name`,`categories_description`.`categories_id`,`categories_description1`.`categories_name` AS `categories_name1`,`categories`.`categories_id` FROM `categories_description` INNER JOIN `categories` ON (`categories_description`.`categories_id` = `categories`.`categories_id`) INNER JOIN `categories_description` `categories_description1` ON (`categories`.`parent_id` = `categories_description1`.`categories_id`) ORDER BY 'categories_id' ASC";
$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`) ORDER BY `categories_id`";

$category_query_result = mysql_query($category_query,$connection) or die("Database Query Failed during Category Query.");
while ($row = mysql_fetch_array($category_query_result)) {
 $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_to_categories`.`categories_id` = " . $row['categories_id'] . ")";
if($allow_all  ==	"0")	{	$product_query	.= " AND (`products`.`products_status` = 1)";  }
if($allow_no_stock	==	"0")	{	$product_query	.= " AND (`products`.`products_quantity` > 0)"; }
$product_query_result  = mysql_query($product_query,$connection) or exit("<hr>code: " . mysql_errno($connection) . " error: " . mysql_error($connection)  . ".");
$product_query_count	= mysql_numrows($product_query_result);
 if ($product_query_count > 0) {
 if ($row['parent_id'] > 0 ) {
	 $parent_category_query = "SELECT `categories_description`.`categories_name`FROM  `categories_description`WHERE  (`categories_description`.`categories_id` = " . $row['parent_id'] . ")";
	 $parent_category_query_result = mysql_query($parent_category_query,$connection) or die("Database Query Failed during Parent Category Query.");
	 $parent = mysql_fetch_array($parent_category_query_result);
	 $row['categories_name'] = $parent['categories_name'] . ' > ' . $row['categories_name'];
}
$row['categories_name']	= ereg_replace ("&", " and ", $row['categories_name']);
if ($category_container	== "1")	{
 $cattag =  "<" . $xml_tags['category']; 
 if ($category_container_id == "1")  {	$cattag .=  " id='" . $row['categories_id']. "'";  }
 if ($category_container_name == "1")	{	$cattag .=  " name='" . $row['categories_name'] . "'";	}
 $cattag .=  ">";
 echo $cattag; 
}
while ($row = mysql_fetch_array($product_query_result)) {
//-----------------------------------------------------------------------------
// START -> insert any custom sql queries for extra tags here
//----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// END   -> insert any custom sql queries for extra tags here
//-----------------------------------------------------------------------------

if ($pricing_show_specials == 1) {
$specials_query = "SELECT `specials`.`specials_new_products_price` FROM `specials` WHERE  (`specials`.`products_id` = " . $row['products_id'] . ")";
	 
               $specials_result =mysql_query($specials_query,$connection) or exit("<hr>code: " . mysql_errno($connection) . " error: " . mysql_error($connection)  . ".");
	 
               $specials_query_count= mysql_numrows($specials_result);
	 
if ($specials_query_count > 0) {
$specials = mysql_fetch_array($specials_result);
 $row['products_price']=$specials['specials_new_products_price'];	
	 }
 }
 if ($pricing_add_vat == 1) { 
 $temp_tax      = ($row['products_price'] / 100) * $pricing_vat_rate;
 $row['products_price'] = $row['products_price'] + $temp_tax;
 }
 $row['products_price']= tep_round($row['products_price'], 2);
// 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 ("?", "(R)", $row['products_name']);
	 $row['products_name']= ereg_replace ("?", "(TM)", $row['products_name']);
 }
if ($product_manufacturer == 1) {
$row['manufacturers_name']= ereg_replace ("&", " and ", $row['manufacturers_name']);
	 $row['manufacturers_name']= ereg_replace ("?", "(R)", $row['manufacturers_name']);
	 $row['manufacturers_name']= ereg_replace ("?", "(TM)", $row['manufacturers_name']);
}
// build nested product element
echo "<" . $xml_tags['product'] ." ITEM='" . $row['products_id'] . "'>";
 
if ($product_name== "1")	{ 
               echo'<' . $xml_tags['name'] . '>' .  $row['products_name']  . '</' . $xml_tags['name'] . '>';   	 } 

if ($product_price== "1")	{ 
               echo'<' . $xml_tags['price'] . '>' .  $row['products_price']  . '</' . $xml_tags['price'] . '>';   	 } 

if ($product_manufacturer== "1")	{ 
               echo'<' . $xml_tags['manufacturer'] . '>' .  $row['manufacturers_name'] . '</' . $xml_tags['manufacturer'] . '>';   	 } 

if ($product_weight== "1")	{ 
                echo'<' . $xml_tags['weight'] . '>' . $row['products_weight'] . '</' . $xml_tags['weight'] . '>';	}  


if ($product_model== "1")	{ 
                 echo'<' . $xml_tags['model'] . '>' . $row['products_model'] . '</' . $xml_tags['model'] . '>';  }    


if ($product_quantity	== "1")	{ 
                  echo'<' . $xml_tags['quantity'] . '>' . $row['products_quantity'] . '</' . $xml_tags['quantity'] . '>';  } 


if ($product_info_link	== "1")	{ 
 
        if ($catalog_folder== "")	{ 
                    echo'<' . $xml_tags['url'] . '>http://' . $domain_name . '/product_info.php?products_id=' . $row['products_id'] . '</' . $xml_tags['url'] . '>';	}  
 else     	 { 
                      echo	'<' . $xml_tags['url'] . '>http://' . $domain_name . '/' .  $catalog_folder . '/product_info.php?products_id=' . $row['products_id'] . '</' . $xml_tags['url'] . '>';	}  
}     	 

if ($product_image== "1")	{ 
 
          if ($catalog_folder== "")	{ echo	'<' . $xml_tags['image_url'] . '>http://' . $domain_name . '/' .  $image_folder . '/' . $row['products_image'] . '</' . $xml_tags['image_url'] . '>';	}
 else        { 
                         echo'<' . $xml_tags['image_url'] . '>http://' . $domain_name . '/' .  $catalog_folder . '/' .  $image_folder . '/' . $row['products_image'] . '</' . $xml_tags['image_url'] . '>';	}
}  

if ($product_date_added== "1")	{ 
                        echo	'<' . $xml_tags['added'] . '>' . $row['products_date_added'] . '</' . $xml_tags['added'] . '>'; }    

if ($product_date_modified== "1") { 
                        echo	'<' . $xml_tags['modified'] . '>' . $row['products_last_modified'] . '</' . $xml_tags['modified'] . '>'; }    
if ($product_date_available== "1")	{ 
                        echo	'<' . $xml_tags['available'] . '>' . $row['products_date_available'] . '</' . $xml_tags['available'] . '>'; }    
//-----------------------------------------------------------------------------
// START -> insert any extra custom tags here
//-----------------------------------------------------------------------------

//-----------------------------------------------------------------------------
// END   -> insert any extra custom tags here
//-----------------------------------------------------------------------------
echo '</' . $xml_tags['product'] . '>';
}
if ($category_container== "1")	{ 
echo '</' . $xml_tags['category'] . '>'; }
}
}
// free resources and close connection
mysql_free_result($product_query_result);
mysql_free_result($category_query_result);
mysql_close($connection);
if ($show_creation_time == 1) { echo '</' . $xml_tags['time'] . '>';}
echo '</' . $xml_tags['master'] . '>';
?>

 

PS. My shop is in the my site root (www.mysite.com)

 

Thanks in advance.

Link to comment
Share on other sites

  • 2 weeks later...

Since I am not assigning a manufacturer to all of the products xml2.php was missing some of my products so I replaced the INNER JOIN on manufacturers with a LEFT JOIN on the $product_query. I think this is more appropriate.

 

Also since I have both greek and english interface languages installed and since I am mostly selling products with english categories and descriptions I was seeing a lot of duplicates which I managed to eliminate by doing a SELECT DISTINCT on the $category_query and $product_query.

 

Dimitris

Link to comment
Share on other sites

  • 3 weeks later...

Any way to get this feed to work if your OSC directory isn't right off the main directory.

 

Eg. its in v-web/ecommernce/os/catalog/

 

Also, you can pick catagories but can you pick just "New Products" since it doesn't really have a catagory ID? It seems like this would be the best use for this contrib....

Link to comment
Share on other sites

18 day past and no reply has this contri died or what

 

Regards Andy

 

or are you on a long holiday

 

 

Hey all,

 

Yes not quite a long holiday but have been on kind of sick leave due to a back injury which has meant I havent been able to get to the pc much.

 

If your still having problems pop your script over to my email address and I will have a quick look at it.

 

cheers

Kenny

Link to comment
Share on other sites

Any way to get this feed to work if your OSC directory isn't right off the main directory.

 

Eg. its in v-web/ecommernce/os/catalog/

 

Also, you can pick catagories but can you pick just "New Products" since it doesn't really have a catagory ID?  It seems like this would be the best use for this contrib....

 

 

is the entire path under your web root? eg is your shop homepage url something like http://www.mysite.com/v-web/ecommernce/os/catalog/index.php? also what server are you running on?

 

There is no current support for selecting new releases however I have created (along with Eyals help) an Index of Categories in a HTML page which then links off to individual categories and outputs the XML.

 

It isnt released yet and dosen't have any support for showing new releases but I agree this would be a good feature so I may be able to modify the unreleased xml3.php slightly to provide a link to New Products. I may have a little gap next week to do this so if you want it let me know.

 

cheers

Kenny

Link to comment
Share on other sites

Just want to post some updates and a couple of things in general:

 

As I have been absent for a while I realise some of you may not have had answers to posts/emails regarding problems you are having with the scripts, I know Eyal has been helping some of you but in case you are still stranded or stuck read on....

 

Firstly having only one topic on these forums for the contribution is proving to be difficult as it's hard to keep threads going with specific problems and also hard to post any news that will be easy for all to see so this is what I am going to do.

 

I'm going to open up a dedicated forum on my own server for this contribution, I also have other osc projects in the pipeline which I am not allowed to announce details of here so the new forums will cover thoose.

 

Secondly due to the feedback I have received over this contrib I am willing to stick with it and put time into it's future development, many of you have suggested features which should be included in this contrib and I want to get these worked in.

- again I hope this is something you will provide ideas,suggestion and help on and we can do it at the new forums.

 

I will continue to answer posts here but I'd recommend you use the new forums once they are running.

 

The dedicated forum will be online in the next couple of days. I will upload info such as FAQ's, news of future releases, bug fixes etc once the new forum is online.

 

cheers!

Kenny

Link to comment
Share on other sites

ok, maybe I jumped the gun a little regarding setting up a dedicated forum for this contrib as I've been Kindly preinformed that linking to an off site forum here is not allowed and the idea of having a dedicated forum may be to the dislike of the Forum Moderators here so for now until I can get an answer from a Moderator about what I can do (if anything) the whole dedicated forums thing will have to sit on the backburner.

 

As I said already I was going to continue to answer posts here as well so if you have any problems with the contrib just post here as usual

 

cheers

Kenny

Link to comment
Share on other sites

  • 3 weeks later...

Great Mod Kenny,

I'm trying to use it to export it to some comparison sites but I am running into a small problem.

It is giving me this error

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. 


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

An invalid character was found in text content. Error processing resource 'http://www.minidisc.com.au/xml.php'. Line 1, Po...

TDK Bitclubs 2003 80 Min 3 Pack Yellow</NAME><PRICE>19</PRICE><MANUFACTURER>TDK</MANUFACTURER>...

 

I am getting a similar error with xml2.php

What are the invalid characters? Any help is appriciated

Link to comment
Share on other sites

Hi guys

I have just tried to instal the xml feed and all I seem to be able to produce is:

 

<?xml version="1.0" ?>

- <STOREITEMS>

<CREATED value="Mon Oct 17 20:41:23 EST 2005" />

</STOREITEMS>

 

I noticed a couple of other people also had this occur so I have also included my xml info - if that helps! I think I am having trouble finding where my shop directory is! I assume it is in catalog but it may be in the index as if you are in my site and click on any of the categories the address is always index.php etc etc

 

I hope I made some sense and that someone can help me work this out. Thank you so much, Jacqui

 

// Enter the url to your website - do not put 'http://' or

 

enter any slashes

$domain_name = "www.rainbowdesigns.net.au";

 

// 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!

 

//--------------------------------------------------------------

 

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

// 3. Ouput Options:

//--------------------------------------------------------------

 

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

// I have rewrote the sql queries to allow easier

 

configuration of which values you wish to be

// included in the XML output. These options can easily be

 

turned on or off.

//--------------------------------------------------------------

 

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

// For each value you wish to be included in the feed

 

change the value to 1 like:

// $product_price = "1"; // Include

 

Product's Price - (1 = YES | 0 = NO)

// For each value you DO NOT want to be included in the

 

feed change the value to 0 like:

// $product_price = "0"; // Include

 

Product's Price - (1 = YES | 0 = NO)

//--------------------------------------------------------------

 

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

$show_creation_time = "1"; // Include date

 

and time tag that displays when the xml feed was run. - (1 = YES

 

| 0 = NO)

$product_name = "1"; // Include

 

Product's Name/Title - (1 = YES | 0 = NO)

$product_price = "1"; // Include

 

Product's Price - (1 = YES | 0 = NO)

$product_manufacturer = "0"; // Include Product's

 

Manufacturer Name - (1 = YES | 0 = NO)

$product_weight = "0"; // Include

 

Product's Weight - (1 = YES | 0 = NO)

$product_model = "0"; // Include

 

Product's Model Number - (1 = YES | 0 = NO)

$product_quantity = "0"; // Include

 

Quantity In Stock - (1 = YES | 0 = NO)

$product_image = "1"; // Include link

 

to products image? - (1 = YES | 0 = NO)

$product_info_link = "1"; // Include link

 

to product_info.php at your website? - (1 = YES | 0 = NO)

$product_date_added = "0"; // Include date

 

product was added - (1 = YES | 0 = NO)

$product_date_modified = "0"; // Include date product

 

was modified - (1 = YES | 0 = NO)

$product_date_available = "0"; // Include date product

 

is available - (1 = YES | 0 = NO)

 

// By default the XML feed will only display products which

 

are set as active

// (green light next to product name in OSC Admin) - If you

 

wish to output INACTIVE products then

// change the following value to 1 (eg: $allow_all =

 

"1"; ), otherwise leave unchanged.

$allow_all = "0";

// By default only products that are in stock and have a

 

quantity of 1 or more will be displayed.

// If you wish to output OUT OF STOCK (0 quantity) products

 

then change the following value to 1

// (eg: $allow_no_stock = "1"; ), otherwise leave

 

unchanged.

$allow_no_stock = "1";

//--------------------------------------------------------------

 

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

// 4. XML Element Names

//--------------------------------------------------------------

 

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

// This section is provided for users who will use xml

 

parsers that require predetermined tag names

// or tag names that need to be in other languages apart from

 

English.

// DO NOT CHANGE THESE NAMES UNLESS YOU HAVE TO!

$xml_tags['master'] =

 

"STOREITEMS"; // Master tag:

 

<STOREITEMS>

$xml_tags['time'] =

 

"CREATED"; // Feed creation date/time Tag:

 

<CREATED>

$xml_tags['product'] = "PRODUCT";

 

// Product Container Tag:

 

<PRODUCT ITEM="xxx">

$xml_tags['name'] = "NAME";

 

// Product's Name/Title in Product Container: <NAME>

 

 

$xml_tags['price'] = "PRICE";

 

// Price tag in Product Container:

 

<PRICE>

$xml_tags['manufacturer'] = "MANUFACTURER";

 

// Product Image URL in Product Container:

 

<IMAGE_URL>

$xml_tags['weight'] =

 

"WEIGHT"; // Weight tag in Product Container:

 

<WEIGHT>

$xml_tags['model'] = "MODEL";

 

// Model tag in Product Container:

 

<MODEL>

$xml_tags['quantity'] = "QUANTITY";

 

// Quantity tag in Product Container:

 

<QUANTITY>

$xml_tags['url'] = "URL";

 

// Product Info Page URL in Product Container: <URL>

 

 

$xml_tags['image_url'] = "IMAGE_URL";

 

// Product Image URL in Product Container:

 

<IMAGE_URL>

$xml_tags['added'] = "ADDED";

 

// Date Product Added in Product Container: <ADDED>

$xml_tags['modified'] = "MODIFIED";

 

// Date Product Modfied in Product Container: <MODIFIED>

$xml_tags['available'] = "AVAILABLE";

 

// Date Product Available in Product Container: <AVAILABLE>

//--------------------------------------------------------------

 

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

// 5. PRICING

//--------------------------------------------------------------

 

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

// This section controls pricing options. You can set a TAX

 

rate then activate it so that all

// default product prices with have the tax added on to the

 

products price. You can also specify

// if you want to disp[lay special discounted prices or not.

//--------------------------------------------------------------

 

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

// VAT OPTIONS:

$pricing_vat_rate = "0"; // Enter

 

Tax Rate to add to Products Price

 

 

// (e.g: To add 17.5% on all product prices enter "17.5"

 

 

// NOTE: To activate VAT you must TURN ON the next

 

option below!

 

$pricing_add_vat = "0"; //

 

Activate TAX on all product prices - DEFAULT IS OFF || (1 = YES

 

| 0 = NO)

 

 

// To activate TAX change the value to 1 (e.g:

 

$pricing_add_vat = "1";

//--------------------------------------------------------------

 

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

// PRICE SPECIALS OPTIONS:

 

$pricing_show_specials = "1"; // Show products

 

special discounted price instead of normal; product price

 

 

// when available - DEFAULT IS OFF || (1 = YES | 0 = NO)

//--------------------------------------------------------------

 

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

// END OF CONFIGURATION AREA

Link to comment
Share on other sites

  • 3 weeks later...

Hi

First of all, thanks for your work - this contribution is great!

but, i have a strange problem - most of my products displays 2 times, even 4 times in xml2

 

This question has been allready asked but the answer wasn' t published to this forum

 

Does anyone know the solution ?

Link to comment
Share on other sites

Hi

First of all, thanks for your work - this contribution is great!

but, i have a strange problem - most of my products displays 2 times, even 4 times in xml2

 

This question has been allready asked but the answer wasn' t published to this forum

 

Does anyone know the solution ?

 

Please read post #38:

 

http://www.oscommerce.com/forums/index.php?s=&...ndpost&p=691624

 

If for example you have both greek and english language installed on your site duplicate copies of your products will show up. Do a a SELECT DISTINCT on the $category_query and $product_query to eliminate duplicate entries.

 

Dimitris

Link to comment
Share on other sites

Thanks for your quick answer

 

i have seen the post but i don't know how to put and where a SELECT DISTINCT

The same thing for LEFT JOIN

 

Could you please post the piece of code

 

Also i have a new problem about a character <

 

check this out Luxe.gr

 

 

 

 

( sorry i made mistake about the url of my site)

 

 

Thanks for your quick answer

 

i have seen the post but i don't know how to put and where a SELECT DISTINCT

The same thing for LEFT JOIN

 

Could you please post the piece of code

 

Also i have a new problem about a character <

 

check this out Luxe.gr

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...