Commit 899eb047 by 王东红

Merge branch 'master' of http://47.99.244.21:9999/root/joshine

parents 5107ed78 0ad24e64
...@@ -199,6 +199,10 @@ ...@@ -199,6 +199,10 @@
margin: 10px; margin: 10px;
font-size: small; font-size: small;
} }
.joshine-desction #description{
max-height: 540px;
overflow: auto;
}
</style> </style>
<?php <?php
$short_description = $this->helper(Magento\Catalog\Helper\Output::class)->productAttribute( $short_description = $this->helper(Magento\Catalog\Helper\Output::class)->productAttribute(
...@@ -206,11 +210,6 @@ $short_description = $this->helper(Magento\Catalog\Helper\Output::class)->produc ...@@ -206,11 +210,6 @@ $short_description = $this->helper(Magento\Catalog\Helper\Output::class)->produc
$block->getProduct()->getShortDescription(), $block->getProduct()->getShortDescription(),
'short_description' 'short_description'
); );
$description = $this->helper(Magento\Catalog\Helper\Output::class)->productAttribute(
$block->getProduct(),
$block->getProduct()->getDescription(),
'description'
);
?> ?>
<div class="joshine-desction"> <div class="joshine-desction">
<div id="accordion" data-mage-init='{ <div id="accordion" data-mage-init='{
...@@ -226,9 +225,9 @@ $description = $this->helper(Magento\Catalog\Helper\Output::class)->productAttri ...@@ -226,9 +225,9 @@ $description = $this->helper(Magento\Catalog\Helper\Output::class)->productAttri
<a class="desction-right info-desc" href="#">+</a> <a class="desction-right info-desc" href="#">+</a>
</div> </div>
</div> </div>
<div data-role="content"> <div data-role="content" id="description">
<div class="desction-info"> <div class="desction-info">
<?php echo $short_description."<br />".$description;?> <?php echo $short_description;?>
</div> </div>
</div> </div>
</div> </div>
...@@ -238,7 +237,12 @@ $description = $this->helper(Magento\Catalog\Helper\Output::class)->productAttri ...@@ -238,7 +237,12 @@ $description = $this->helper(Magento\Catalog\Helper\Output::class)->productAttri
'jquery' 'jquery'
], function ($) { ], function ($) {
$(".info-desc").click(function () { $(".info-desc").click(function () {
$(".desction-right").html("-"); var number = $(".desction-right").html();
if (number == "+"){
$(".desction-right").html("-");
}else{
$(".desction-right").html("+");
}
}) })
}); });
</script> </script>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<?php $buttonTitle = __('ADD TO CART'); ?> <?php $buttonTitle = __('ADD TO CART'); ?>
<?php if ($_product->isSaleable()) :?> <?php if ($_product->isSaleable()) :?>
<div class="box-tocart"> <div class="box-tocart">
<div id="wishlist"></div>
<div class="fieldset"> <div class="fieldset">
<?php if ($block->shouldRenderQuantity()) :?> <?php if ($block->shouldRenderQuantity()) :?>
<div class="field qty"> <div class="field qty">
...@@ -89,6 +89,7 @@ ...@@ -89,6 +89,7 @@
</button> </button>
<?= $block->getChildHtml('', true) ?> <?= $block->getChildHtml('', true) ?>
</div> </div>
<div id="wishlist"></div>
</div> </div>
</div> </div>
<?php endif; ?> <?php endif; ?>
......
...@@ -197,6 +197,8 @@ $thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small'); ...@@ -197,6 +197,8 @@ $thumbSizes = $responsiveImageHelper->getSizes('product_page_image_small');
], function ($) { ], function ($) {
$(".thumbnails > a").removeClass("active"); $(".thumbnails > a").removeClass("active");
$(".thumbnails > a:first").addClass("active"); $(".thumbnails > a:first").addClass("active");
var main_img = $(".thumbnails > a:first").attr("name");
$(".main-image").attr("src",main_img);
$(".thumbnails > a").mouseover(function (s) { $(".thumbnails > a").mouseover(function (s) {
var main_img = $(this).attr("name"); var main_img = $(this).attr("name");
......
...@@ -55,156 +55,42 @@ ...@@ -55,156 +55,42 @@
</div> </div>
</div> </div>
<?php
$type = 'widget-new-grid';
$mode = 'grid';
$image = 'new_products_content_widget_grid';
?>
<div class="block widget block-new-products <?= /* @noEscape */ $mode ?>">
<div class="block-title">
<strong role="heading" aria-level="2" >NEW ARRIVALS</strong>
</div>
<div class="block-content home-new-product">
<?= /* @noEscape */ '<!-- ' . $image . '-->' ?>
<div class="products-<?= /* @noEscape */ $mode ?> <?= /* @noEscape */ $mode ?>">
<ol class="product-items <?= /* @noEscape */ $type ?>">
<?php
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
$news_ids = explode(',',"1315,1178,1125,1002");
//$news_ids = explode(',',"1,2");
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$pr = $objectManager->create('Magento\Catalog\Model\ProductRepository');
$blocklist = $objectManager->get('\Magento\Catalog\Block\Product\ListProduct');
$imageHelper = $objectManager->get( 'Magento\Catalog\Helper\Image' );
foreach($news_ids as $pid): <div class="flash_sale">
$product = $pr->getById($pid); <a href="/newarrivals.html"><p class="flashsale-title">NEW ARRIVALS</p> </a>
if(!$product) continue; <div class="flash-sale-wpt row" style="background: linear-gradient(to right, #ffffff, #ffffff);" >
$productImage = $imageHelper->init( $product, 'category_page_list' ) ->getUrl(); <div class="flash-sale-inner">
?> <?php
<li class="product-item"> $templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
<div class="product-item-info"> $ids = explode(',',"180,1756,1878,1997,2246,1076");
<a href="<?php echo $product->getProductUrl()?>" //$ids = explode(',',"1,2");
class="product-item-photo">
<?php //$block->getImage($_item, $image)->toHtml() ?> $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
<img src="<?php echo $productImage;?>" /></a> $pr = $objectManager->create('Magento\Catalog\Model\ProductRepository');
</a> $blocklist = $objectManager->get('\Magento\Catalog\Block\Product\ListProduct');
<div class="product-item-details"> $imageHelper = $objectManager->get( 'Magento\Catalog\Helper\Image' );
<strong class="product-item-name">
<a title="<?= $product->getName() ?>" foreach($ids as $pid):
href="<?php echo $product->getProductUrl()?>" $product = $pr->getById($pid);
class="product-item-link"> if(!$product) continue;
<?= $product->getName() ?> $productImage = $imageHelper->init( $product, 'category_page_list' ) ->getUrl();
</a> ?>
</strong> <div class="flash-sale-item">
<?= $blocklist->getReviewsSummaryHtml($product, $templateType) ?> <a href="<?php echo $product->getProductUrl()?>" >
<?= /* @noEscape */ $blocklist->getProductPrice($product) ?> <img src="<?php echo $productImage;?>" /></a>
</div> <div class="flash-sale-info">
</div> <a class="product-name" href="<?php echo $product->getProductUrl()?>"><?php echo $product->getName();?></a>
</li> <?= $blocklist->getReviewsSummaryHtml($product, $templateType) ?>
<?php endforeach ?> <?= /* @noEscape */ $blocklist->getProductPrice($product) ?>
</ol> </div>
</div>
<?php
endforeach;
?>
</div> </div>
</div> </div>
</div> </div>
<style>
.home-new-product{
width: 80%;
display: contents;
}
.block-title {
text-align: center;
font-size: x-large;
}
.actions-secondary a{
color: #000;
}
.product-item-name .product-item-link{
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
cursor: pointer;
width: 100%;
display: inline-block;
color: #222222;
}
.block-title > sto{
background: #fff;
font-size: 24px;
font-weight: bold;
color: #000000;
margin: 0px;
padding: 40px;
text-align: center;
}
.products-grid .product-items {
display: flex;
justify-content: space-around;
align-items: flex-end;
}
span.price-wrapper .price {
font-size: larger;
font-weight: 600;
}
.block .block-title strong:hover {
text-decoration: underline;
}
.block .block-title strong {
background: #fff;
font-size: 24px;
font-weight: bold !important;
color: #000000;
margin: 0px;
padding: 40px;
text-align: center;
}
button.action.tocart.primary {
background: #000;
}
ol.product-items.widget-new-grid{
padding: 5px;
margin-top: 30px;
margin-bottom: 30px;
}
.block-content.home-new-product{
display: contents;
}
@media (max-width: 789px){
li.product-item {
width: 100%;
max-width: 50%;
}
.grid {
display: list-item !important;
}
ol.product-items.widget-new-grid{
margin-top: 1px;
}
.block-title{
margin-top: -30px;
}
.block.widget.block-new-products.grid{
margin-top: -100px;
}
.product-item-actions {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: flex-end;
margin-top: -30px;
}
.block .block-title strong {
padding: 0px;
}
}
</style>
<div class="flash_sale"> <div class="flash_sale">
......
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