| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/nice/components/com_djcatalog2/views/item/tmpl/ |
Upload File : |
<?php
/**
* @package DJ-Catalog2
* @copyright Copyright (C) DJ-Extensions.com, All rights reserved.
* @license http://www.gnu.org/licenses GNU/GPL
* @author url: http://dj-extensions.com
* @author email contact@dj-extensions.com
*
*/
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\HTML\Helpers\Bootstrap;
use Joomla\CMS\Factory;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Language\Text;
use Joomla\Filter\OutputFilter;
use Joomla\CMS\Layout\FileLayout;
$user = Factory::getUser();
$price_auth = ($user->guest) ? (($this->params->get('price_restrict', '0') == '1' || $this->item->price_restrict) ? false : true) : true;
$edit_auth = ($user->authorise('core.edit', 'com_djcatalog2') || ($user->authorise('core.edit.own', 'com_djcatalog2') && $user->id == $this->item->created_by)) ? true : false;
$nullDate = Factory::getDbo()->getNullDate();
$this->item_cursor = $this->item;
$showItemTitle = (bool)(!$this->params->get('show_page_heading', 1) || $this->item->name != $this->params->get('page_heading'));
// Schema.org
$app = Factory::getApplication();
$images = DJCatalog2ImageHelper::getImages('item', $this->item->id);
$itemLink = DJCatalogHelperRoute::getItemRoute($this->item->slug, $this->item->catslug);
$this->item->_link = $itemLink;
$currency = $this->params->get('price_unit');
if($currency === "$")$currency = "USD";
if($currency === "€")$currency = "EUR";
if($currency === "zł")$currency = "PLN";
$siteName = $app->get('sitename');
// Calculate average rating if available
if(isset($this->item->rating) && isset($this->item->rating_count) && $this->item->rating !== "0" && $this->item->rating_count !== "0") {
$averageRating = $this->item->rating / $this->item->rating_count;
// If averageRating is 0, set rating count to 0 as well
if($averageRating == 0) {
$this->item->rating_count = 0;
}
} else {
$averageRating = 0;
$this->item->rating_count = 0;
}
// Schema.org
$productSchema = [
'@context' => 'https://schema.org',
'@type' => 'Product',
'name' => $this->item->name,
'description' => $this->item->intro_desc, // Use the product description here
'image' => isset($images[0]) ? $images[0]->original : null, // Provide the URL of the product image
'offers' => [
'@type' => 'Offer',
'price' => $this->item->price, // Use the product price here
'priceCurrency' => $currency, // Assuming the currency is fixed, you can modify this accordingly
'availability' => ($this->item->available == 1) ? 'https://schema.org/InStock' : 'https://schema.org/OutOfStock', // Determine the availability of the product
'seller' => [
'@type' => 'Organization',
'name' => $siteName // Name of company assume that it is sitename
],
'shippingDetails' => $this->item->shipping_days,
'hasMerchantReturnPolicy' => false,
],
'brand' => [ // Add the producer information as a Brand schema
'@type' => 'Brand',
'name' => $this->item->producer // Producer name
],
'url' => Route::_($this->item->_link) // Provide the URL of the product page
];
// Add SKU
if(isset($this->item->sku)) {
$productSchema['offers']['sku'] = $this->item->sku;
}
// Add aggregateRating only if averageRating and rating_count are both not 0
if($averageRating != 0 && $this->item->rating_count != 0) {
$productSchema['aggregateRating'] = [
'@type' => 'AggregateRating',
'ratingValue' => $averageRating, // Provide the average rating value for the product
'reviewCount' => $this->item->rating_count // Provide the total number of ratings/reviews for the product
];
}
$app = Factory::getApplication();
$combinationId = $app->input->getInt('combination_id', 0);
if (!isset($this->item->images) || $combinationId > 0) {
if ($combinationId > 0) {
$this->item->images = DJCatalog2ImageHelper::getImages('combination', $combinationId);
if (empty($this->item->images)) {
$this->item->images = DJCatalog2ImageHelper::getImages('item', $this->item->id);
}
} else {
$this->item->images = DJCatalog2ImageHelper::getImages('item', $this->item->id);
}
}
$djMediaTools = ($this->params->get('djmediatools_integration', 0) == '1' && $this->params->get('djmediatools_album_item', 0) > 0) ? $this->params->get('djmediatools_album_item', 0) : false;
$djMediaToolsMinimum = (int)$this->params->get('djmediatools_minimum', 1);
$fullscreenVar = ($this->params->get('image_popup_src', 'opt') == 'opt') ? 'fullscreen' : 'original';
$allMedias = array();
foreach($this->item->images as $img) {
$img->__type = 'image';
$img->_href = $img->$fullscreenVar;
$img->_large = $img->large;
$img->_small = $img->small;
$allMedias[] = $img;
}
if(isset($this->item->videos) && count($this->item->videos)) {
foreach($this->item->videos as $vid) {
$vid->__type = 'video';
$vid->_href = $vid->fullpath;
if ($vid->cover != '' && $vid->cover_path != '') {
$vid->_large = DJCatalog2ImageHelper::getProcessedImage($vid->cover, $this->params->get('width'), $this->params->get('height'), ($this->params->get('resize') == 0), $vid->cover_path);
$vid->_small = DJCatalog2ImageHelper::getProcessedImage($vid->cover, $this->params->get('smallth_width'), $this->params->get('smallth_height'), ($this->params->get('resize') == 0), $vid->cover_path);
} else if ($this->params->get('image_default', false)) {
$vid->_large = DJCatalog2ImageHelper::getDefaultImage('item', 'large');
$vid->_small = DJCatalog2ImageHelper::getDefaultImage('item', 'small');
} else if (($customThumb = DJCatalog2ThemeHelper::getThemeImage('default-thumbnail.jpg', 'path')) != '') {
$vid->_large = DJCatalog2ImageHelper::getDefaultImage('item', 'large', ['custom_image' => $customThumb]);
$vid->_small = DJCatalog2ImageHelper::getDefaultImage('item', 'small', ['custom_image' => $customThumb]);
} else {
continue;
}
$allMedias[] = $vid;
}
}
DJCatalog2HtmlHelper::sortImagesAndVideos($allMedias, (int)$this->params->get('image_video_sort_method', 1));
// Convert the Schema.org markup to JSON-LD format
$jsonLdProductSchema = json_encode($productSchema, JSON_PRETTY_PRINT);
// Output the JSON-LD markup for the current product
$doc = Factory::getDocument();
// Add the JSON-LD script to the document head
$doc->addScriptDeclaration('
var jsonLdProductSchema = ' . $jsonLdProductSchema . ';
var script = document.createElement("script");
script.type = "application/ld+json";
script.textContent = JSON.stringify(jsonLdProductSchema);
document.head.appendChild(script);
');?>
<div >
<div id="djcatalog"
class="djc_clearfix djc_item<?php echo $this->params->get('pageclass_sfx') . ' djc_theme_' . $this->params->get('theme', 'default');
if ($this->item->featured == 1) echo ' featured_item'; ?>">
<?php if ($this->item->event->beforeDJCatalog2DisplayContent) { ?>
<div class="djc_pre_content">
<?php echo $this->item->event->beforeDJCatalog2DisplayContent; ?>
</div>
<?php } ?>
<?php
$layout = new FileLayout('com_djcatalog2.moduleposition', DJCatalog2ThemeHelper::getLayoutBasePath(), array('component' => 'com_djcatalog2'));
echo $layout->render(array('position' => 'top', 'view' => 'product'));
?>
<?php if ($this->navigation && (!empty($this->navigation['prev']) || !empty($this->navigation['next'])) && ($this->params->get('show_navigation', '0') == 'top' || $this->params->get('show_navigation', '0') == 'all')) { ?>
<div class="djc_product_top_nav djc_clearfix">
<?php if (!empty($this->navigation['prev'])) { ?>
<a class="djc_prev_btn"
href="<?php echo Route::_(DJCatalogHelperRoute::getItemRoute($this->navigation['prev']->slug, $this->navigation['prev']->catslug)); ?>"><span
class="btn btn-primary"><?php echo Text::_('COM_DJCATALOG2_PREVIOUS'); ?></span></a>
<?php } ?>
<?php if (!empty($this->navigation['next'])) { ?>
<a class="djc_next_btn"
href="<?php echo Route::_(DJCatalogHelperRoute::getItemRoute($this->navigation['next']->slug, $this->navigation['next']->catslug)); ?>"><span
class="btn btn-primary"><?php echo Text::_('COM_DJCATALOG2_NEXT'); ?></span></a>
<?php } ?>
</div>
<?php } ?>
<?php if ($this->params->get('show_page_heading', 1)) { ?>
<h1 class="componentheading<?php echo $this->params->get('pageclass_sfx') ?> djc_page_heading" <?php if (!$showItemTitle) {
echo 'itemprop="name"';
} ?>>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php } ?>
<div class="clr clear"></div>
<?php if ($showItemTitle) { ?>
<h1 class="djc_title">
<?php /*if ($this->item->featured == 1) {
echo '<img class="djc_featured_image" alt="' . Text::_('COM_DJCATALOG2_FEATURED_ITEM') . '" title="' . Text::_('COM_DJCATALOG2_FEATURED_ITEM') . '" src="' . DJCatalog2ThemeHelper::getThemeImage('featured.png') . '" />';
} */ ?>
<?php if ((int)$this->params->get('fed_edit_button', 0) == 1 && $edit_auth) { ?>
<a role="button" class="btn btn-primary btn-mini djc_edit_button"
href="<?php echo Route::_('index.php?option=com_djcatalog2&task=itemform.edit&id=' . $this->item->id); ?>"><?php echo Text::_('COM_DJCATALOG2_EDIT') ?></a>
<?php } ?>
<?php echo $this->escape($this->item->name); ?>
</h1>
<?php } else { ?>
<?php /*if ($this->item->featured == 1) {
echo '<img class="djc_featured_image" alt="'.Text::_('COM_DJCATALOG2_FEATURED_ITEM').'" title="'.Text::_('COM_DJCATALOG2_FEATURED_ITEM').'" src="'.DJCatalog2ThemeHelper::getThemeImage('featured.png').'" />';
}*/ ?>
<?php if ((int)$this->params->get('fed_edit_button', 0) == 1 && $edit_auth) { ?>
<a role="button" class="btn btn-primary btn-mini djc_edit_button"
href="<?php echo Route::_('index.php?option=com_djcatalog2&task=itemform.edit&id=' . $this->item->id); ?>"><?php echo Text::_('COM_DJCATALOG2_EDIT') ?></a>
<?php } ?>
<?php } ?>
<?php
$lblData = array('item' => $this->item, 'params' => $this->params, 'context' => 'com_djcatalog2.item', 'wrapper_class_sfx' => 'items');
$layout = new FileLayout('com_djcatalog2.autolabels', DJCatalog2ThemeHelper::getLayoutBasePath(), array('component' => 'com_djcatalog2'));
echo $layout->render($lblData);
?>
<?php if (in_array('item', $this->params->get('social_code_views', array())) && $this->params->get('social_code_position', 'top') == 'top' && $this->params->get('social_code', '') != '') { ?>
<div class="djc_clearfix djc_social_t">
<?php echo $this->params->get('social_code'); ?>
</div>
<?php } ?>
<?php
$this->item->images = DJCatalog2ImageHelper::getImages('item', $this->item->id);
$this->item->videos = DJCatalog2VideoHelper::getVideos('item', $this->item->id);
if (($this->item->images || $this->item->videos) && (int)$this->params->get('show_image_item', 1) > 0) {
echo $this->loadTemplate('images');
} ?>
<?php if ($this->item->event->afterDJCatalog2DisplayTitle) { ?>
<div class="djc_post_title">
<?php echo $this->item->event->afterDJCatalog2DisplayTitle; ?>
</div>
<?php } ?>
<?php if ($this->params->get('product_rating', false) && $this->params->get('show_rating_item', true)) { ?>
<div class="djc_item_rating">
<?php
$canVote = (bool)($user->authorise('djcatalog2.vote', 'com_djcatalog2') && Djcatalog2HelperRating::canVote($this->item));
$voteData = array('item' => $this->item, 'params' => $this->params, 'context' => 'com_djcatalog2.item', 'can_vote' => $canVote);
$layout = new FileLayout('com_djcatalog2.item.rating', DJCatalog2ThemeHelper::getLayoutBasePath(), array('component' => 'com_djcatalog2'));
echo $layout->render($voteData);
if ($canVote) {
$layout = new FileLayout('com_djcatalog2.item.vote', DJCatalog2ThemeHelper::getLayoutBasePath(), array('component' => 'com_djcatalog2'));
echo $layout->render($voteData);
}
?>
</div>
<?php } ?>
<?php if ($this->item->parent_id > 0 && !empty($this->item->_parent)) { ?>
<a href="<?php echo Route::_(DJCatalog2HelperRoute::getItemRoute($this->item->_parent->slug, $this->item->_parent->catslug)); ?>"><?php echo Text::sprintf('COM_DJCATALOG2_CHILD_BACK_TO_PARENT', $this->item->_parent->name);?></a>
<?php }?>
<?php if (in_array('item', $this->params->get('social_code_views', array())) && $this->params->get('social_code_position', 'top') == 'aft_title' && $this->params->get('social_code', '') != '') { ?>
<div class="djc_clearfix djc_social_at">
<?php echo $this->params->get('social_code'); ?>
</div>
<?php } ?>
<?php if ($this->params->get('show_print_button_item', false) == '1'
|| $this->params->get('show_pdf_button_item', false) == '1'
|| $this->params->get('show_contact_form', '1')
//|| ((int)$this->item->available == 1 && $this->params->get('items_show_cart_button_item', '1') == 1 && ($this->params->get('cart_enabled', false) || $this->params->get('cart_query_enabled', 1) ))
) { ?>
<div class="djc_toolbar">
<?php if ($this->params->get('show_contact_form', '1')) { ?>
<button role="button" id="djc_contact_form_button"
class="btn btn-secondary btn-mini"><?php echo Text::_('COM_DJCATALOG2_CONTACT_FORM_OPEN') ?></button>
<?php } ?>
<?php /*if ((int)$this->item->available == 1 && $this->params->get('items_show_cart_button_item', '1') == 1) {
echo $this->loadTemplate('addtocart');
}*/ ?>
<?php if ($this->params->get('show_print_button_item', false) == '1') { ?>
<a role="button" rel="nofollow" class="djc_printable_version btn btn-mini"
href="<?php echo Route::_(DJCatalogHelperRoute::getItemRoute($this->item->slug, $this->item->catslug) . '&tmpl=component&print=1&layout=print'); ?>"><?php echo Text::_('COM_DJCATALOG2_PRINTABLE_BUTTON'); ?></a>
<?php } ?>
<?php if ($this->params->get('show_pdf_button_item', false) == '1') { ?>
<a role="button" rel="nofollow" class="djc_print_pdf_button btn btn-mini"
href="<?php echo Route::_(DJCatalogHelperRoute::getItemRoute($this->item->slug, $this->item->catslug) . '&tmpl=component&print=1&layout=print&pdf=1'); ?>"><?php echo Text::_('COM_DJCATALOG2_PRINT_PDF_BUTTON'); ?></a>
<?php } ?>
</div>
<?php } ?>
<?php if ($this->params->get('show_labels_item', 0)) {
echo $this->loadTemplate('labels');
} ?>
<div class="djc_description">
<div class="djc_desc_wrap">
<?php if ((int)$this->params->get('show_intro_desc_item', 0) == 1) { ?>
<div class="djc_introtext"><?php echo Joomla\CMS\HTML\HTMLHelper::_('content.prepare', $this->item->intro_desc, $this->params, 'com_djcatalog2.item.intro_desc'); ?></div>
<?php } ?>
<div class="djc_fulltext"><?php echo Joomla\CMS\HTML\HTMLHelper::_('content.prepare', $this->item->description, $this->params, 'com_djcatalog2.item.description'); ?></div>
</div>
<div class="djc_item_info">
<?php if ($this->params->get('show_producer_name_item') > 0 && $this->item->publish_producer == '1' && $this->item->producer) { ?>
<div class="djc_producer_info">
<small>
<?php
if ($this->params->get('show_producer_name_item') == 2) {
echo Text::_('COM_DJCATALOG2_PRODUCER') . ': '; ?>
<span ><?php echo $this->item->producer; ?></span>
<?php /*} else if(($this->params->get('show_producer_name_item') == 3)) { ?>
<?php echo Text::_('COM_DJCATALOG2_PRODUCER').': ';?><a class="modal" rel="{handler: 'iframe', size: {x: 800, y: 450}}" href="<?php echo Route::_(DJCatalogHelperRoute::getProducerRoute($this->item->prodslug).'&tmpl=component'); ?>"><span><?php echo $this->item->producer; ?></span></a>
<?php } else { */ ?>
<?php } else if (($this->params->get('show_producer_name_item') == 3)) { ?>
<?php echo Text::_('COM_DJCATALOG2_PRODUCER') . ': '; ?><a data-toggle="modal"
data-target="#djc_producer_modal"
data-bs-toggle="modal"
href="#djc_producer_modal">
<span><?php echo $this->item->producer; ?></span></a>
<?php echo Bootstrap::renderModal('djc_producer_modal', array('bodyHeight' => '70', 'modalWidth' => '80', 'url' => Route::_(DJCatalogHelperRoute::getProducerRoute($this->item->prodslug) . '&tmpl=component'), 'title' => $this->item->producer)); ?>
<?php } else { ?>
<?php echo Text::_('COM_DJCATALOG2_PRODUCER') . ': '; ?><a
href="<?php echo Route::_(DJCatalogHelperRoute::getProducerRoute($this->item->prodslug)); ?>">
<span ><?php echo $this->item->producer; ?></span></a>
<?php } ?>
<?php if ($this->params->get('show_producers_items_item', 1)) { ?>
<a class="djc_producer_items_link btn btn-mini"
href="<?php echo Route::_(DJCatalogHelperRoute::getCategoryRoute(0) . '&cm=0&pid=' . $this->item->producer_id); ?>"><span><?php echo Text::_('COM_DJCATALOG2_SHOW_PRODUCERS_ITEMS'); ?></span></a>
<?php } ?>
</small>
</div>
<?php } ?>
<?php if ((int)$this->params->get('show_sku_item', 1) == 1 && $this->item->sku != '') { ?>
<div class="djc_sku">
<small>
<?php echo Text::_('COM_DJCATALOG2_SKU') . ': '; ?>
<span ><?php echo trim((string)$this->item->sku); ?></span>
</small>
</div>
<?php } ?>
<?php if ((int)$this->params->get('show_author_item', 0) > 0 && $this->item->author) { ?>
<div class="djc_author">
<small>
<?php echo Text::_('COM_DJCATALOG2_CREATED_BY') . ': '; ?>
<?php if ((int)$this->params->get('show_author_item') == 1 && $this->item->created_by) { ?>
<a href="<?php echo Route::_(DJCatalogHelperRoute::getCategoryRoute(0) . '&aid=' . $this->item->created_by . ':' . ApplicationHelper::stringURLSafe($this->item->author)); ?>"><span><?php echo $this->item->author; ?></span></a>
<?php } else { ?>
<span><?php echo $this->item->author; ?></span>
<?php } ?>
</small>
</div>
<?php } ?>
<?php if ((int)$this->params->get('show_date_item', 0) == 1 && $this->item->created != $nullDate) { ?>
<div class="djc_date djc_created_date">
<small>
<?php echo Text::_('COM_DJCATALOG2_CREATED_ON') . ': '; ?>
<span><?php echo Joomla\CMS\HTML\HTMLHelper::_('date', $this->item->created, $this->params->get('date_format_date', Text::_('DATE_FORMAT_LC3'))); ?></span>
</small>
</div>
<?php } ?>
<?php if ((int)$this->params->get('show_publishdate_item', 0) == 1 && $this->item->publish_up != $nullDate) { ?>
<div class="djc_date djc_publish_date">
<small>
<?php echo Text::_('COM_DJCATALOG2_PUBLISHED_ON') . ': '; ?>
<span><?php echo Joomla\CMS\HTML\HTMLHelper::_('date', $this->item->publish_up, $this->params->get('date_format_date', Text::_('DATE_FORMAT_LC3'))); ?></span>
</small>
</div>
<?php } ?>
<?php if ((int)$this->params->get('show_price_item') > 0) { ?>
<?php
$priceOpts = array(
'when_not_null' => $this->params->get('show_price_item') == 1,
'display_always' => $this->params->get('show_price_item') == 2,
'restricted_note' => $this->params->get('restricted_price_info', 1),
'show_old' => $this->params->get('show_old_price_item', 1),
'structured_data' => true
);
$priceData = array('item' => $this->item, 'params' => $this->params, 'options' => $priceOpts);
$layout = new FileLayout('com_djcatalog2.price', DJCatalog2ThemeHelper::getLayoutBasePath(), array('component' => 'com_djcatalog2'));
echo $layout->render($priceData)
?>
<?php } ?>
<?php if ($this->params->get('show_wishlist_item')) {
$layout = new FileLayout('com_djcatalog2.addtowishlist', DJCatalog2ThemeHelper::getLayoutBasePath(), array('component' => 'com_djcatalog2'));
echo $layout->render(array('item' => $this->item));
} ?>
<?php
$stockInfo = $this->params->get('show_outstock_info', 0);
if ((int)$stockInfo > 0) {
$stockData = array('item' => $this->item, 'type' => $stockInfo, 'params' => $this->params);
$layout = new FileLayout('com_djcatalog2.stockinfo', DJCatalog2ThemeHelper::getLayoutBasePath(), array('component' => 'com_djcatalog2'));
?>
<p class="djc_stock"><?php echo $layout->render($stockData); ?></p>
<?php } ?>
<?php
$availInfo = $this->params->get('show_avail_info', 0);
if ((int)$availInfo > 0) {
$availData = array('item' => $this->item, 'type' => $availInfo, 'params' => $this->params);
$layout = new FileLayout('com_djcatalog2.availinfo', DJCatalog2ThemeHelper::getLayoutBasePath(), array('component' => 'com_djcatalog2'));
?>
<p class="djc_avail_info"><?php echo $layout->render($availData); ?></p>
<?php } ?>
<?php if ((int)$this->item->available == 1 && $this->params->get('items_show_cart_button_item', '1') == 1 && ($this->params->get('cart_enabled', false) || $this->params->get('cart_query_enabled', 1))) { ?>
<?php echo $this->loadTemplate('addtocart'); ?>
<?php } ?>
</div>
<?php
if (count($this->attributes) > 0) {
$grouppedAttributes = (bool)$this->params->get('group_attributes_item', '0') == '1';
$attributes_body = ($grouppedAttributes) ? array() : '';
foreach ($this->attributes as $attribute) {
$this->attribute_cursor = $attribute;
if ($grouppedAttributes) {
if (!isset($attributes_body[$attribute->group_id])) {
$label = ($attribute->group_label) ? $attribute->group_label : $attribute->group_name;
$attributes_body[$attribute->group_id] = array('label' => $label, 'attributes' => array());
}
$attributes_body[$attribute->group_id]['attributes'][] = $this->loadTemplate('attributes');
} else {
$attributes_body .= $this->loadTemplate('attributes');
}
}
?>
<?php if (!is_array($attributes_body) && $attributes_body != '') { ?>
<div class="djc_attributes">
<table class="table table-condensed">
<?php echo Joomla\CMS\HTML\HTMLHelper::_('content.prepare', $attributes_body, $this->params, 'com_djcatalog2.item.extra_fields'); ?>
</table>
</div>
<?php } else if (is_array($attributes_body) && !empty($attributes_body)) { ?>
<?php
foreach ($attributes_body as $attGroup) {
$attributes_body_tmp = '';
if (empty($attGroup['attributes'])) {
continue;
}
foreach ($attGroup['attributes'] as $value) {
$attributes_body_tmp .= $value;
}
if ($attributes_body_tmp == '') {
continue;
}
?>
<div class="djc_attributes djc_attribute_group djc_attribute_group-<?php echo ($attGroup['label']) ? OutputFilter::stringURLSafe($attGroup['label']) : 0; ?>">
<?php if ($attGroup['label']) { ?>
<h3><?php echo $this->escape($this->item->name); ?></h3>
<?php } ?>
<?php if ($this->params->get('show_category_name_item') && $this->item->publish_category == '1') { ?>
<?php
// Tryb wyświetlania dodatkowych kategorii:
// 0 - nie pokazuj, 1 - linki, 2 - tekst
$extraMode = (int) $this->params->get('show_additional_categories', 1);
$catId = (int) $this->item->cat_id;
$categories = (array) ($this->item->_categories_ids ?? []);
// Usuń główną kategorię z listy
$filteredCategories = array_values(array_filter($categories, function ($id) use ($catId) {
return (int)$id !== $catId;
}));
// Pobierz dane dodatkowych kategorii w kolejności wejściowej
$extraCats = []; // [ [id, alias, name, slug], ... ]
if (!empty($filteredCategories)) {
$db = Factory::getDbo();
$ids = array_map('intval', array_unique($filteredCategories));
$query = $db->getQuery(true)
->select([
$db->quoteName('id'),
$db->quoteName('alias'),
$db->quoteName('name') // Zmień na 'title' jeśli Twoja tabela używa innej kolumny na nazwę
])
->from($db->quoteName('#__djc2_categories'))
->where($db->quoteName('id') . ' IN (' . implode(',', $ids) . ')');
$db->setQuery($query);
$rows = (array) $db->loadAssocList('id'); // mapa id => row
foreach ($filteredCategories as $cid) {
if (isset($rows[$cid])) {
$r = $rows[$cid];
$extraCats[] = [
'id' => (int) $r['id'],
'alias' => (string) $r['alias'],
'name' => (string) $r['name'],
'slug' => (int) $r['id'] . ':' . (string) $r['alias'],
];
}
}
}
?>
<div class="djc_category_info">
<?php if ($this->params->get('show_category_name_item') == 2) : ?>
<strong><?php echo Text::_('COM_DJCATALOG2_CATEGORY') . ': '; ?></strong>
<span><?php echo $this->item->category; ?></span>
<?php else : ?>
<?php echo Text::_('COM_DJCATALOG2_CATEGORY') . ': '; ?>
<a href="<?php echo DJCatalogHelperRoute::getCategoryRoute($this->item->catslug); ?>">
<span><?php echo $this->item->category; ?></span>
</a>
<?php endif; ?>
<?php if ($extraMode > 0 && !empty($extraCats)) : ?>
<span class="djc_extra_categories_separator">, </span>
<span class="djc_extra_categories_list">
<?php
$out = [];
foreach ($extraCats as $ec) {
$nameEsc = htmlspecialchars($ec['name'], ENT_QUOTES, 'UTF-8');
if ($extraMode === 1) {
// Linki
$out[] = '<a href="' . DJCatalogHelperRoute::getCategoryRoute($ec['slug']) . '">' . $nameEsc . '</a>';
} else {
// Tekst
$out[] = $nameEsc;
}
}
echo implode(', ', $out);
?>
</span>
<?php endif; ?>
</div>
<?php } ?>
<table class="table table-condensed">
<?php echo Joomla\CMS\HTML\HTMLHelper::_('content.prepare', $attributes_body_tmp, $this->params, 'com_djcatalog2.item.extra_fields'); ?>
</table>
<?php if ($this->params->get('show_producers_items_item', 1)) { ?>
<a class="djc_producer_items_link btn btn-mini" target="_blank"
href="<?php echo Route::_(DJCatalogHelperRoute::getCategoryRoute(0) . '&cm=0&pid=' . $this->item->producer_id); ?>"><span><?php echo Text::_('COM_DJCATALOG2_SHOW_PRODUCERS_ITEMS'); ?></span></a>
<?php } ?>
</div>
<?php } ?>
<?php } ?>
<?php } ?>
<?php if (isset($this->item->tabs)) { ?>
<div class="djc_clear"></div>
<div class="djc_tabs">
<?php echo Joomla\CMS\HTML\HTMLHelper::_('content.prepare', $this->item->tabs, $this->params, 'com_djcatalog2.item.tabs'); ?>
</div>
<?php } ?>
<?php if (!empty($this->children) && (int)$this->params->get('items_show_variants', 1) == 1) { ?>
<div class="djc_clear"></div>
<div class="djc_item_variants">
<?php echo $this->loadTemplate('children'); ?>
</div>
<?php } ?>
<?php //if( ((int)$this->params->get('show_location_map_item', 1) > 0 || (int)$this->params->get('show_location_details_item', 1) > 0 ) && (($this->item->latitude != 0.0 && $this->item->longitude != 0.0) || ( !empty($this->item->address) || !empty($this->item->city) ))) {
if ((int)$this->params->get('show_location_map_item', 1) > 0 || (int)$this->params->get('show_location_details_item', 1) > 0) {
echo $this->loadTemplate('map');
} ?>
<?php if ($this->params->get('show_files_item', 1) > 0 && ($this->item->files = DJCatalog2FileHelper::getFiles('item', $this->item->id))) {
echo $this->loadTemplate('files');
} ?>
<?php if ($this->params->get('show_contact_form', '1')) { ?>
<div class="djc_clear"></div>
<div class="djc_contact_form_wrapper" id="contactform">
<?php echo $this->loadTemplate('contact'); ?>
</div>
<?php } ?>
<?php if ($this->item->event->afterDJCatalog2DisplayContent) { ?>
<div class="djc_post_content">
<?php echo $this->item->event->afterDJCatalog2DisplayContent; ?>
</div>
<?php } ?>
<?php if ($this->navigation && (!empty($this->navigation['prev']) || !empty($this->navigation['next'])) && ($this->params->get('show_navigation', '0') == 'bottom' || $this->params->get('show_navigation', '0') == 'all')) { ?>
<div class="djc_product_bottom_nav djc_clearfix">
<?php if (!empty($this->navigation['prev'])) { ?>
<a class="djc_prev_btn"
href="<?php echo Route::_(DJCatalogHelperRoute::getItemRoute($this->navigation['prev']->slug, $this->navigation['prev']->catslug)); ?>"><span
class=" btn btn-primary"><?php echo Text::_('COM_DJCATALOG2_PREVIOUS'); ?></span></a>
<?php } ?>
<?php if (!empty($this->navigation['next'])) { ?>
<a class="djc_next_btn"
href="<?php echo Route::_(DJCatalogHelperRoute::getItemRoute($this->navigation['next']->slug, $this->navigation['next']->catslug)); ?>"><span
class=" btn btn-primary"><?php echo Text::_('COM_DJCATALOG2_NEXT'); ?></span></a>
<?php } ?>
</div>
<?php } ?>
<?php if (in_array('item', $this->params->get('social_code_views', array())) && $this->params->get('social_code_position', 'top') == 'aft_desc' && $this->params->get('social_code', '') != '') { ?>
<div class="djc_clearfix djc_social_ad">
<?php echo $this->params->get('social_code'); ?>
</div>
<?php } ?>
<?php if ((int)$this->params->get('show_sections_item', 1)) : ?>
<?php
$layout = new FileLayout('com_djcatalog2.sections.block', DJCatalog2ThemeHelper::getLayoutBasePath(), array('component'=> 'com_djcatalog2'));
echo $layout->render($this->item->sections);
?>
<?php endif; ?>
<?php if ((int)$this->params->get('comments', 0) > 0 && (int)$this->params->get('show_comments_item', 1) > 0) {
echo $this->loadTemplate('comments');
} ?>
<?php if ($this->relateditems && $this->params->get('related_items_count', 2) > 0) {
echo $this->loadTemplate('relateditems');
} ?>
</div>
<?php
$layout = new FileLayout('com_djcatalog2.moduleposition', DJCatalog2ThemeHelper::getLayoutBasePath(), array('component' => 'com_djcatalog2'));
echo $layout->render(array('position' => 'bottom', 'view' => 'product'));
?>
<div class="hp-styl">
<h3>Sdílet obsah</h3>
<div class="bluebox socialbox">
<?php if (in_array('item', $this->params->get('social_code_views', array())) && $this->params->get('social_code_position', 'top') == 'bottom' && $this->params->get('social_code', '') != '') { ?>
<div class="djc_clearfix djc_social_b">
<?php echo $this->params->get('social_code'); ?>
</div>
<?php } ?>
<?php if ((int)$this->params->get('show_hits_item', 0) == 1) { ?>
<div class="djc_hits">
<small>
<?php echo Text::_('COM_DJCATALOG2_HITS') . ': '; ?>
<span><?php echo $this->item->hits; ?></span>
</small>
</div>
<?php } ?>
</div>
</div>
<?php if (false) { ?>
<?php
$categoryUrl = Route::_(DJCatalogHelperRoute::getCategoryRoute(Factory::getApplication()->input->getString('refcid', 0), $this->item->prodslug));
?>
<a class="btn btn-primary" href="<?php echo $categoryUrl; ?>"><?php echo Text::_('COM_DJCATALOG2_BACK_BUTTON'); ?></a>
<?php } ?>
<?php
if ($this->params->get('show_footer')) echo DJCATFOOTER;
?>
</div>
</div>