lsonkar
lsonkar
Untitled
14 posts
Don't wanna be here? Send us removal request.
lsonkar · 3 years ago
Text
Magento2 How To Use Custom JQuery Plugin
Magento2 How To Use Custom JQuery Plugin
Magento 2 comes with some good javascript libraries like knockoutJS, requireJS, jQuery. There are many benefits of using Require JS since we can can define which dependency to load on which page. Also there is no need to include js in head, we can include js in body that makes the load time of the a page more faster. Here we are going learn about how to include custom jQuery plugin using require…
Tumblr media
View On WordPress
0 notes
lsonkar · 3 years ago
Text
Magento2 MySql Joins With Collection
Magento2 MySql Joins With Collection
In this tutorial, we will learn about Magento2 MySql join with collection queries, lets have a look in details. Assume a custom table with having few fields. Column Type Comment entity_id int(11) Auto Increment primary key product_id int(11) product id order_id int(11) order id customer_id int(11) customer id test_data text In the above table ‘magemeta_test’, suppose we are saving product id,…
Tumblr media
View On WordPress
0 notes
lsonkar · 3 years ago
Text
Magento 2 How to Get Module Directory Path
Magento 2 How to Get Module Directory Path
In this article, we will see here how we can get the path of any installed modules. Also the path of some folders related to the module such as etc, controller folders. To get the paths, we need to take the help of \Magento\Framework\Module\Dir class as shown below: <?php namespace Magemeta\ModuleName\Controller\Index; use Magento\Framework\App\Action\Action; use…
View On WordPress
0 notes
lsonkar · 3 years ago
Text
Magento 2 How to get orders list by customer id in Graphql
Magento 2 How to get orders list by customer id in Graphql
Using Graphql, we can fetch the order list of a specific registered customer by customer id. We need to create a resolver model and write our custom logic to fetch all the customer order list. We will display all the orders of a customer in the response to the query. Step 1: Lets start by creating the registration.php and module.xml file to define our module. We will use the package name as…
View On WordPress
0 notes
lsonkar · 3 years ago
Text
Magento 2 Add a new weight unit
Magento 2 Add a new weight unit
In Magento 2 development, if you are trying to add a weight unit in weight drop down on locale options in admin store configuration, we can use the following code snippet. Let’s assume the weight unit as Grams which we want to add as a new weight unit. Here to achieve goal, we need to override the Magento core file on path Path:…
Tumblr media
View On WordPress
0 notes
lsonkar · 3 years ago
Text
Magento 2 Create a Custom REST API for Bulk product update.
Magento 2 Create a Custom REST API for Bulk product update.
Magento core provides lots of REST APIs for different entities like Product, Order, Customer and others. By default, Magento doesn’t provide bulk product update API. We need to call the REST API for each item and loop over it where it updates only a single product at one time. In this tutorial , we will create a custom REST API for bulk product update. For bulk product update by Magento 2 Rest…
Tumblr media
View On WordPress
0 notes
lsonkar · 4 years ago
Text
Magento 2 Modify/Update Existing Validation Message Text
Magento 2 Modify/Update Existing Validation Message Text
In Magento 2, sometimes we have a requirement to customize or update existing message text given. So this is really simple in Magento 2 as we have to only do the following for that. Let’s say there is a custom form where we have to apply this custom validation message text, so there we have to edit existing message by using following code snippet: Standard…
Tumblr media
View On WordPress
0 notes
lsonkar · 4 years ago
Text
Magento 2 How To Create Custom Validation Rule/Message
Magento 2 How To Create Custom Validation Rule/Message
In Magento 2, custom validation rules can be added with the use of Javascript mixin by creating it for “mage/validation” module. So lets see further how we can create a custom validation rule. We have to follow these steps to create custom rule: Path: Vendor/ModuleName/view/frontend/web/js/custom-validation-rule-mixin.js define(['jquery'], function($) { 'use strict'; return function()…
Tumblr media
View On WordPress
0 notes
lsonkar · 4 years ago
Text
Magento 2 Sections
In Magento 2, we have a piece of customer data grouped together which we call it as a section. Every Magento 2 section is represented by the key which is used to access and manage the data itself where every key will be a section. Lets create a section via following code snippet. There are following steps to create sections: Step 1: Create an xml file in etc/frontend/di.xml file as shown…
Tumblr media
View On WordPress
0 notes
lsonkar · 4 years ago
Text
What is Python?
Python is a general purpose interpreted, interactive, object-oriented and high-level programming language. It was created by Guido van Rossum during 1985- 1990. Like Perl, Python source code is also available under the GNU General Public License (GPL). Why to learn Python? Python is a high-level, interpreted, interactive and object-oriented scripting language. Python is designed to be highly…
Tumblr media
View On WordPress
1 note · View note
lsonkar · 4 years ago
Text
Magento 2 How to Update Product Using REST API?
Magento 2 How to Update Product Using REST API?
In Magento2, we can update the existing product using REST API call. Lets have a look how we can update product by using a request URL to perform update action. To update a product, we usually call PUT method which is an action type. Action Type: PUT Request URL: <base_website_url>/rest/V1/products/<sku> We need to replace <base_website_url> and <sku> with actual website URL and product sku…
Tumblr media
View On WordPress
0 notes
lsonkar · 4 years ago
Text
Magento 2 How to Create Admin Token Rest API Programmatically?
In Magento 2, sometimes we have a requirement to generate admin token using REST API call. The token we generate using the REST API is an access token which is used for synchronization between Magento and another third-party platform. Without generating an access token, we will not be able to communicate with Magento 2. To generate an access token, we can use the following code snippet where we…
Tumblr media
View On WordPress
0 notes
lsonkar · 4 years ago
Text
Magento 2 How to Convert Order to Invoice Programmatically
In Magento2, we have the order object by using which we can convert the order to invoice programmatically using following code snippet. <?php namespace Magemeta\Invoice\Model; use Magento\Sales\Model\Convert\Order; class OrderToInvoice { /** * @var Order */ private $orderToInvoice; public function __construct( Order $orderToInvoice ) { $this->orderToInvoice = $orderToInvoice; } /** * convert…
Tumblr media
View On WordPress
0 notes
lsonkar · 4 years ago
Text
Magento 2 Display a Modified Collection in Grid Using Ui Component
Magento 2 Display a Modified Collection in Grid Using Ui Component
In Magento 2, if there is any development requirement to add filters to our collection and displaying our admin grid using ui_component, you need to follow the given steps provided in below code snippet: Lets say we need to display the products whose price is greater than 200. We need to add below code in directory Magemeta/Uicomponent/view/adminhtml/ui_component/test.xml <dataSource…
Tumblr media
View On WordPress
1 note · View note