Categories
CMS Magento Mastering Development

How to create functional of selecting products on admin category page

I’m trying to create selecting products on category page, I make: ui_component (category_form.xml) <form xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:module:Magento_Ui:etc/ui_configuration.xsd”> <fieldset name=”select_products” sortOrder=”40″> <settings> <collapsible>true</collapsible> <label translate=”true”>Select Products</label> </settings> <container name=”select_products_container” sortOrder=”160″> <htmlContent name=”html_content”> <block name=”gallery” class=”Vendor\Module\Block\Adminhtml\Category\AddProducts”/> </htmlContent> </container> </fieldset> </form> AddProduct class: class AddProducts extends \Magento\Backend\Block\Template { /** * Block template * * @var string */ protected $_template […]

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 populate dropdown value from database with condition

I have trouble populating my select in my form. I tried to get the value from my custom database with condition but still failed. Here what I’m trying to do with my code. app/code/Testing/Basic/Controller/Adminhtml/Parts/Addrow.php <?php /** * Webkul Webpage List Controller. * @category Webkul * @package Webkul_Webpage * @author Webkul * @copyright Copyright (c) 2010-2017 […]

Categories
CMS Development Magento

Magento2: grid form fields are not display

Today I am trying to create admin grid form using ui component. But field on form doesn’t loaded It showing blank form. Admin grid created successfully. my ui_component/simpleimg_image_form.xml <form xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:module:Magento_Ui:etc/ui_configuration.xsd”> <argument name=”data” xsi:type=”array”> <item name=”js_config” xsi:type=”array”> <item name=”provider” xsi:type=”string”>simpleimg_image_form.simpleimg_image_form_data_source</item> <item name=”deps” xsi:type=”string”>simpleimg_image_form.simpleimg_image_form_data_source</item> </item> <item name=”label” xsi:type=”string” translate=”true”>Image Form</item> <!– <item name=”layout” xsi:type=”array”> <item name=”type” […]

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; […]