How to add custom select box in window.checkoutConfig on Checkout
Sometimes you need a custom variable add-in window.checkoutConfig dynamically and display on the checkout page according to requirement, follow steps to add custom select box in window.checkoutConfig on Checkout. Step 1 : Create di.xml file and add below code File : Vendor/Module/etc/frontend/di.xml <?xml version=”1.0″?> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:ObjectManager/etc/config.xsd”> <type name=”Magento\Checkout\Model\DefaultConfigProvider”> <plugin name=”CustomCheckoutModelDefaultConfigProvider” type=”Vendor\Module\Plugin\Checkout\Model\DefaultConfigProvider” sortOrder=”100″/> </type> </config> […]
Request validation failed for action in Magento 2
Today in this post we will found a solution for Request validation failed for action issue in Magento. Sometime custom controller redirect to dashbord in magento admin panel There are below method to solve this kind of issue. Sulution 1. Add below in your claass use Magento\Framework\App\CsrfAwareActionInterface; use Magento\Framework\App\RequestInterface; use Magento\Framework\App\Request\InvalidRequestException; and implements CsrfAwareActionInterface class […]
Customer login programmatically in magento 2
Login programmatically in Magento 2 . You required only Customer id or Customer email to logged-in customer programmatically without going to the login page. Customer id or customer email require to load customer. You need to first get Customer object using CustomerFactory . Use Customer Object to customer session with setCustomerDataAsLoggedIn function. This method also […]
Magento 2 maintenance mode
Magento provides a maintenance mode, it’s used when taking database backup and others We can apply maintenance mode using command-line interface in this case connect SSH and go to Magento root dir. When uploading something on a live website then need to enable maintenance mode Maintenance mode enable command: bin/magento maintenance:enable Maintenance mode enable white […]
How to reset Customer Password from Database in Magento 2
Magento 2 update customer password using the database:- Run/execute below query in database SET @email=’[email protected]’, @passwd=’asd123′, @salt=MD5(RAND()); UPDATE customer_entity SET password_hash = CONCAT(SHA2(CONCAT(@salt, @passwd), 256), ‘:’, @salt, ‘:1’) WHERE email = @email; Magento 2 update admin password using database:- Run/execute below query in database SET @salt = MD5(UNIX_TIMESTAMP()); UPDATE admin_user SET password = CONCAT(SHA2(CONCAT(@salt, ‘admin@1234#’), […]
How to get database detail in Magento 2
Today, I’m sharing to you the “How to edit Magento 2 Database Configuration file” tutorial. When installing or changing hosting for your Magento store, editing database configuration file is really important Go to your store core folder and open the env.php file under the app/etc folder. Find the next code, where database_name is actual database […]
Add Recaptcha in Custom From Magento 2.4
This post is related to add Google Recaptcha to Custom Form in Magento 2.4.X Module Name: Integerbyte_MyRecaptcha Files List: app/code/Integerbyte/MyRecaptcha/registration.php app/code/Integerbyte/MyRecaptcha/etc/module.xml app/code/Integerbyte/MyRecaptcha/etc/adminhtml/system.xml app/code/Integerbyte/MyRecaptcha/etc/config.xml app/code/Integerbyte/MyRecaptcha/etc/frontend/routes.xml app/code/Integerbyte/MyRecaptcha/etc/frontend/events.xml app/code/Integerbyte/MyRecaptcha/Observer/RecapchaObserver.php app/code/Integerbyte/MyRecaptcha/Controller/Index/Index.php app/code/Integerbyte/MyRecaptcha/Controller/Index/Save.php app/code/Integerbyte/MyRecaptcha/view/frontend/layout/myrecaptcha_index_index.xml app/code/Integerbyte/MyRecaptcha/view/frontend/templates/form.phtml 1. Module Registarion file app/code/Integerbyte/MyRecaptcha/registration.php <?php \Magento\Framework\Component\ComponentRegistrar::register( \Magento\Framework\Component\ComponentRegistrar::MODULE, ‘Integerbyte_MyRecaptcha’, __DIR__ ); 2. Create module.xml file app/code/Integerbyte/MyRecaptcha/etc/module.xml <?xml version=”1.0″?> <config xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:Module/etc/module.xsd”> <module name=”Integerbyte_MyRecaptcha” setup_version=”1.0.0″> </module> […]
Magento 2 convert an array to a collection object
Today we will let you know How to convert an array to a collection object in Magento For example, we have an array of data fetched from the database. And we want to merge it with the Magento collection object or want to provide the data as the collection The collection class is Magento\Framework\Data\Collection, but […]
How to get controller, module, action and router name in Magento 2
Today we will show how we can get the name of the current route name, module name, controller name, action name, and route name in Magento 2. You can also check current pages like catalog_category_view, catalog_product_view, etc. HTTP request use to get this type current name, Please have a look at the below code and […]
How to check current page in Magento 2
Here We will know, what the current page, like CMS page or category view page or product view page or Homepage in Magento 2 Sometimes we need to check the current page so write or add conditions according to logic. So the first step, to check the current page is to write the following script […]
Open popup on grid row click in Magento 2
When you need to open popup on grid button, Follow the steps given below to add a view button in the admin grid: 1. Add component in column in grid layout file and add js and class file path File path: app/code/IntegerByte/Popup/view/base/web/js/grid/columns/email.jsFile path : app/code/IntegerByte/Popup/Ui/Component/Listing/Column/Email.php <column name=”email” class=”IntegerByte\Popup\Ui\Component\Listing\Column\Email”> <argument name=”data” xsi:type=”array”> <item name=”config” xsi:type=”array”> <item […]
How to create a log in Magento 2
Add a log in Magento 2, We will learn to create a custom log file programmatically and log data into the custom log file. If indeed your only concern is to log to a different file, there is a slightly easier way. Especially if you want to incorporate that to multiple modules or if you […]