Commit b4a03598 by halweg

Merge branch 'developer' of http://47.99.244.21:9999/root/joshine into developer

parents 5b0016f4 43e6e7c4
......@@ -58,34 +58,34 @@ $_helper = $block->getData('outputHelper');
$_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$imageHelper = $_objectManager->get('\Magento\Catalog\Helper\Image');
?>
<style>
.mode-list{
display: none;
}
.hoverImg{
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
opacity:0;
height: 100%;
-webkit-transition: opacity .5s;
-moz-transition: opacity .5s;
-ms-transition: opacity .5s;
-o-transition: opacity .5s;
transition: opacity .5s;
}
<style>
.mode-list{
display: none;
}
.hoverImg{
display: block;
position: absolute;
top: 0;
left: 0;
width: 100%;
opacity:0;
height: 100%;
-webkit-transition: opacity .5s;
-moz-transition: opacity .5s;
-ms-transition: opacity .5s;
-o-transition: opacity .5s;
transition: opacity .5s;
}
.hoverImg:hover{
opacity: 1;
-webkit-transition: opacity .5s;
-moz-transition: opacity .5s;
-ms-transition: opacity .5s;
-o-transition: opacity .5s;
transition: opacity .5s;
}
</style>
.hoverImg:hover{
opacity: 1;
-webkit-transition: opacity .5s;
-moz-transition: opacity .5s;
-ms-transition: opacity .5s;
-o-transition: opacity .5s;
transition: opacity .5s;
}
</style>
<div class="products wrapper <?= /* @noEscape */ $viewMode ?> products-<?= /* @noEscape */ $viewMode ?>">
<ol class="products list items product-items">
<?php /** @var $_product \Magento\Catalog\Model\Product */ ?>
......@@ -100,22 +100,11 @@ $_helper = $block->getData('outputHelper');
$baseImageUrl = $productImage->getImageUrl();
$allImage = $_product->getMediaGalleryImages()->getItems();
$hoverImg = '';
$tm_id = 0;
$arr = [];
foreach ($allImage as $index => $img){
if (count($arr) > 3) {
foreach ($allImage as $img){
if (basename($baseImageUrl) != basename($img->getUrl())){
$hoverImg = $imageHelper->init($_product, 'product_page_image_large')->setImageFile($img->getFile())->resize($productImage->getWidth(),$productImage->getHeight())->getUrl();
break;
}
if (in_array($img->getData('position'),[0,1,2])) {
$arr[$img->getData('position')] = $img;
}
}
if (key_exists("0",$arr)) {
$hoverImg = $imageHelper->init($_product, 'product_page_image_large')->setImageFile($arr[1]->getFile())->resize($productImage->getWidth(),$productImage->getHeight())->getUrl();
}elseif (key_exists("2",$arr)){
$hoverImg = $imageHelper->init($_product, 'product_page_image_large')->setImageFile($arr[2]->getFile())->resize($productImage->getWidth(),$productImage->getHeight())->getUrl();
}
if ($pos != null) {
......@@ -128,7 +117,7 @@ $_helper = $block->getData('outputHelper');
class="product photo product-item-photo"
tabindex="-1">
<?php
$productImageRaw = $imageHelper->init($_product, $imageDisplayArea)->setImageFile($productImage->getFile())->resize($productImage->getWidth(),$productImage->getHeight())->getUrl();
$productImageRaw = $imageHelper->init($_product, $imageDisplayArea)->setImageFile($productImage->getFile())->resize($productImage->getWidth(),$productImage->getHeight())->getUrl();
?>
<img class="product-image-photo" src="<?= $productImageRaw ?>" loading="lazy" width="<?= $productImage->getWidth() ?>" height="<?= $productImage->getHeight() ?>" alt="Image">
<?php if ($hoverImg): ?>
......
......@@ -197,7 +197,7 @@
@media (min-width: 780px){
.product-view-description{
max-height: 450px;
max-height: 250px !important;
overflow: auto;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment