Commit ee81fdb7 by liumengfei

Merge branch 'developer' into production

parents 3e017a0c f7a155b4
......@@ -199,19 +199,17 @@ class Topmenu extends JoshineMenu
$colStops = $this->_columnBrake($child->getChildren(), $limit);
}
if ($childLevel == 0) {
$leftMarginClass = $this->getMarginClass($child->getChildLeftMargin());
$sumMenuColumnsTotal = $child->getSubmenuColumnsTotal();
$columns = $sumMenuColumnsTotal ?? "11" ;
if (intval($columns) >= 12) {
$columns = "11";
}
if ($childLevel == 0) {
$leftMargin = $child->getChildLeftMargin();
if ($leftMargin != "0" && empty($leftMargin)) {
$leftMargin = "1";
}
$colClass = $this->getColClass($columns);
$html = "<div class=\"level{$childLevel} {$childrenWrapClass}\">";
$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)}
</ul>";
$html .= $this->appendImage($child);
......@@ -224,6 +222,30 @@ class Topmenu extends JoshineMenu
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)
{
$html = "";
......@@ -232,15 +254,13 @@ class Topmenu extends JoshineMenu
}
if ($child->getMenuImage()) {
$imageLeftMargin = $child->getImageLeftMargin();
if (empty($imageLeftMargin)) {
$imageLeftMargin = "0";
}
$marginClass = $this->getMarginClass(intval($child->getImageLeftMargin()));
$imageWidth = $child->getImageWidth();
if (empty($imageWidth)) {
$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 .= "</div>";
}
......
......@@ -40,6 +40,12 @@ class Columns extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource
['value' => '10', 'label' => '10-columns'],
['value' => '11', 'label' => '11-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;
......
......@@ -96,7 +96,6 @@ $_helper = $block->getData('outputHelper');
data-container="product-<?= /* @noEscape */ $viewMode ?>">
<?php
$productImage = $block->getImage($_product, $imageDisplayArea);
$baseImageUrl = $productImage->getImageUrl();
$allImage = $_product->getMediaGalleryImages()->getItems();
$hoverImg = '';
......@@ -106,21 +105,15 @@ $_helper = $block->getData('outputHelper');
break;
}
}
if ($pos != null) {
$position = 'left:' . $productImage->getWidth() . 'px;'
. 'top:' . $productImage->getHeight() . 'px;';
$position = 'left:' . $productImage->getWidth() . 'px;' . 'top:' . $productImage->getHeight() . 'px;';
}
?>
<?php // Product Image ?>
<a href="<?= $escaper->escapeUrl($_product->getProductUrl()) ?>"
class="product photo product-item-photo"
tabindex="-1">
<?php
$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" />
<?= $productImage->toHtml() ?>
<?php if ($hoverImg): ?>
<img class="hoverImg" width="<?= $productImage->getWidth() ?>px" height="<?= $productImage->getHeight() ?>px" src="<?= $hoverImg ?>" loading="lazy" />
<?php endif; ?>
......
......@@ -35,7 +35,7 @@ $mainImageData = $mainImage ?
<img
alt="main product photo"
class="gallery-placeholder__image"
data-src=="<?= /* @noEscape */ $mainImageData ?>"
src=="<?= /* @noEscape */ $mainImageData ?>"
/>
</div>
......
......@@ -30,13 +30,4 @@ $logoHeight = $logoSizeResolver !== null && $logoSizeResolver->getHeight()
alt="<?= $block->escapeHtmlAttr($block->getLogoAlt()) ?>"
<?= $logoWidth ? 'width="' . $block->escapeHtmlAttr($logoWidth) . '"' : '' ?>
<?= $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>
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