Current File : /home/n742ef5/royalanteam.com/wp-content/themes/myhome/templates/partials/quick_view.php |
<?php
use Tangibledesign\Framework\Helpers\ModelQuickPreview;
use Tangibledesign\Framework\Models\Model;
/* @var Model $mhCurrentListing , */
global $mhCurrentListing;
$mhModelPreview = new ModelQuickPreview($mhCurrentListing);
$mhMainValue = $mhModelPreview->getMainValue();
$mhAddress = $mhCurrentListing->getAddress();
$mhCategories = $mhModelPreview->getCategories();
$mhAttributes = $mhModelPreview->getAttributes();
$mhImageSize = tdf_app('listing_card_image_size');
$mhImages = $mhCurrentListing->getImages(tdf_settings()->getListingCardGalleryImageNumber());
?>
<div class="myhome-app myhome-quick-view-wrapper">
<div class="myhome-quick-view-wrapper__container">
<div class="myhome-quick-view" @click.stop>
<button class="myhome-quick-view__close">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">
<!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
<path d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/>
</svg>
</button>
<div class="myhome-quick-view__gallery">
<mh-card-gallery prefix="myhome">
<div slot-scope="gallery">
<div class="myhome-swiper-container">
<div class="myhome-swiper-wrapper">
<?php
if ($mhImages->isNotEmpty()) :
foreach ($mhImages as $mhImage) :
$mhImageSrcset = $mhImage->getSrcset($mhImageSize['key']);
?>
<div class="myhome-swiper-slide">
<img
class="lazyload"
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAQAAAA3fa6RAAAADklEQVR42mNkAANGCAUAACMAA2w/AMgAAAAASUVORK5CYII="
alt="<?php echo esc_attr($mhImage->getAlt()); ?>"
<?php if (!empty($mhImageSrcset)) : ?>
data-srcset="<?php echo esc_attr($mhImageSrcset); ?>"
data-sizes="auto"
<?php else : ?>
data-src="<?php echo esc_url($mhImage->getImageUrl($mhImageSize['key'])); ?>"
<?php endif; ?>
>
</div>
<?php endforeach; ?>
<?php else : ?>
<div class="myhome-swiper-slide">
<img
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAQAAAA3fa6RAAAADklEQVR42mNkAANGCAUAACMAA2w/AMgAAAAASUVORK5CYII="
alt="<?php echo esc_attr($mhCurrentListing->getName()); ?>"
>
<?php get_template_part('templates/partials/image_placeholder'); ?>
</div>
<?php endif; ?>
</div>
<?php if ($mhImages->isNotEmpty()) : ?>
<div class="myhome-quick-view__pagination">
<div class="myhome-swiper-pagination"></div>
</div>
<div
class="myhome-quick-view__prev-holder"
@click.stop.prevent
></div>
<div
class="myhome-quick-view__next-holder"
@click.stop.prevent
></div>
<div
@click.prevent="gallery.prevSlide"
class="myhome-quick-view__prev"
:class="{'myhome-quick-view__prev--active': !gallery.swiper.isBeginning}"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
<!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
<path d="M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"/>
</svg>
</div>
<div
@click.prevent="gallery.nextSlide"
class="myhome-quick-view__next"
:class="{'myhome-quick-view__next--active': !gallery.swiper.isEnd}"
>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512">
<!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
<path d="M310.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L242.7 256 73.4 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"/>
</svg>
</div>
<?php endif; ?>
</div>
</div>
</mh-card-gallery>
</div>
<div class="myhome-quick-view__content">
<div class="myhome-quick-view__top">
<div class="myhome-quick-view__meta">
<div class="myhome-quick-view__meta-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
<!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
<path d="M152 24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H64C28.7 64 0 92.7 0 128v16 48V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V192 144 128c0-35.3-28.7-64-64-64H344V24c0-13.3-10.7-24-24-24s-24 10.7-24 24V64H152V24zM48 192H400V448c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V192z"/>
</svg>
</div>
<?php echo esc_html($mhCurrentListing->getPublishDateDiff()); ?>
</div>
<div class="myhome-quick-view__meta">
<div class="myhome-quick-view__meta-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512">
<!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
<path d="M288 80c-65.2 0-118.8 29.6-159.9 67.7C89.6 183.5 63 226 49.4 256c13.6 30 40.2 72.5 78.6 108.3C169.2 402.4 222.8 432 288 432s118.8-29.6 159.9-67.7C486.4 328.5 513 286 526.6 256c-13.6-30-40.2-72.5-78.6-108.3C406.8 109.6 353.2 80 288 80zM95.4 112.6C142.5 68.8 207.2 32 288 32s145.5 36.8 192.6 80.6c46.8 43.5 78.1 95.4 93 131.1c3.3 7.9 3.3 16.7 0 24.6c-14.9 35.7-46.2 87.7-93 131.1C433.5 443.2 368.8 480 288 480s-145.5-36.8-192.6-80.6C48.6 356 17.3 304 2.5 268.3c-3.3-7.9-3.3-16.7 0-24.6C17.3 208 48.6 156 95.4 112.6zM288 336c44.2 0 80-35.8 80-80s-35.8-80-80-80c-.7 0-1.3 0-2 0c1.3 5.1 2 10.5 2 16c0 35.3-28.7 64-64 64c-5.5 0-10.9-.7-16-2c0 .7 0 1.3 0 2c0 44.2 35.8 80 80 80zm0-208a128 128 0 1 1 0 256 128 128 0 1 1 0-256z"/>
</svg>
</div>
<?php echo sprintf(esc_html('%s %s'), $mhCurrentListing->getViews(), tdf_string('views')); ?>
</div>
</div>
<div class="myhome-quick-view__body">
<?php if (!empty($mhCategories)) : ?>
<div class="myhome-quick-view__categories">
<?php foreach ($mhCategories as $mhCategory) : ?>
<div
<?php if ($mhCategory === tdf_string('featured')) : ?>
class="myhome-listing-attribute-v3 myhome-listing-attribute-v3--featured myhome-listing-card-featured-label-selector"
<?php else : ?>
class="myhome-listing-attribute-v3"
<?php endif; ?>
>
<div class="myhome-listing-attribute-v3__content">
<span class="myhome-listing-attribute-v3__value">
<?php echo esc_html($mhCategory); ?>
</span>
</div>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
<a
class="myhome-quick-view__heading"
href="<?php echo esc_url($mhCurrentListing->getUrl()); ?>"
>
<?php echo esc_html($mhCurrentListing->getName()) ?>
</a>
<?php if (!empty($mhAddress)) : ?>
<div class="myhome-quick-view__address">
<div class="myhome-quick-view__address-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512">
<!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.-->
<path d="M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"/>
</svg>
</div>
<?php echo esc_html($mhAddress); ?>
</div>
<?php endif; ?>
<?php if (!empty($mhMainValue)) : ?>
<div class="myhome-quick-view__main-value">
<?php echo esc_html($mhMainValue); ?>
</div>
<?php endif; ?>
<?php if (!empty($mhAttributes)) : ?>
<div class="myhome-quick-view__attributes">
<?php
foreach ($mhAttributes as $mhAttribute) :
tdf_partial_template('attribute', [
'attribute' => $mhAttribute,
]);
endforeach;
?>
</div>
<?php endif; ?>
<div class="myhome-quick-view__description">
<?php echo esc_html($mhCurrentListing->getIntro()); ?>
</div>
</div>
<div class="myhome-quick-view__bottom">
<a
class="myhome-button myhome-button--primary-1"
href="<?php echo esc_url($mhCurrentListing->getUrl()); ?>"
>
<?php echo esc_html(tdf_string('view_more')); ?>
</a>
<div class="myhome-quick-view__icons">
<?php if (tdf_settings()->isCompareModelsEnabled()) : ?>
<mh-compare :model-id="<?php echo esc_attr($mhCurrentListing->getId()); ?>">
<div
slot-scope="compare"
class="myhome-quick-view__icon myhome-quick-view__icon--primary-1"
:class="{'myhome-quick-view__icon--active': compare.isActive}"
@click.prevent="compare.onClick"
>
<div class="myhome-quick-view__icon-label">
<?php echo esc_html(tdf_string('add_to_compare')); ?>
</div>
<svg xmlns="http://www.w3.org/2000/svg" width="17" height="17"
viewBox="0 0 17 17"
fill="none">
<g clip-path="url(#clip0_53_5823)">
<path d="M0.169868 8.60556L3.01378 11.4283L5.83649 8.58436L3.56984 8.59284L3.55924 5.75953C3.5557 4.81318 4.30653 4.05672 5.25287 4.05318L11.5924 4.02946C11.8311 4.6848 12.4573 5.15956 13.1904 5.15682C14.1226 5.15333 14.8875 4.38264 14.884 3.45047C14.8805 2.5183 14.1098 1.75335 13.1777 1.75684C12.4446 1.75959 11.822 2.23902 11.5882 2.89613L5.24863 2.91985C3.69032 2.92568 2.42009 4.20546 2.42592 5.76377L2.43652 8.59708L0.169868 8.60556ZM1.32228 13.7013C1.32576 14.6335 2.09646 15.3984 3.02863 15.3949C3.76171 15.3922 4.3843 14.9127 4.61812 14.2556L10.9577 14.2319C12.516 14.2261 13.7862 12.9463 13.7804 11.388L13.7698 8.55468L16.0364 8.54619L13.1925 5.72348L10.3698 8.5674L12.6364 8.55892L12.647 11.3922C12.6506 12.3386 11.8998 13.095 10.9534 13.0986L4.61388 13.1223C4.37515 12.467 3.74898 11.9922 3.0159 11.9949C2.08374 11.9984 1.31879 12.7691 1.32228 13.7013ZM2.4556 13.697C2.45441 13.3774 2.70047 13.1295 3.02014 13.1283C3.33982 13.1271 3.58773 13.3731 3.58893 13.6928C3.59012 14.0125 3.34406 14.2604 3.02439 14.2616C2.70471 14.2628 2.4568 14.0167 2.4556 13.697ZM12.6174 3.45895C12.6162 3.13928 12.8622 2.89136 13.1819 2.89017C13.5016 2.88897 13.7495 3.13504 13.7507 3.45471C13.7519 3.77438 13.5058 4.0223 13.1861 4.02349C12.8665 4.02469 12.6186 3.77862 12.6174 3.45895Z"
fill="#283948"/>
</g>
<defs>
<clipPath id="clip0_53_5823">
<rect width="16" height="16" fill="white"
transform="translate(0.205078 16.2061) rotate(-90.2144)"/>
</clipPath>
</defs>
</svg>
</div>
</mh-compare>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</div>