Aнтон Posted June 2, 2010 Report Share Posted June 2, 2010 Здравствуйте!1. Как указать родительскую категорию товара?Тут print "<typePrefix>".htmlspecialchars($product->category, ENT_QUOTES)."</typePrefix>"."\n";2. Как добавить новые данные например <country_of_origin>Япония</country_of_origin> с какими файлами работать, помимо добавления полей в базу данных? Quote Link to post Share on other sites
Guest Posted June 3, 2010 Report Share Posted June 3, 2010 Файл Pricelist.class.php Quote Link to post Share on other sites
Aнтон Posted June 4, 2010 Author Report Share Posted June 4, 2010 Спасибо за исчерпывающий ответ, поддержка как всегда на высоте. Вашим двиглом заниматься мало кто хочет а если хочет то непомерно дорого. Все кого вы рекомендовали просто ленивые безответственные программисты. В общем очень огорчён вашим отношением. Quote Link to post Share on other sites
Danya Posted July 30, 2011 Report Share Posted July 30, 2011 Подскажите пожалуйста, почему в ЯндексМаркет для магазинов не загружается файл yandex.xml, пишет ошибку:____________________________________________Внимание! Прайс-лист содержит ошибкиОпределена кодировка: utf-8 (строка 0, столбец 0)Дата из файла: 2011-07-30 15:07 (строка 3, столбец 38)Фатальная ошибка: Ошибка парсинга XML: Error parsing XML feed: Element 'name' is not valid for content model: '(url?,buyurl?,price,wprice?,currencyId,xCategory?,categoryId+,picture?,store?,pickup?,delivery?,deliveryIncluded?,local_delivery_cost?,orderingTime?,((typePrefix?,vendor,vendorCode?,model,((provider,tarifplan?))?)|(author?,name,publisher?,series?,year?,ISBN?,volume?,part?,language?,binding?,page_extent?,table_of_contents?)|(author?,name,publisher?,series?,year?,ISBN?,volume?,part?,language?,table_of_contents?,performed_by?,performance_type?,storage?,format?,recording_length?)|(artist?,title,year?,media?,starring?,director?,originalName?,country?)|(worldRegion?,country?,region?,days,dataTour*,name,hotel_stars?,room?,meal?,included,transport,price_min?,price_max?,options?)|(name,place,hall?,hall_part?,date,is_premiere?,is_kids?)|(name,vendor?,vendorCode?)),aliases?,additional*,description?,sales_notes?,promo?,manufacturer_warranty?,country_of_origin?,downloadable?,adult?,barcode*,param*)' (строка 38, столбец 9)____________________________________________ Quote Link to post Share on other sites
Danya Posted August 9, 2011 Report Share Posted August 9, 2011 подскажите, что делать? Quote Link to post Share on other sites
Danya Posted August 21, 2011 Report Share Posted August 21, 2011 есть профессионалы? помогите пожалуйста. Quote Link to post Share on other sites
Guest Posted August 21, 2011 Report Share Posted August 21, 2011 Надо спросить у техподдержки яндекса, возможно там неправильный порядок тегов Quote Link to post Share on other sites
Danya Posted August 22, 2011 Report Share Posted August 22, 2011 Служба поддержки ответила:Вы используете тип описания vendor.modelПри этом типе описания использование тега <name> в составе оффера недопускается.Я убрал vendor.model, всеравно ошибка пишется!Вот ссылка на файл Pricelist.class.php: http://www.sharemania.ru/0185765 Quote Link to post Share on other sites
Kosjak76 Posted August 22, 2011 Report Share Posted August 22, 2011 Попробуй вместо этого: if($product->brand) { if($product->category) print "".htmlspecialchars($product->category, ENT_QUOTES).""."\n"; print "".htmlspecialchars($product->brand).""."\n"; print "".htmlspecialchars($product->model, ENT_QUOTES)." ".htmlspecialchars($product->variant_name, ENT_QUOTES).""."\n"; }else { print "".htmlspecialchars($product->model, ENT_QUOTES)." ".htmlspecialchars($product->variant_name, ENT_QUOTES).""."\n"; }Сделать так: if($product->brand) { if($product->category) print "".htmlspecialchars($product->category, ENT_QUOTES).""."\n"; print "".htmlspecialchars($product->brand).""."\n"; print "".htmlspecialchars($product->model, ENT_QUOTES)." ".htmlspecialchars($product->variant_name, ENT_QUOTES).""."\n"; }else { if($product->category) print "".htmlspecialchars($product->category, ENT_QUOTES).""."\n"; print "Не указан"."\n"; print "".htmlspecialchars($product->model, ENT_QUOTES)." ".htmlspecialchars($product->variant_name, ENT_QUOTES).""."\n"; } Quote Link to post Share on other sites
Danya Posted August 22, 2011 Report Share Posted August 22, 2011 дело в том, что у меня в файле Pricelist.class.php код написан в таком виде: http://www.sharemania.ru/0185765Пример:$ctype="text/xml";header("Pragma: public");header("Expires: 0");header("Cache-Control: must-revalidate, post-check=0, pre-check=0");header("Content-Type: $ctype");header('Content-disposition: attachment; filename="yandex.xml"');header("Content-Transfer-Encoding: binary");print "<?xml version='1.0' encoding='utf8'?>".PHP_EOL;print "<!DOCTYPE yml_catalog SYSTEM 'shops.dtd'>".PHP_EOL;print "<yml_catalog date='".date('Y-m-d H:m')."'>".PHP_EOL;print "<shop>".PHP_EOL;print "<name>".$this->settings->site_name."</name>".PHP_EOL;print "<company>".$this->settings->company_name."</company>".PHP_EOL;print "<url>http://".$this->root_url."</url>".PHP_EOL;// Currenciesprint "<currencies>".PHP_EOL;print "\t<currency id='UAH' rate='1'/>".PHP_EOL;foreach($currencies as $currency){if($cbrf)print "\t<currency id='".$currency->code."' rate='NBU'/>".PHP_EOL;elseprint "\t<currency id='".$currency->code."' rate='".round($currency->rate_to/$currency->rate_from*$rur_rate, 3)."'/>".PHP_EOL;}print "</currencies>".PHP_EOL;// Categoriesprint "<categories>".PHP_EOL;foreach($categories as $category){if($category->parent>0)print "\t<category id='".$category->category_id."' parentId='".$category->parent."'>".htmlspecialchars($category->name, ENT_QUOTES)."</category>".PHP_EOL;elseprint "\t<category id='".$category->category_id."'>".htmlspecialchars($category->name, ENT_QUOTES)."</category>".PHP_EOL;}print "</categories>".PHP_EOL;// Offersprint "<offers>".PHP_EOL;foreach($products as $product){print "<offer id='".$product->product_id."' type='vendor.model' available='true'>".PHP_EOL;print "<url>http://".$this->root_url.'/products/'.$product->url."</url>".PHP_EOL;print "<price>".$product->price."</price>".PHP_EOL;print "<currencyId>".$this->main_currency->code."</currencyId>".PHP_EOL;print "<categoryId>".$product->category_id."</categoryId>".PHP_EOL;if($product->category)print "<typePrefix>".htmlspecialchars($product->category, ENT_QUOTES)."</typePrefix>".PHP_EOL;if($product->brand)print "<vendor>".htmlspecialchars($product->brand)."</vendor>".PHP_EOL;print "<model>".htmlspecialchars($product->model, ENT_QUOTES)."</model>".PHP_EOL;print "<description>".htmlspecialchars(strip_tags($product->description), ENT_QUOTES)."</description>".PHP_EOL;if($product->large_image)print "<picture>http://www.$this->root_url/files/products/".$product->large_image."</picture>".PHP_EOL;print "</offer>".PHP_EOL;}print "</offers>".PHP_EOL;print "</shop>".PHP_EOL;print "</yml_catalog>".PHP_EOL; Quote Link to post Share on other sites
Kosjak76 Posted August 22, 2011 Report Share Posted August 22, 2011 Вместо print "".htmlspecialchars($product->model, ENT_QUOTES)."".PHP_EOL;Попробуйprint "".htmlspecialchars($product->model, ENT_QUOTES)."".PHP_EOL; Quote Link to post Share on other sites
Danya Posted August 22, 2011 Report Share Posted August 22, 2011 пробывал так тоже, тот же результат! Quote Link to post Share on other sites
Danya Posted August 23, 2011 Report Share Posted August 23, 2011 всем спасибо, проблема решена!изменил Вместо print "<name>".htmlspecialchars($product->model, ENT_QUOTES)."</name>".PHP_EOL;Наprint "<model>".htmlspecialchars($product->model, ENT_QUOTES)."</model>".PHP_EOL;не достовало в некоторых товарах тега <model> Quote Link to post Share on other sites
trueocean Posted January 28, 2014 Report Share Posted January 28, 2014 Здравствуйте! 1. Как указать родительскую категорию товара?Тут print "<typePrefix>".htmlspecialchars($product->category, ENT_QUOTES)."</typePrefix>"."\n"; 2. Как добавить новые данные например <country_of_origin>Япония</country_of_origin> с какими файлами работать, помимо добавления полей в базу данных?вот по первому пункту разъясните пожалуйста, так как в переписке решения я так и не увидел Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.