diff --git a/Magento_CatalogWidget/templates/product/widget/content/grid.phtml b/Magento_CatalogWidget/templates/product/widget/content/grid.phtml new file mode 100644 index 0000000..403ccba --- /dev/null +++ b/Magento_CatalogWidget/templates/product/widget/content/grid.phtml @@ -0,0 +1,125 @@ + +getProductCollection() && $block->getProductCollection()->getSize())): ?> + getProductCollection()->getItems(); + + $showWishlist = true; + $showCompare = true; + $showCart = true; + $templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW; + $description = false; + ?> +
+ getTitle()): ?> +
+ escapeHtml(__($block->getTitle())) ?> +
+ +
+ ' ?> +
+
    + + + ' : '
  1. ' ?> +
    + + getImage($_item, $image)->toHtml() ?> + +
    + + + escapeHtml($_item->getName()) ?> + + + + getReviewsSummaryHtml($_item, $templateType, true) ?> + + + getProductPriceHtml($_item, $type) ?> + + getProductDetailsHtml($_item) ?> + + +
    +
    + +
    + isSaleable()): ?> + getAddToCartPostParams($_item); ?> +
    + + + getBlockHtml('formkey') ?> + +
    + + isAvailable()): ?> +
    escapeHtml(__('In stock')) ?>
    + +
    escapeHtml(__('Out of stock')) ?>
    + + +
    + + +
    + helper(\Magento\Wishlist\Helper\Data::class)->isAllow() && $showWishlist): ?> + + escapeHtml(__('Add to Wish List')) ?> + + + getAddToCompareUrl() && $showCompare): ?> + helper(\Magento\Catalog\Helper\Product\Compare::class);?> + + escapeHtml(__('Add to Compare')) ?> + + +
    + +
    +
    + +
    +
    + ' : '' ?> + +
+
+ getPagerHtml() ?> +
+
+ getBlockHtml('formkey')): ?> + + + diff --git a/Magento_Review/templates/helper/summary_short.phtml b/Magento_Review/templates/helper/summary_short.phtml new file mode 100644 index 0000000..6cd3e5f --- /dev/null +++ b/Magento_Review/templates/helper/summary_short.phtml @@ -0,0 +1,64 @@ +getReviewsUrl() . '#reviews'; +$urlForm = $block->getReviewsUrl() . '#review-form'; + +$displayIfEmpty = $block->getDisplayIfEmpty(); +$listPage = in_array($block->getRequest()->getFullActionName(), ['cms_index_index', 'catalogsearch_result_index', 'catalog_category_view']); + +if ($listPage) { + $displayIfEmpty = true; +} +//if ($block->getRequest()->getActionName()) + +?> +isReviewEnabled() && $block->getReviewsCount()): ?> + getRatingSummary(); ?> +
+ +
+ escapeHtml(__('Rating')) ?>: +
+ escapeHtml($rating) ?>% +
+ renderStyleAsTag( + 'width:' . $block->escapeHtmlAttr($rating) . '%', + '#rating-result_' . $block->getProduct()->getId() . ' span' + ) ?> +
+ +
+ escapeHtml($block->getReviewsCount()) ?> +  getReviewsCount() == 1) ? + $block->escapeHtml(__('Review')) : $block->escapeHtml(__('Reviews')) ?> + + +
+
+isReviewEnabled() && $displayIfEmpty): ?> +
+
+
+
+
+ + + + + escapeHtml(__('Be the first to review this product')) ?> + + +
+
+ + diff --git a/web/css/source/_extend.less b/web/css/source/_extend.less index f489547..ceab39c 100644 --- a/web/css/source/_extend.less +++ b/web/css/source/_extend.less @@ -366,7 +366,7 @@ input:-webkit-autofill:active { .product-item-actions { flex-grow: 1; //margin-top: auto; - margin-top: 15px; + margin-top: 5px; margin-bottom: 0; } .product-item-description { @@ -412,6 +412,10 @@ input:-webkit-autofill:active { box-sizing: border-box; .product-item-name { margin: 0; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + .product-item-link {} } .price-box { margin: 0 0 5px 0; @@ -434,11 +438,25 @@ input:-webkit-autofill:active { } // Summary -.product-reviews-summary { - margin-bottom: 10px; - .reviews-actions { - a { - color: @theme__color__secondary; +& when (@media-common = true) { + .product-reviews-summary { + + &.short.empty { + .rating-summary { + .rating-result { + position: relative; + height: 28px; + &:before { + opacity: 0.5; + } + } + } + } + + .reviews-actions { + a { + color: @theme__color__secondary; + } } } }