-
Continue reading →: HOW TO GET CUSTOMER GROUP COLLECTION IN MAGENTO 2
In this blog, we are going to talk about how to get a customer group in Magento 2. Why? Customer groups are defined in Magento 2. Because many developers set the configuration on the customer. Like Different customers have different configurations of payment methods, shipping methods, specific offers, restricted products,…
-
Continue reading →: How to get customer data by id in Magneto 2
in this blog, we are going to how to get customer data by id using API repository and Factory Method There are two ways to get customer data that you can use. You can also get its product data through customer data. ⇒ Using API Repository to Get Customer Data:…
-
Continue reading →: Magento 2 collection attribute filter
In this blog, we will explain how to get the product collection by using a factory method into a magento 2 block file. Several types of product collection like collection, filter, sorting, etc. namespace Vendorname\Modulename\Block; class Filename extends \Magento\Framework\View\Element\Template { protected $productFactory; public function __construct( \Magento\Backend\Block\Template\Context $context, \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productFactory, array…
-
Continue reading →: How to define a redirect URL in Magento 2
Many developers require a redirect URL. So we can have created this blog so that the developer can easily understand the redirect URL. In this blog, we are going to understand how to set redirect URL in Magento 2. You can use two ways to set URL: setPath & setUrl…
-
Continue reading →: How to get product collection using a factory method in Magento 2
Get product collection using a factory method
-
Continue reading →: How to load product by SKU in Magento 2
Getting product data is a need of many developers so this blog is the best for it. In this blog, we will explain how to get product data using SKU in Magento 2. If you want to get product data by ID. Please Click Here Factory method and object manager…
-
Continue reading →: How to Load Product by ID in Magento 2
In this blog, we will explain how to get product data using ID in Magento 2. Factory method and object manager are the two different ways to lode Product data. Load Product By Id Using Factory Method : <?php namespace VenderName\Modulename\Block; class Product extends \Magento\Framework\View\Element\Template { protected $_productloader; public function…
-
Continue reading →: How to Create Custom Product Attribute Programmatically in Magento 2
In this blog, we are going to show you how to create a product attribute using the latest Declarative Schema “data patch “. A Data patch is a class that stores instructions for data modification. Using a data patch we can add custom product attributes in Magento 2 by creating…
-
Continue reading →: Magento 2 How to create table and field using db_schema.xml
In this blog, we’re going to show you how to use the db_schema.xml file to create a new database table. Once you Create file db_schema.xml in this directory app/code/VName/MName/etc. We will create a table named “table_name”. <schema xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”urn:magento:framework:Setup/Declaration/Schema/etc/schema.xsd”> <table name=”table_name”> <column xsi:type=”int” name=”id” padding=”10″ unsigned=”true” nullable=”false” comment=”Entity Id”/> <column xsi:type=”varchar”…
-
Continue reading →: Magento 2 How to Create a Custom Customer Attribute for Data Patches?
You want to add custom referral code field in use customer account page. Then, you can create field for custom customer attribute. Steps for Create a Customer Attribute for Data Patches Magento 2. (1) <Vendorname>/<Modulename>/Setup/Patch/Data/AddCustomReferralCodeAttribute.php <?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license…