| Current Path : /home/helpink/www/components/com_jbusinessdirectory/views/offers/tmpl/ |
| Current File : /home/helpink/www/components/com_jbusinessdirectory/views/offers/tmpl/offers_grid_style_1.php |
<?php
/**
* @package J-BusinessDirectory
*
* @author CMSJunkie http://www.cmsjunkie.com/
* @copyright Copyright (C) 2007 - 2022 CMSJunkie. All rights reserved.
* @license https://www.gnu.org/licenses/agpl-3.0.en.html
*/
defined('_JEXEC') or die('Restricted access');
$appSettings = JBusinessUtil::getApplicationSettings();
?>
<!-- layout -->
<div id="layout" class="jbd-grid-container offers-grid-style-1">
<div id="jbd-results-grid-container" class="row" itemscope itemtype="http://schema.org/OfferCatalog">
<?php
if (!empty($this->offers)) {
$index = 0;
foreach ($this->offers as $index => $offer) {
$index++;
?>
<div class="col-lg-4 col-sm-6 col-12">
<div class="jitem-card shadow-sm h-100" itemscope itemprop="itemListElement"
itemtype="http://schema.org/Offer">
<div class="jitem-img-wrap">
<a href="<?php echo $offer->link ?>" itemprop="image" itemscope
itemtype="http://schema.org/ImageObject">
</a>
<?php if (!empty($offer->picture_path)) { ?>
<img title="<?php echo $offer->picture_title ?>"
alt="<?php echo $offer->picture_info ?>"
src="<?php echo BD_PICTURES_PATH . $offer->picture_path ?>"
itemprop="contentUrl">
<?php } else { ?>
<img title="<?php echo $this->escape($offer->subject) ?>"
alt="<?php echo $this->escape($offer->subject) ?>"
src="<?php echo BD_PICTURES_PATH . '/no_image.jpg' ?>" itemprop="contentUrl">
<?php } ?>
<?php if(!empty($offer->featured)){ ?>
<div class="featured-text">
<?php echo JText::_("LNG_FEATURED")?>
</div>
<?php } ?>
<div class="card-hoverable">
<a href="<?php echo $offer->link ?>" class="btn btn-outline-success btn-sm w-auto"><?php echo JText::_("LNG_VIEW")?></a>
</div>
</div>
<div class="jitem-body">
<div class="jitem-body-content">
<div class="jitem-title">
<a href="<?php echo $offer->link ?>">
<span itemprop="name"><?php echo $this->escape($offer->subject) ?></span>
</a>
</div>
<?php if ($appSettings->enable_ratings) {?>
<div class="jitem-rating">
<span title="<?php echo $offer->review_score ?>" class="rating-review"></span>
<?php if ($offer->nr_reviews > 0){ ?>
<div class="jitem-rating-count"><?php echo $offer->nr_reviews ?></div>
<?php } ?>
</div>
<?php } ?>
<div class="jitem-desc">
<?php if (!JBusinessUtil::emptyDate($offer->startDate) || !JBusinessUtil::emptyDate($offer->endDate)) { ?>
<div class="offer-dates horizontal-item">
<i class="icon calendar"></i>
<?php
echo JBusinessUtil::getDateGeneralShortFormat($offer->startDate) . " - " . JBusinessUtil::getDateGeneralShortFormat($offer->endDate);
?>
</div>
<?php } ?>
<?php if (!empty($offer->show_time) && JBusinessUtil::getRemainingtime($offer->endDate, $offer->time_zone) != "") { ?>
<div class="offer-dates horizontal-item">
<span><i class="icon clock"></i> <?php echo JBusinessUtil::getRemainingtime($offer->endDate, $offer->time_zone) ?></span>
</div>
<?php } ?>
</div>
<div class="offer-price">
<div>
<?php if(!empty($offer->specialPrice)){?>
<span class="price"><?php echo JBusinessUtil::getPriceFormat($offer->specialPrice, $offer->currencyId); ?></span>
<?php }?>
<?php if(!empty($offer->price) ){ ?>
<span class="price <?php echo $offer->specialPrice>0 ?"old-price":"" ?>"><?php echo JBusinessUtil::getPriceFormat($offer->price, $offer->currencyId) ?></span>
<?php if(!empty($offer->specialPrice) && !empty($offer->price) && $offer->specialPrice < $offer->price){ ?>
<span class="discount">(-<?php echo JBusinessUtil::getPriceDiscount($offer->specialPrice, $offer->price) ?>%)</span>
<?php } ?>
<?php } ?>
</div>
<?php if ($this->defaultAttributes["price_text"]!=ATTRIBUTE_NOT_SHOW) { ?>
<div class="price-text-list">
<?php if (!empty($offer->price_text)) { ?>
<span class="price-text"><?php echo $offer->price_text ?></span>
<?php }elseif (empty($offer->price) && empty($offer->specialPrice) && ($appSettings->show_offer_free)){ ?>
<span class="price-text"><?php echo JText::_('LNG_FREE') ?></span>
<?php } ?>
</div>
<?php } ?>
<?php //echo OfferSellingService::getAddToCartBtn($offer) ?>
</div>
<?php if (!empty($offer->company_name)) { ?>
<div class="jitem-bottom-box">
<div class="jitem-info text-small" itemprop="offeredBy" itemscope itemtype="http://schema.org/Organization">
<div><?php echo JText::_("LNG_SOLD_BY") ?> <a href="<?php echo JBusinessUtil::getCompanyDefaultLink($offer->company_id) ?>"><?php echo $this->escape($offer->company_name) ?></a></div><i class="la la-star"></i>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
<?php
}
} ?>
</div>
</div>
<script>
window.addEventListener('load', function(){
<?php if ($appSettings->enable_ratings) {?>
jbdListings.renderGridReviewRating();
<?php } ?>
});
</script>