Magento 2 : Debug cli commands
How to debug cli command in magento 2
Steps:
1) Export the key (if you are using docker, do it in container)
export XDEBUG_CONFIG='PHPSTORM'
2) Start the phpstorm Bug Debug
3) Execute the cli command
Related cards:
Magento 2 Tips: main.WARNING: Session size of 257209 exceeded allowed session max size of 256000.
This can be fixed by excuting folloing configuration.
./bin/magento config:set system/security/max_session_size_admin 512000
./bin/magento config:set system/security/max_session_size_storefront 512000
Magento 2 : How to use Javascript in Magento
Javascript in Magento 2
Magento 2 uses Require JS lib and Knockout JS lib to solve the page speed and manage the JS dependency.
As JS are loaded asynchronously in backend, it helps to increase the page speed.
The JS files can be found in f...
Magento2 : Admin Module Part 3
This section contains the edit UI components and layout xml files
Stesps :
- Form ui components
create a file kpsaddress_index_lising.xml for grid under ui_component
<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http...
Magento 2 Tips : How to get client ip
The client ip can be retrieved using
getClientIp()
method in
Magento\Framework\HTTP\PhpEnvironment\Request
class. This is very useful , when do the ip restriction in maintenance page development.
Magento 2 : Address additional attributes
In this example, you can learn how to add additional attributes for customer address
Steps
- Add additional attributes to EAV table
- Create extension attributes to link with models to save additional attributes values in databases
- Crea...
Magento 2 : Create cron with config schedule
Step 1:
Create system.xml file with configuration field.
<group id="cron" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1"
showInStore="1">
<label>MSD Cron</label>
...
How to use Mailhog in magento 2 development with docker
Mailhog is a tool to test the you application mail outgoing.
Steps to use with docker
First, install mailhog sendmail tool in your php docker container
wget https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linu...
Magento 2 : Admin Module Part 2
5.Create Model and Resource model
Address model class extends the AddressInterface and it contains the data object getters setter methods.
<?php
/**
* Address
*
* @copyright Copyright © 2021 Va...
Magento 2 : Popup
Simple popup can be generated with magento 2 popup model
First, create a phtml to load the popup message and it should be added in footer section to load in every page
If you define the phtml in default.xml file then, simply you can call it as ...
magento 2: Docker compose file
Docker compose file for magento 2.4
version: '3.3'
networks:
pwa_net:
ipam:
driver: default
config:
- subnet: 40.0.0.0/24
gateway: 40.0.0.1
services:
web-cont:
image: registry.vasan.com/mag...