A
A
Alexander Ivanov2017-01-10 17:47:11
PHP
Alexander Ivanov, 2017-01-10 17:47:11

How to set default value for TV in catalogfill?

Hello!
While testing only on export.
I'm trying to import and export under the Yandex market, I've come across the fact that the tv values ​​​​are not substituted by the mind.
For example, I have only one currency, rubles. Then there is no point in making a list. Made a hidden field with RUR value by default. When importing, there is not RUR but empty. I tried to write the same $cf_config['imp_content_default'] here, and it's empty again.
What is the problem?
https://yandex.ru/support/partnermarket/yml/about-...

//разбивка по столбцам при импорте и экспорте (content|tv|category)
$cf_config['content_row'] = array(
    array('id',array('id','content')),
    array('available',array('published','content')),
    array('url',array('uri','content')),
    array('price',array(1,'tv')),
    array('currencyId',array(24,'tv')),
    array('picture',array(3,'tv')),
    array('category',array('parent','content')),
    array('name',array('pagetitle','content')),
    //array('description',array('introtext','content')),
    array('description',array('content','content'))
);

//значения по умолчанию при импорте или проверка при экспорте
$cf_config['imp_content_default'] = array(
    'content' => array(
        'deleted' => 0,
        'published' => 1,
        'template' => 3
        //'createdon' => strtotime("now")
        //'publishedon' => strtotime("now")
        //'pub_date' => strtotime("now")
        //'editedby' => 1
        //'editedon' => strtotime("now")
    ),
    'tv' => array(
        24 => 'RUR'
    )
);

Is it still possible to write the name of the site somewhere so that the paths to the page or file are complete?
https://yandex.ru/support/partnermarket/offers.xml
tried like this:
function filter_export($value_arr,$doc_id=0){
    $output_arr = $value_arr;
    if(isset($output_arr['content']['uri']))
      $output_arr['content']['uri'] = 'https://'.$_SERVER['SERVER_NAME'].$output_arr['content']['uri'];
    return $output_arr;
}

so:
if($output_arr['content']['id']){
      $output_arr['content']['id'] = 'https://'.$_SERVER['SERVER_NAME'].$output_arr['content']['parent'];
    }
    return $output_arr;

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question