Skip to content

magento2.4

Auto Added by WPeMatico

Magento 2 render custom template same as Magento_CatalogWidget::product/widget/content/grid.phtml by from ajax controller

I’m trying to render products the same as Magento_CatalogWidget::product/widget/content/grid.phtml displaying. I have created a custom ajax controller. $productCollection->addAttributeToSelect(‘*’); $productCollection->setPageSize(10); $productCollection->load(); $block = $layout->createBlock(‘VendorModuleBlockProductProductsList’)->setTemplate(‘Vendor_Module::product/widget/content/grid.phtml’) ->setProductCollection($productCollection); $html = $block->toHtml(); $result = $this->resultFactory->create(MagentoFrameworkControllerResultFactory::TYPE_RAW); $result->setContents($html); return $result; In Ajax response, I get the below… Read More »Magento 2 render custom template same as Magento_CatalogWidget::product/widget/content/grid.phtml by from ajax controller

Magento246:Product is still visilble for non-logged in customers after setting category permission to logged in user only?

I created a test category called Test added a test product and set category permission to Logged in user only. so the category and product shouldn’t be visible to non-logged-in customers. but when I use Search product it shows in… Read More »Magento246:Product is still visilble for non-logged in customers after setting category permission to logged in user only?