<head>
 <title>
 <?php echo \htmlentities($res->metatagsTitle??'', ENT_QUOTES, 'UTF-8', false); ?>

 </title>
 <meta content="<?php echo \htmlentities($res->metatagsDescription??'', ENT_QUOTES, 'UTF-8', false); ?>" name="description">
 <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
 <meta content="width=device-width, initial-scale=1, user-scalable=no" name="viewport">
 <base href="https://coys.com.ua
">
 <?php echo resParameter('codeHead', 'home'); ?>


 <link href="/favicon.ico" rel="icon" type="image/x-icon" />
 <link href="/favicon.png" rel="icon" type="image/png" />

 <link href="<?php echo \htmlentities(assets('css/app.css')??'', ENT_QUOTES, 'UTF-8', false); ?>" rel="stylesheet">

 <?php if($res->seoMicroHeadData): ?>
 <?php echo $res->seoMicroHeadData; ?>

 <?php elseif($res->template != getTemplate('Товар')): ?>
 <?php echo resParameter('seoMicroHeadDataGlobal', 'home'); ?>

 <?php endif; ?>

 <?php if($res->template == getTemplate('Товар')): ?>
 <?php 
 $priceTv = getPriceTv('productPrice');
 $category = current($res->productCategory);

 $openGraph = [
 'title' => $res->pagetitle,
 'description' => str_replace(['&nbsp;', '&ldquo;', '&rdquo;'], '', strip_tags($res->content)),
 'url' => resUrl($res->alias, true),
 'image' => url($res->img),
 'brand' => resParameter('seoProductBrand', 'home'),
 'availability' => $res->productStatus,
 'amount' => $res->$priceTv,
 'currency' => getConfig('order')['currency'][currLang()],
 'articul' => $res->productArticul . '_' . currLang(),
 'categoryTitle' => getFilterValues('category', $category)['title'],
 ];
 ?>
 <meta content="<?php echo \htmlentities($openGraph['title']??'', ENT_QUOTES, 'UTF-8', false); ?>" property="og:title">
 <meta content="<?php echo $openGraph['description']; ?>" property="og:description">
 <meta content="<?php echo \htmlentities($openGraph['url']??'', ENT_QUOTES, 'UTF-8', false); ?>" property="og:url">
 <meta content="<?php echo \htmlentities($openGraph['image']??'', ENT_QUOTES, 'UTF-8', false); ?>" property="og:image">
 <meta content="<?php echo \htmlentities($openGraph['brand']??'', ENT_QUOTES, 'UTF-8', false); ?>" property="product:brand">
 <meta content="<?php echo \htmlentities($openGraph['availability']??'', ENT_QUOTES, 'UTF-8', false); ?>" property="product:availability">
 <meta content="new" property="product:condition">
 <meta content="<?php echo \htmlentities($openGraph['amount']??'', ENT_QUOTES, 'UTF-8', false); ?>" property="product:price:amount">
 <meta content="<?php echo \htmlentities($openGraph['currency']??'', ENT_QUOTES, 'UTF-8', false); ?>" property="product:price:currency">
 <meta content="<?php echo \htmlentities($openGraph['articul']??'', ENT_QUOTES, 'UTF-8', false); ?>" property="product:retailer_item_id">
 <meta content="<?php echo \htmlentities($openGraph['categoryTitle']??'', ENT_QUOTES, 'UTF-8', false); ?>" property="product:item_group_id">

 <script type="application/ld+json">
 {
 "@context":"https://schema.org",
 "@type":"Product",
 "sku":"<?php echo \htmlentities($openGraph['articul']??'', ENT_QUOTES, 'UTF-8', false); ?>",
 "name":"<?php echo \htmlentities($openGraph['title']??'', ENT_QUOTES, 'UTF-8', false); ?>",
 "description":"<?php echo $openGraph['description']; ?>",
 "url":"<?php echo \htmlentities($openGraph['url']??'', ENT_QUOTES, 'UTF-8', false); ?>",
 "image": [
 <?php if(isset($res->productGallery)): ?>
 <?php $__currentLoopData = $res->productGallery; $this->addLoop($__currentLoopData);$this->getFirstLoop();
 foreach($__currentLoopData as $galleryItem): $loop = $this->incrementLoopIndices();  ?>
 <?php ($sep = $loop->last ? '' : ','); ?>
 "<?php echo \htmlentities(url( assetsUserfiles($galleryItem['img']) )??'', ENT_QUOTES, 'UTF-8', false); ?>"<?php echo \htmlentities($sep??'', ENT_QUOTES, 'UTF-8', false); ?>

 <?php endforeach; $this->popLoop(); $loop = $this->getFirstLoop(); ?>
 <?php endif; ?>
 ],
 "brand":"<?php echo \htmlentities($openGraph['brand']??'', ENT_QUOTES, 'UTF-8', false); ?>",
 "category": { 
 "@type": "Thing", 
 "name": "<?php echo \htmlentities($openGraph['categoryTitle']??'', ENT_QUOTES, 'UTF-8', false); ?>", 
 "url": "<?php echo \htmlentities(resUrl($res->parent, true) . '?category=' . $category??'', ENT_QUOTES, 'UTF-8', false); ?>" 
 },
 "offers": [
 {
 "@type": "Offer",
 "price": "<?php echo \htmlentities($openGraph['amount']??'', ENT_QUOTES, 'UTF-8', false); ?>",
 "priceCurrency": "<?php echo \htmlentities($openGraph['currency']??'', ENT_QUOTES, 'UTF-8', false); ?>",
 "itemCondition": "https://schema.org/NewCondition",
 "availability": "https://schema.org/InStock"
 }
 ]
 }
 </script>
 <?php endif; ?>
</head>
