Jump to content

Recommended Posts

Здравствуйте!

1. Как указать родительскую категорию товара?
Тут print "<typePrefix>".htmlspecialchars($product->category, ENT_QUOTES)."</typePrefix>"."\n";

2. Как добавить новые данные например <country_of_origin>Япония</country_of_origin> с какими файлами работать, помимо добавления полей в базу данных?

Link to post
Share on other sites

Спасибо за исчерпывающий ответ, поддержка как всегда на высоте.
Вашим двиглом заниматься мало кто хочет а если хочет то непомерно дорого. Все кого вы рекомендовали просто ленивые безответственные программисты. В общем очень огорчён вашим отношением.

Link to post
Share on other sites
  • 1 year later...

Подскажите пожалуйста, почему в ЯндексМаркет для магазинов не загружается файл 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)
____________________________________________

Link to post
Share on other sites
  • 2 weeks later...
  • 2 weeks later...

Служба поддержки ответила:

Вы используете тип описания vendor.model
При этом типе описания использование тега <name> в составе оффера не
допускается.

Я убрал vendor.model, всеравно ошибка пишется!

Вот ссылка на файл Pricelist.class.php: http://www.sharemania.ru/0185765

Link to post
Share on other sites

Попробуй вместо этого:
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";
}

Link to post
Share on other sites

дело в том, что у меня в файле 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;

// Currencies
print "<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;
else
print "\t<currency id='".$currency->code."' rate='".round($currency->rate_to/$currency->rate_from*$rur_rate, 3)."'/>".PHP_EOL;
}
print "</currencies>".PHP_EOL;

// Categories
print "<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;
else
print "\t<category id='".$category->category_id."'>".htmlspecialchars($category->name, ENT_QUOTES)."</category>".PHP_EOL;
}
print "</categories>".PHP_EOL;

// Offers
print "<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;

Link to post
Share on other sites

всем спасибо, проблема решена!

изменил

Вместо
print "<name>".htmlspecialchars($product->model, ENT_QUOTES)."</name>".PHP_EOL;
На
print "<model>".htmlspecialchars($product->model, ENT_QUOTES)."</model>".PHP_EOL;


не достовало в некоторых товарах тега <model>

Link to post
Share on other sites
  • 2 years later...

Здравствуйте!

 

1. Как указать родительскую категорию товара?

Тут print "<typePrefix>".htmlspecialchars($product->category, ENT_QUOTES)."</typePrefix>"."\n";

 

2. Как добавить новые данные например <country_of_origin>Япония</country_of_origin> с какими файлами работать, помимо добавления полей в базу данных?

вот по первому пункту разъясните пожалуйста, так как в переписке решения я так и не увидел

Link to post
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
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.

Loading...
×
×
  • Create New...