Hook Prestashop定制挂钩不';t秀
我按照PrestaShop文档的说明创建了一个自定义钩子,经过几次尝试后,我仍然无法将其显示在前面。它显示在后面和位置页面上,但有什么我做得不对的吗? 钩子 注册Hook Prestashop定制挂钩不';t秀,hook,prestashop-1.7,prestashop-modules,Hook,Prestashop 1.7,Prestashop Modules,我按照PrestaShop文档的说明创建了一个自定义钩子,经过几次尝试后,我仍然无法将其显示在前面。它显示在后面和位置页面上,但有什么我做得不对的吗? 钩子 注册 { if (!parent::install() || !$this->registerHook('displayProductsListBottom') ) { return false; } return
{
if (!parent::install()
|| !$this->registerHook('displayProductsListBottom')
) {
return false;
}
return true;
}
theme.yml
模板:
<div id="js-product-list">
{*<div class="products">*}
{foreach from=$listing.products item="product"}
{block name='product_miniature'}
{include file='catalog/_partials/miniatures/product.tpl' product=$product}
{/block}
{/foreach}
{*</div>*}
{block name='pagination'}
{include file='_partials/pagination.tpl' pagination=$listing.pagination}
{/block}
{hook h='displayProductsListBottom' mod='ps_module_textbanner'}
<div class="visible--mobile text-right up">
<a href="#header" class="btn btn-secondary">
{l s='Back to top' d='Shop.Theme.Actions'}
<i class="material-icons"></i>
</a>
</div>
</div>
{**}
{foreach from=$listing.products item=“product”}
{block name='product_minimal'}
{include file='catalog/_partials/minimatures/product.tpl'product=$product}
{/block}
{/foreach}
{**}
{block name='pagination'}
{include file=''_partials/pagination.tpl'pagination=$listing.pagination}
{/block}
{hook h='displayProductsListBottom'mod='ps\u module\u textbanner'}
您犯了一个小错误:)
公共函数显示ProductsListBottom($params)
应该是:
公共函数hookDisplayProductsListBottom($params)
非常感谢!!!这听起来可能很傻,但我看不出是什么。
configuration:
PS_IMAGE_QUALITY: png
modules:
to_enable:
- ps_linklist
to_disable:
- ps_searchbar
hooks:
custom_hooks:
name: displayProductsListBottom
title: displayProductsListBottom
description: Adds some content to products list
modules_to_hook:...
<div id="js-product-list">
{*<div class="products">*}
{foreach from=$listing.products item="product"}
{block name='product_miniature'}
{include file='catalog/_partials/miniatures/product.tpl' product=$product}
{/block}
{/foreach}
{*</div>*}
{block name='pagination'}
{include file='_partials/pagination.tpl' pagination=$listing.pagination}
{/block}
{hook h='displayProductsListBottom' mod='ps_module_textbanner'}
<div class="visible--mobile text-right up">
<a href="#header" class="btn btn-secondary">
{l s='Back to top' d='Shop.Theme.Actions'}
<i class="material-icons"></i>
</a>
</div>
</div>