Commit ee81fdb7 by liumengfei

Merge branch 'developer' into production

parents 3e017a0c f7a155b4
...@@ -199,19 +199,17 @@ class Topmenu extends JoshineMenu ...@@ -199,19 +199,17 @@ class Topmenu extends JoshineMenu
$colStops = $this->_columnBrake($child->getChildren(), $limit); $colStops = $this->_columnBrake($child->getChildren(), $limit);
} }
$sumMenuColumnsTotal = $child->getSubmenuColumnsTotal();
$columns = $sumMenuColumnsTotal ?? "11" ;
if (intval($columns) >= 12) {
$columns = "11";
}
if ($childLevel == 0) { if ($childLevel == 0) {
$leftMargin = $child->getChildLeftMargin(); $leftMarginClass = $this->getMarginClass($child->getChildLeftMargin());
if ($leftMargin != "0" && empty($leftMargin)) { $sumMenuColumnsTotal = $child->getSubmenuColumnsTotal();
$leftMargin = "1"; $columns = $sumMenuColumnsTotal ?? "11" ;
if (intval($columns) >= 12) {
$columns = "11";
} }
$colClass = $this->getColClass($columns);
$html = "<div class=\"level{$childLevel} {$childrenWrapClass}\">"; $html = "<div class=\"level{$childLevel} {$childrenWrapClass}\">";
$html .= "<div class=\"row \"> $html .= "<div class=\"row \">
<ul class=\"subchildmenu joshine-col-lg-push-{$leftMargin} mega-columns joshine-clearfix joshine-col-lg-{$columns} {$child->getMenuImage()}\"> <ul class=\"subchildmenu $leftMarginClass mega-columns joshine-clearfix $colClass {$child->getMenuImage()}\">
{$this->_getHtml($child, $childrenWrapClass, $limit, $colStops)} {$this->_getHtml($child, $childrenWrapClass, $limit, $colStops)}
</ul>"; </ul>";
$html .= $this->appendImage($child); $html .= $this->appendImage($child);
...@@ -224,6 +222,30 @@ class Topmenu extends JoshineMenu ...@@ -224,6 +222,30 @@ class Topmenu extends JoshineMenu
return $html; return $html;
} }
private function getMarginClass($col)
{
$colInt = intval($col);
if ($colInt > 0) {
return "joshine-col-lg-push-{$colInt}";
}
if ($colInt < 0) {
$colInt = abs($colInt);
return "joshine-col-lg-pull-{$colInt}";
}
return "joshine-col-lg-push-1";
}
private function getColClass($col)
{
$colInt = intval($col);
if ($colInt <= 0) {
return "";
}
return "joshine-col-lg-{$colInt}";
}
private function appendImage($child) private function appendImage($child)
{ {
$html = ""; $html = "";
...@@ -232,15 +254,13 @@ class Topmenu extends JoshineMenu ...@@ -232,15 +254,13 @@ class Topmenu extends JoshineMenu
} }
if ($child->getMenuImage()) { if ($child->getMenuImage()) {
$imageLeftMargin = $child->getImageLeftMargin(); $marginClass = $this->getMarginClass(intval($child->getImageLeftMargin()));
if (empty($imageLeftMargin)) {
$imageLeftMargin = "0";
}
$imageWidth = $child->getImageWidth(); $imageWidth = $child->getImageWidth();
if (empty($imageWidth)) { if (empty($imageWidth)) {
$imageWidth = "3"; $imageWidth = "3";
} }
$html .= "<div class=\" pull-right joshine-col-lg-{$imageWidth} joshine-col-lg-push-{$imageLeftMargin} joshine-hidden-xs joshine-hidden-sm joshine-hidden-md \">"; $colClass = $this->getColClass($imageWidth);
$html .= "<div class=\"$colClass $marginClass joshine-hidden-xs joshine-hidden-sm joshine-hidden-md \">";
$html .= "<img src='{$child->getMenuImage()}'/>"; $html .= "<img src='{$child->getMenuImage()}'/>";
$html .= "</div>"; $html .= "</div>";
} }
......
...@@ -40,6 +40,12 @@ class Columns extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource ...@@ -40,6 +40,12 @@ class Columns extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
['value' => '10', 'label' => '10-columns'], ['value' => '10', 'label' => '10-columns'],
['value' => '11', 'label' => '11-columns'], ['value' => '11', 'label' => '11-columns'],
['value' => '12', 'label' => '12-columns'], ['value' => '12', 'label' => '12-columns'],
['value' => '-1', 'label' => '-1-left'],
['value' => '-2', 'label' => '-2-left'],
['value' => '-3', 'label' => '-3-left'],
['value' => '-4', 'label' => '-4-left'],
['value' => '-5', 'label' => '-5-left'],
['value' => '-6', 'label' => '-6-left'],
]; ];
} }
return $this->_optionsData; return $this->_optionsData;
......
...@@ -96,7 +96,6 @@ $_helper = $block->getData('outputHelper'); ...@@ -96,7 +96,6 @@ $_helper = $block->getData('outputHelper');
data-container="product-<?= /* @noEscape */ $viewMode ?>"> data-container="product-<?= /* @noEscape */ $viewMode ?>">
<?php <?php
$productImage = $block->getImage($_product, $imageDisplayArea); $productImage = $block->getImage($_product, $imageDisplayArea);
$baseImageUrl = $productImage->getImageUrl(); $baseImageUrl = $productImage->getImageUrl();
$allImage = $_product->getMediaGalleryImages()->getItems(); $allImage = $_product->getMediaGalleryImages()->getItems();
$hoverImg = ''; $hoverImg = '';
...@@ -106,21 +105,15 @@ $_helper = $block->getData('outputHelper'); ...@@ -106,21 +105,15 @@ $_helper = $block->getData('outputHelper');
break; break;
} }
} }
if ($pos != null) { if ($pos != null) {
$position = 'left:' . $productImage->getWidth() . 'px;' $position = 'left:' . $productImage->getWidth() . 'px;' . 'top:' . $productImage->getHeight() . 'px;';
. 'top:' . $productImage->getHeight() . 'px;';
} }
?> ?>
<?php // Product Image ?> <?php // Product Image ?>
<a href="<?= $escaper->escapeUrl($_product->getProductUrl()) ?>" <a href="<?= $escaper->escapeUrl($_product->getProductUrl()) ?>"
class="product photo product-item-photo" class="product photo product-item-photo"
tabindex="-1"> tabindex="-1">
<?php <?= $productImage->toHtml() ?>
$productImageRaw = $imageHelper->init($_product, $imageDisplayArea)->setImageFile($productImage->getFile())->resize($productImage->getWidth(),$productImage->getHeight())->getUrl();
?>
<img class="product-image-photo" style="background-color: #F0F0F0;" src="<?= $productImageRaw ?>" loading="lazy" width="<?= $productImage->getWidth() ?>px" height="<?= $productImage->getHeight() ?>px" />
<?php if ($hoverImg): ?> <?php if ($hoverImg): ?>
<img class="hoverImg" width="<?= $productImage->getWidth() ?>px" height="<?= $productImage->getHeight() ?>px" src="<?= $hoverImg ?>" loading="lazy" /> <img class="hoverImg" width="<?= $productImage->getWidth() ?>px" height="<?= $productImage->getHeight() ?>px" src="<?= $hoverImg ?>" loading="lazy" />
<?php endif; ?> <?php endif; ?>
......
...@@ -35,7 +35,7 @@ $mainImageData = $mainImage ? ...@@ -35,7 +35,7 @@ $mainImageData = $mainImage ?
<img <img
alt="main product photo" alt="main product photo"
class="gallery-placeholder__image" class="gallery-placeholder__image"
data-src=="<?= /* @noEscape */ $mainImageData ?>" src=="<?= /* @noEscape */ $mainImageData ?>"
/> />
</div> </div>
......
...@@ -30,13 +30,4 @@ $logoHeight = $logoSizeResolver !== null && $logoSizeResolver->getHeight() ...@@ -30,13 +30,4 @@ $logoHeight = $logoSizeResolver !== null && $logoSizeResolver->getHeight()
alt="<?= $block->escapeHtmlAttr($block->getLogoAlt()) ?>" alt="<?= $block->escapeHtmlAttr($block->getLogoAlt()) ?>"
<?= $logoWidth ? 'width="' . $block->escapeHtmlAttr($logoWidth) . '"' : '' ?> <?= $logoWidth ? 'width="' . $block->escapeHtmlAttr($logoWidth) . '"' : '' ?>
<?= $logoHeight ? 'height="' . $block->escapeHtmlAttr($logoHeight) . '"' : '' ?> /> <?= $logoHeight ? 'height="' . $block->escapeHtmlAttr($logoHeight) . '"' : '' ?> />
<?php if ($block->getRequest()->getModuleName() == "checkout") { ?>
<span class="secure-span">
<span class="cut-span" >
/
</span>
<img class="logo-secure" src="/media/wysiwyg/logo-secure.png" />
<span class="cut-font"><?= __('SECURE CHECKOUT') ?></span>
</span>
<?php } ?>
</a> </a>
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