Location: PHPKode > scripts > Yandex.Market YML > yandex-market-yml/example.php
<?php
require("yml_class.php");
		$myyml = new yml;
		$myyml->filename = "shop.xml";
		$myyml->name = "Ìîé ìàãàçèí";
		$myyml->company = "ÎÎÎ \"Ðîìàøêà\"";
		$myyml->url = "http://www.my-shop.ru";
	
		// Äîáàâëÿåì âàëþòû
		$myyml->saveÑurrency("RUR","1");
		$myyml->saveÑurrency("USD");
	
		// Äîáàâëÿåì êàòåãîðèè
		$myyml->saveCategory(1,"Êíèãè");
		$myyml->saveCategory(2,"Äåòåêòèâû",1);
	
		// Äîáàâëÿåì òîâàðû
		$book = array(
			"id"=>"12342",
			"type"=>"book",
			"available"=>"true",
			"bid"=>"17",
			"url"=>"http://best.seller.ru/product_page.asp?pid=14345",
			"price"=>"80",
			"currencyId"=>"RUR",
			"categoryId"=>"2",
			"picture"=>"http://best.seller.ru/product_page.asp?pid=14345.jpg",
			"delivery"=>"true",
			"author"=>"Àëåêñàíäðà Ìàðèíèíà",
			"name"=>"Âñå íå òàê. Â 2 òîìàõ. Òîì 1",
			"publisher"=>"ÝÊÑÌÎ - Ïðåññ",
			"series"=>"À. Ìàðèíèíà - êîðîëåâà äåòåêòèâà",
			"year"=>"2007",
			"ISBN"=>"978-5-699-23647-3",
			"volume"=>"2",
			"part"=>"1",
			"language"=>"rus ",
			"binding"=>"70x90/32",
			"page_extent"=>"288",
			"description"=>"Âñå ïðåêðàñíî â áîëüøîì ïàòðèàðõàëüíîì ñåìåéñòâå Ðóäåíêî. Íî - óâû! - âïå÷àòëåíèå ýòî îáìàí÷èâî: êàæäîãî èç ìíîãî÷èñëåííûõ (åùå)Âñå ïðåêðàñíî â áîëüøîì ïàòðèàðõàëüíîì ñåìåéñòâå Ðóäåíêî. Íî - óâû! - âïå÷àòëåíèå ýòî îáìàí÷èâî: êàæäîãî èç ìíîãî÷èñëåííûõ ïðåäñòàâèòåëåé ñåìüè îáóðåâàþò ñâîè ïîòàåííûå ñòðàñòè è çàïðåòíûå æåëàíèÿ. È ïîòîìó, êîãäà ïîãèáàåò, ïðè÷åì ÿâíî.",
			"downloadable"=>"false");
	
		$myyml->saveOffer($book);
		
		// Çàïèñûâàåì YML ôàéë è ïðè âîçíèêíîâåíèè îøèáêè âûâîäèì å¸.
		echo $myyml->process();
?>
Return current item: Yandex.Market YML