Add class or attribute in jQueryAdd class or attribute in jQuery
Hello, Reader today we discuss the add class or attribute in jQuery.Sometimes developers need to add a custom class or attribute on the element after the page load or clicked somewhere to perform functionality according to the need. 1. Add random class or attribute on the drop-down options var counterOption = 0; jQuery(“select”).each( function (){ […]
Magento2 admin login programmatically
Sometimes we need Magento2 admin login programmatically.If you forgot the password of the admin and you have a username then you create an Admin.php file and paste the below code. After creating the file put it into the website running directory like pub.Now hit the file like http://example.com/Admin.php Code of the Admin.php file <?php use […]
Add/Remove Class in Javascript
Add/Remove Class in Javascript, we will use “classList” function. When a user clicks on the element, then a class will be added to that element.Apply your logic using the newly added class, like show hide another div to attract the user. HTML code <!DOCTYPE html> <html> <head> <title></title> </head> <body> <div id=”close-container”> <button id=”my_button”> My […]
Magento2 setup with breeze
Magento2 setup with breeze, Why Breeze : Breeze module offers Magento alternative js frontend. It makes your store 3 times faster. It brings your website closer to a high Google Page Speed score. The goal of the Breeze module is to boost the default Luma theme performance via replacing all scripts with simplified versions. It […]
Detect device in jQuery
Sometime we need to detect device in jQuery to identify the screen, To add some extra or different logic according to the requirement. 5 ways to detect the mobile Devices in jQuery Solution 1:- Using navigator userAgent. if( /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) { // mobile device code } Solution 2:- Using window matchMedia method $(function() { […]
Magento 2 rest api
Today we discuss the Magento 2 rest API. API is also called web services. API stands for the Application programming interface Proccess of the prodcut add to cart usign rest API Create customer token Create an empty cart/quote using the token Add to product to the cart Fetch cart details Fetch cart totals Apply coupon […]
Add Product With Custom Options To Cart Graphql in Magento 2
Add product to cart GraphQL Magento 2 Add product to cart GraphQL Magento 2 or Add Simple Product With Custom Options To Cart in Magento2 Method Post AUTHORIZATION Bearer Token BODY graphql mutation { addSimpleProductsToCart( input: { cart_id: “ctxNWM4yYu4udYCUm8TSeXZOdv7VXv72” cart_items: [ { data: { quantity: 1 sku: “test” } customizable_options: { id: 16, value_string: “28” […]
Increase windows speed in 10 steps
Today we tell you to increase window speed in 10 steps Windows is the most used operating system. Please follow below spets carefully to get best performance of the windows. 1. Make your system is up-to-date Find new updates in the window Settings menu ->Windows Update -> Check for updates.If an update is available, you […]
Add color swatches in Shopify
Today we discuss the add color swatches using metafields in Shopify.We will create two metafields one for color code and one for the product.In product, metafield assigns the products and adds colors into the color code metafield.In my case colour_code for the color code and colour_swaches for the products. 1) In Shopify, you can find […]
How to create custom section in shopify
Today we discuss to create a custom section in Shopify.Sometimes we want to display some extra content dynamically. Steps to create section: 1) From Shopify admin, go to Online Store > Themes.2) Find the theme you want to edit and click Actions > Edit code.3) Go to Sections > Add a new section > Enter […]
Top 10 css interview questions
Full form of the CSS if Cascading Style Sheets 1) Types of CSS a. Inlineb. Internal or Embeddedc. External a. Inline This style is specified within the HTML tag using the style attribute.Example <p style=”color:red”>Hello</p> b. Internal or Embedded The CSS placed inside the HTML page.Example <p>Hello</p> <style> p{ color:red } </style> c. External External […]
Top 5 image optimizer tools
Today we share the top 5 image optimizer tools which are used for the reduced size of the images without installing any software.Purpose of the image optimization is to improve the speed of web pages.Image optimization also improves your SEO ranking.Using image optimizer tools get a higher Lighthouse score and increase your visibility.You can reduce […]