We use cookies to make your experience better. To comply with the new e-Privacy directive, we need to ask for your consent to set the cookies. Learn more.
Magento 2
-
How to fix 301/302 redirect in Magento 2 programmatically
<p>If you have an unexpected 301 or 302 redirects in Magento 2, you can easily find it by editing the following files:</p> <pre>/vendor/magento/framework/HTTP/PhpEnvironment/<strong>Response.php</strong> /var/www/html/m2_35ee/vendor/magento/framework/Controller/Result/<strong>Redirect.ph</strong></pre& -
How to Create Database Tables in Magento 2
<p>To create a database table in Magento 2, you need to create a file in the module folder:</p> <p><strong>Directory</strong></p> <pre>app/code/VendorName/ModuleName/Setup/InstallSchema.php</pre> <p><strong>Content for this file</strong></p> <pre><?php<br> -
How to Add EAV Attribute in Magento 2 programmatically
<h2 class="h2 font-weight-medium">How to Add EAV Attribute in Magento 2</h2> <h3 id="overview-of-magento-2-eav-attribute">Overview of Magento 2 EAV attribute </h3> <p>Your Models will still extend <code class="language-plaintext highlighter-rouge">\Magento\Framework\Model\AbstractModel</ -
How to call children in Magento 2 template knockout
<h2 id="overview-of-calling-children-in-magento-2-template-knockout">Overview of calling children in Magento 2 template knockout</h2> <h3>Create two children: <code class="language-plaintext highlighter-rouge">child_a</code> and <code class="language-plaintext highlighter-rouge"> -
How to Create a Custom Log File in Magento 2
<h2>Create a basic Magento 2 module</h2> <h3>Create Registration.php</h3> <p><strong>Directory</strong></p> <p>VendorName\ModuleName\registration.php</p> <p><strong>Content for this file</strong></p> <pre><?php<br>\Magento\Framework\Component -
Magento 2 Virtual Type programatically
<h2 id="creating-virtualtype-in-magento-2">Creating VirtualType in Magento 2</h2> <p>The purpose to create the virtual type is to create the sub-class for the existing class. Like</p> <pre class="highlight"><code><?php class OurVirtualTypeName extends \VendorName\ModuleName\Model\Virtualtype { }</ -
Disable a Payment Method Programmatically in Magento 2
<h3>To disable a payment method</h3> <h3 id="step-1">Edit config.xml file</h3> <p>To disable the payment method, open the config.xml file and add the following code:</p> <pre class="highlight"><code><global> ... <events> & -
Create Payment Method In Magento 2
<h3 id="step-1-create-payment-method-module-working-on-magento-20x">Create payment method module</h3> <p><strong>Create registration.php</strong></p> <p><strong>Directory</strong></p> <p>app/code/VendorName/PaymentModule/registration.php</p> <p><strong>Content -
Magento 2 Create Shipping Method
<h3 id="step-1-declare-a-shipping-module">Declare a Shipping module</h3> <p>Create a <strong>ModuleShipping </strong>in app/code/VendorName/ModuleShipping</p> <p><strong>Create registration.php</strong></p> <p>app/code/VendorName/ModuleShipping/registration.php</p> <p> -
Magento 2 Add, Edit Or Delete Action
<p>There are three steps to add edit or delete action:</p> <h3>Step1</h3> <p>This file is responsible for the UI grid of the product list in the backend and the action inside this file.</p> <p>vendor/magento/module-catalog/view/adminhtml/ui_component/product_listing.xml</p> <pre class="