Skip to content

How to display modal popup when event is triggered

I already try this : public function execute(Observer $observer) { $layout = ‘<referenceContainer name=”main”> <block class=”CMBlockModalOverlay” template=”C_M::modal_overlay.phtml”/> </referenceContainer>’; $observer->getLayout()->getUpdate()->addUpdate($layout); $observer->generateXml(); }

Magento 2.4.6. Can’t display Layout in the adminpage

For some reason on a new page I created on the admin, I can’t pass text to Body. Is there any way to suggest what I’m missing? My code: appcodeDevRestApietcadminhtmlmenu.xml <?xml version=”1.0″ encoding=”UTF-8″?> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:module:Magento_Backend:etc/menu.xsd”> <menu> <add id=”Dev_RestApi::dev_module” title=”Dev… Read More »Magento 2.4.6. Can’t display Layout in the adminpage

I Want to validate condition rule on category page products in magento 2

here is my Code public function checkCondition() { // $PrId = $this->_registry->registry(‘current_product’); // $prdId = $PrId->getId(); $categoryId = $this->getRequest()->getParam(‘id’); $ruleColl = $this->customConditionModel->create()->getCollection(); foreach ($ruleColl as $ruleKey => $ruleVal) { $prdData = $this->categoryFactory->create()->load($categoryId); $Data[] = $ruleVal->getConditions()->getName(); } $data = isset($Data); if($Data… Read More »I Want to validate condition rule on category page products in magento 2