getCurrentLanguage(); $products = new Products(); $categories = new Products_Categories(); if (!empty($path)) { foreach ($path as $item) { if ($item) { $tmp[] = $item; } } } $path = $tmp; $last_item = array_pop($path); if (is_numeric($last_item)) { $page = intval($last_item); $last_item = array_pop($path); } $last_i= explode('_',$last_item); $previus_item = array_pop($path); $prev_i = explode('_',$previus_item); define('prev_catid',isset($prev_i[0]) && $prev_i[0] ? $prev_i[0] : 0 ); //echo $last_i[0]; $Template = new Common_Template('Default'); $clearance=0; //Is it category ? if(count($last_i)>1) $cat_item = $categories -> getItem($last_i[0], 'id'); if (!empty($cat_item)) { $catid = $last_i[0]; $Template->title= $L->StrT('goods_categories','title', $cat_item['id'], $cat_item['title']); $Template->description = $L->StrT('goods_seo_description','title', $cat_item['id'], ''); }elseif($last_item=='clearance') { $last_item = array_pop($tmp); $last_category = array_pop($tmp); $last_i= explode('_',$last_category); $cat_item = $categories -> getItem($last_i[0], 'id'); $catid =$cat_item['id']; define('clearance',1); $clearance=1; $clearance_products = $products -> getClearanceItems($cat_item['id']); } else { $tmp = explode('-', $last_item, 2); $pid = isset($tmp[0]) ? intval($tmp[0]) : 0; if ($pid) { $product_item = $products -> getItem($pid); } if (!empty($product_item)) { $itemid = $product_item['id']; $catid = $product_item['catid']; $title = $L->StrT('goods','title', $product_item['id'], $product_item['title']); $Template->title=$title; } /*$last_item = array_pop($path); $cat_item = $categories -> getItem($last_item, 'sef'); if (!empty($cat_item)) { $catid = $cat_item['id']; } */ } if(!$product_item) if(isset($search_string)) $Template->title = $search_string; $array = array(); if($itemid) { $goods = new Products(); $pr = $goods -> getItem($itemid); //print_r($pr); $images = $goods -> getImages($itemid); if (!empty($images)) { $image = $images[0]; } $array['fb']['title'] = htmlspecialchars($L->StrT('goods','title',$itemid, $pr['title'])); $array['fb']['url'] = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $array['fb']['image'] = 'http://'.$_SERVER['HTTP_HOST'].$image['picture']; $array['fb']['app_id'] = '212477418881028'; $array['fb']['description'] = $L->StrT('goods','descr',$itemid, $pr['descr']); ; $array['fb']['site_name'] = 'http://'.$_SERVER['HTTP_HOST']; // print_r($array); } define ('catid', $catid); define ('product_id', $itemid); //$product_id = defined ('product_id') ? product_id : 0; /* //define ('page', $page); $array['title'] = */ ob_start(); ?>
getList($cat_item['id']); //$childs = intval($cat_item['childs']); if (count($list) > 0) { //list categories include PLUGINPATH . 'productCategories.php'; echo $m_return; } else { include PLUGINPATH . 'productListing.php'; echo $m_return; } } } } ?>
OutputHtml($array); $Template->OutputHead($array); echo $body; $Template->OutputFoot();