2

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

1
  • Hello @Matus, did my solution work ? if yes you can tick left check as accepted solution :)
    – Pawan
    Jan 21, 2019 at 3:55

1 Answer 1

2

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:

enter image description here

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

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.