Skip to content

Category: Magento 2

Magento 2 : Admin Ajax Upload File

Here’s steps how to create custom ajax upload file in admin page create controller file 2. in your custom phtml file

Comments closed

M2 : Override/Intercept REST API POST params

ok then in your di.xml <?xml version=”1.0″ ?> <config xmlns:xsi=”” xsi:noNamespaceSchemaLocation=”urn:magento:framework:ObjectManager/etc/config.xsd”> <type name=”Magento\Webapi\Controller\Rest\Router”> <plugin disabled=”false” name=”YourModule_ModuleName_Plugin_Magento_Webapi_Controller_Rest_Router” sortOrder=”10″ type=”YourModule\ModuleName\Plugin\Magento\Webapi\Controller\Rest\Router”/> </type> </config> and then finally, use plugin …

Comments closed

[Magento 2]Install via Composer out of memory

php -d memory_limit=-1 `which composer` require msp/recaptcha:2.0.0 or php -d memory_limit=-1 /usr/local/bin/composer require msp/recaptcha:2.0.0 simple af

Comments closed

Magento2 : Custom Sql Directive

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of object manager $resource = $objectManager->get(‘Magento\Framework\App\ResourceConnection’); $connection = $resource->getConnection(); $tableName = $resource->getTableName(‘your_table_name’); //Select Data from table $sql = “Select *…

Comments closed

Magento 2 : Create Admin User From Shell

use SSH to perform this action, from your Magento root, use this command   php bin/magento admin:user:create –admin-firstname=”Admin Fistname” –admin-lastname=”Admin Lastname” –admin-user=”admin_username” –admin-password=”admin_pass” –admin-email=”[email protected]”  

Comments closed

Magento 2 : Add Customer Address Attribute

in your ‘Company/Modulename/setup/InstallData.php’ here example code <?php namespace Company\Modulename\Setup; use Magento\Framework\Setup\InstallDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; use Magento\Customer\Model\Customer; use Magento\Customer\Setup\CustomerSetupFactory; class InstallData implements InstallDataInterface { private…

Comments closed