Categories
CMS Magento Mastering Development

Product grid checkbox input at sales rule form Magento 2 not working

I’m using Magento 2.3.4 and want to add product grid with checkbox as an input for sales rule form (shopping cart price rule), i follow the instruction to add product grid input from here but when I print the $_POST value the input data does not exist. Here’s my code: app/code/Becom/Freegift/Block/Adminhtml/Products/Edit/Tab/Product.php namespace Becom\Freegift\Block\Adminhtml\Products\Edit\Tab; use Magento\Backend\Block\Widget\Grid; […]

Categories
CMS Magento Mastering Development

Product grid checkbox input at sales rule form Magento 2 not working

I’m using Magento 2.3.4 and want to add product grid with checkbox as an input for sales rule form (shopping cart price rule), i follow the instruction to add product grid input from here but when I print the $_POST value the input data does not exist. Here’s my code: app/code/Becom/Freegift/Block/Adminhtml/Products/Edit/Tab/Product.php namespace Becom\Freegift\Block\Adminhtml\Products\Edit\Tab; use Magento\Backend\Block\Widget\Grid; […]

Categories
CMS Development Magento

Magento 2 – How to add logs inside module

I have added like below way. But it doesn’t work for that module use Psr\Log\LoggerInterface; /** * @var LoggerInterface */ protected $logger; protected $resultForwardFactory; public function __construct( Action\Context $context, \Magento\Framework\Registry $coreRegistry, \Magento\Framework\App\Response\Http\FileFactory $fileFactory, \Magento\Framework\Translate\InlineInterface $translateInline, \Magento\Framework\View\Result\PageFactory $resultPageFactory, \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory, \Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory, \Magento\Framework\Controller\Result\RawFactory $resultRawFactory, \Magento\Backend\Model\View\Result\ForwardFactory $resultForwardFactory, LoggerInterface $logger ) { $this->_coreRegistry = $coreRegistry; $this->_fileFactory = $fileFactory; […]