faonni/module-product-most-viewed

扩展显示您商店中最受查看的产品。

安装: 93

依赖: 0

建议者: 0

安全: 0

星标: 10

关注者: 4

分支: 2

公开问题: 1

类型:magento2-module

2.1.1 2017-11-24 19:55 UTC

This package is auto-updated.

Last update: 2024-08-29 04:09:11 UTC


README

扩展显示您商店中最受查看的产品。

主页

Magento2 ProductMostViewed

分类页面

Magento2 ProductMostViewed

使用Composer进行安装

  1. 进入Magento2根目录

  2. 输入以下命令来安装模块

    composer require faonni/module-product-most-viewed

    等待依赖更新。

  3. 输入以下命令来启用模块

    php bin/magento setup:upgrade
    php bin/magento setup:static-content:deploy
  4. 刷新统计信息

显示和配置

  1. 一个短代码,用于主页和其他CMS页面或CMS块。

    {{block class='Faonni\ProductMostViewed\Block\ProductList' 
    	template='Faonni_ProductMostViewed::product/list/items.phtml' 
    	title='Most Viewed Products' 
    	interval='45'
    	num_products='6'
    }}
  2. 更新所有类别的布局XML。

    <referenceBlock name="catalog.product.most.viewed">
    	<action method="setTitle">
    		<argument name="title" xsi:type="string" translate="true">Most Viewed Products of Category</argument>
    	</action>
    	<action method="setNumProducts">
    		<argument name="num_products" xsi:type="string">6</argument>
    	</action>
    	<!-- last 45 days, if 0 - all lifetime -->
    	<action method="setInterval">
    		<argument name="interval" xsi:type="string">45</argument>
    	</action>	
    </referenceBlock>