How to add Advanced Search form in Pages on homepage in Magento 2?
-
15-02-2021 - |
Pergunta
I am trying to add advanced search form as a block in Pages, but the following code is not working?
{{block class="Magento\Framework\View\Element\Template" template="Magento_CatalogSearch::advanced/form.phtml"}}
Thanks
Solução
You need to change block class for Advance form.
It should be:
{{block class="Magento\CatalogSearch\Block\Advanced\Form" template="Magento_CatalogSearch::advanced/form.phtml"}}
on each phtml
, block class is defined like:
If you need to customize phtml
, copy it from:
vendor/magento/module-catalog-search/view/frontend/templates/advanced/form.phtml
to
app/design/frontend/{Package}/{theme}/Magento_CatalogSearch/templates/advanced/form.phtml
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange