Commit b2ec4fa9 by lmf

首页临时屏蔽最新产品块

parent bd5a9fb1
......@@ -260,78 +260,7 @@
</div>
<div class="flash_sale news-arrivals">
<a href="/newarrivals.html"><p class="flashsale-title">NEW ARRIVALS</p> </a>
<div class="flash-sale-wpt row" style="background: linear-gradient(to right, #ffffff, #ffffff);" >
<div class="flash-sale-inner">
<?php
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
$ids = explode(',',"180,1756,1878,1997,2246,1076");
//$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($ids as $pid):
$product = $pr->getById($pid);
if(!$product) continue;
$productImage = $imageHelper->init( $product, 'category_page_list' ) ->getUrl();
?>
<div class="flash-sale-item">
<a href="<?php echo $product->getProductUrl()?>" >
<img src="<?php echo $productImage;?>" /></a>
<div class="flash-sale-info">
<a class="product-name" href="<?php echo $product->getProductUrl()?>"><?php echo $product->getName();?></a>
<?= $blocklist->getReviewsSummaryHtml($product, $templateType) ?>
<?= /* @noEscape */ $blocklist->getProductPrice($product) ?>
</div>
</div>
<?php
endforeach;
?>
</div>
</div>
</div>
<div class="flash_sale">
<a href="/hotsale.html"><p class="flashsale-title">⚡FLASH SALE⚡</p> </a>
<div class="flash-sale-wpt row" style="background: linear-gradient(to right, #ffffff, #ffffff);" >
<div class="flash-sale-inner">
<?php
$templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
$ids = explode(',',"896,726,611,507,167,172");
//$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($ids as $pid):
$product = $pr->getById($pid);
if(!$product) continue;
$productImage = $imageHelper->init( $product, 'category_page_list' ) ->getUrl();
?>
<div class="flash-sale-item">
<a href="<?php echo $product->getProductUrl()?>" >
<img src="<?php echo $productImage;?>" /></a>
<div class="flash-sale-info">
<a class="product-name" href="<?php echo $product->getProductUrl()?>"><?php echo $product->getName();?></a>
<?= $blocklist->getReviewsSummaryHtml($product, $templateType) ?>
<?= /* @noEscape */ $blocklist->getProductPrice($product) ?>
</div>
</div>
<?php
endforeach;
?>
</div>
<div class="view-more-flashsale"><a href="/hotsale.html">View More</a></div>
</div>
</div>
<?php echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('home_category_thumnail')->toHtml();?>
......
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