New answers tagged

0

/** * Prepare and return product collection * * @return \Magento\Catalog\Model\ResourceModel\Product\Collection */ public function createCollection() { /** @var $collection \Magento\Catalog\Model\ResourceModel\Product\Collection */ $myBlock = \Magento\Framework\App\ObjectManager::getInstance()->get('AntonStudio\StockUpdate\Block\...


1

I had a similar problem after upgrading to 2.3.6. One of my theme layout files referred to the Magento_Search::form.mini.phtml template without the configProvider argument. adding the configProvider argument like this solved the issue: <block class="Magento\Framework\View\Element\Template" name="top.search" as="topSearch" ...


0

Suggestion: You can solve your issue if you'll apply this method Add custom.phtml template file in catalog_product_view.xml Now in custom.phtml you can use if else condition. Add design both layout according to condition If product id is ( show your custom layout ) else (default).


0

You can do this way: In your controller: //\Magento\Framework\View\Result\PageFactory $pageFactory $resultPage = $this->resultPageFactory->create(); // your.block.name is from your layout $block = $resultPage->getLayout()->getBlock('your.block.name'); $block->setData('my_key', $data); and now in template: $data = $block->getData("...


0

I did in this way: <referenceBlock name="header.container"> <container name="header-main-wrapper" htmlTag="div" htmlClass="header-main-wrapper" /> </referenceBlock> <move element="header-wrapper" destination="header-main-wrapper" before="-" />


0

For Magento 2.4 you shoud in phtml template use $escaper->escapeHtml(...) instead of $block->escapeHtml(...). Full doc is available here: https://devdocs.magento.com/guides/v2.4/extension-dev-guide/xss-protection.html#output-processing


0

Add this empty block to container. <block class="Magento\Framework\View\Element\Text" name="empty-block"> <action method="setText"> <argument name="text" xsi:type="string"><![CDATA[&nbsp;]]></argument> </action> </block>


1

define same observer into below event. <event name="controller_action_predispatch_catalog_product_view"> <observer name="send_data2" instance="Vendorename\Modulename\Observer\Yourfilename" /> </event> <event name="checkout_cart_product_add_after"> <observer name=&...


1

Try this code default.xml <?xml version="1.0"?> <!-- /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <page layout="3columns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/...


Top 50 recent answers are included