<?php
$shop = & singleton('shop');

$end_array_item = end($GLOBALS['URL_ARRAY']);

$page = to_str($end_array_item);

$current_shop_id = to_int($GLOBALS['LA']['shop_id']);

$result = $shop->GetPathProducer($page, $current_shop_id);

if (to_int($result['shop_producers_list_id']) > 0)
{
   $GLOBALS['producer_id'] = to_int($result['shop_producers_list_id']);
  
   $saller_row = $shop->GetProducer($GLOBALS['producer_id']);

   $kernel = & singleton('kernel');

      $seo_title = $saller_row['shop_producers_list_name'];
      $seo_description = $saller_row['shop_producers_list_name'];
      $seo_keywords = $saller_row['shop_producers_list_name'];

      // Title для производителя задан
      if (!empty($saller_row['shop_producers_list_seo_title']))
      {
         $seo_title = $saller_row['shop_producers_list_seo_title'];
      }

      // Описание для производителя задано
      if (!empty($saller_row['shop_producers_list_seo_description']))
      {
         $seo_description = $saller_row['shop_producers_list_seo_description'];
      }
      
      // Ключевые слова для производителя заданы
      if (!empty($saller_row['shop_producers_list_seo_keywords']))
      {
         $seo_keywords = $saller_row['shop_producers_list_seo_keywords'];
      }

      $kernel->set_title($seo_title);
      $kernel->set_description($seo_description);
      $kernel->set_keywords($seo_keywords);
}
else
{
      $GLOBALS['producer_id'] = 0;
}
?>