admin

How to swap two numbers without using a temporary variable?

Swap Two Numbers

Solution – 1 – Using Arithmetic Operators function swapNumb(a, b){ console.log('Before swap Output: ','a: ', a, 'b: ', b); b = b -a; a = a+ b; b = a-b; console.log('After swap Output: ','a: ', a, 'b: ', b); } swapNumb(2, 3); Solution – 2 – Using Bitwise XOR function …

Read More »

How to Create and get nth Fibonacci series number?

Fibonacci series

What is the Fibonacci series? Fibonacci series is the series of numbers that are calculated by adding the values of the previous two numbers in the sequence. The first two numbers of the sequence are zero and one. It is also known as the golden ratio. We can represent the …

Read More »

Simple JavaScript code in promises.

function promiseExample(){ const promise = new Promise((resolve, reject) =>{ resolve('successfully!'); }) .then((resolve) => console.log(resolve)) .catch((reject) => console.log(reject)); return promise; } promiseExample() I have a create simple code example for promises. you can easily check. how to resolve is working? and how to reject is working?

Read More »

How to fetch API Data from API in React Using useEffect?

import React, { useState, useEffect } from "react"; // Use can use css from this file: import "./styles.css"; const url = "https://jsonplaceholder.typicode.com/posts"; function App() { const [userData, setUserData] = useState({}); const getUserData = async () => { const response = await fetch(url); const jsonData = await response.json(); setUserData(jsonData); }; useEffect(() …

Read More »

You are given a two-digit integer n. Return the sum of its digits.

You are given a two-digit integer n. Return the sum of its digits. Example For n = 29, the output should be solution(n) = 11. Input/Output [execution time limit] 4 seconds (js) [input] integer n A positive two-digit integer. Guaranteed constraints: 10 ≤ n ≤ 99. [output] integer The sum …

Read More »

Given an array of integers a, your task is to count the number of pairs i and j (where 0 ≤ i < j < a.length), such that a[i] and a[j] are digit anagrams.

Given an array of integers a, your task is to count the number of pairs i and j (where 0 ≤ i < j < a.length), such that a[i] and a[j] are digit anagrams. Two integers are considered to be digit anagrams if they contain the same digits. In other …

Read More »

Moving the validation error message, this time globally

This blog post is a follow up to my previous blog post, which explained how to manage the display of error message on A2C section. By adding one mixin, you will be able to manage the position of error message on any form on any page. Let’s get the show …

Read More »

Add static content in Magento Checkout address form

If you are reading this, you are probably looking for an easy way to add static content to the Checkout address fieldset. If you open the Magento Checkout module, you will notice technology complexity of the Magento Checkout. When you consider Knockout, HTML, PHTML, XML, JS – such a mix …

Read More »

SEO vs. PPC: Structured data markup for product variants

You did it – you finally did it! You’ve implemented all recommended schema.org types and properties throughout your Magento store only to see Google Merchant Center warning you for “Insufficient match of microdata price information”. Let’s admit it – we’ve all been there at least once. Although we don’t usually …

Read More »

Schema Markup for eCommerce Websites

Each time someone searches a particular product online, they end up on a SERP that (in most cases) includes a gazillion results. Since the chances of browsing through all of these links are little to none, it’s essential to make your business stand out. The best way to do it …

Read More »

Moving the Add to Cart validation error message on product page

One quite often overlooked, but very important issue might happen because of design changes in the Add to Cart section on the Product Detail Page (PDP) in Magento 2. This section is very likely to vary from project to project, but regardless of the scope of work and the volume …

Read More »

What’s New in Magento 2.4? Features and Benefits for Merchants Explained

Released on 28 July 2020, the new Magento 2.4 comes with a long list of new features, bug fixes and security enhancements to the world’s no.1 e-Commerce platform. What is new in Magento 2.4? New and improved default search engine Improved Media Gallery New feature Seller-Assisted Shopping New feature Purchase …

Read More »

Magento 2 Webhook Notifications

Webhooks are used to indicate when an important event has occurred, usually by sending a notification in the form of a message to a specified webhook URL or endpoint. This can be really useful for certain events, like when a customer makes an order or leaves a comment. It can …

Read More »

How to programmatically create customers in Magento 2.3.x

There are several ways to create customers in Magento 2. A customer can create an account on their own using the sign-up form, a customer can be created through the admin interface, and there is even a built-in Magento 2 import feature that can mass import a huge number of …

Read More »

Lazy load your images and iframes

Lazy loading is an effective way to improve your frontend performance. And that’s especially important on eCommerce websites. In this article, you will read (and learn) how to reduce page load time by loading your images on scroll and iframes on demand. Let’s get started with lazy load! Feature request …

Read More »

Best practices for Magento homepage design

Did you know that customers are more likely to land on a category or a product page of your Magento store than on the homepage? Nevertheless, the homepage remains an essential part of an eCommerce store for many customers who start their shopping process. It also acts as an anchor …

Read More »

How to set up taxes in Magento 2

We are happy to share with you the ultimate guide on how to set up and manage taxes in Magento 2. Everything you need as a merchant, consultant or developer, you’ll find right here. This guide is based on Magento 2.3.X, however, there were no significant changes in previous versions …

Read More »

Best practices for Magento theme design

This article is the first from a series of articles that will address the concepts and best practices for creating Magento theme design. In this one, we’re talking about prerequisites for designing a custom Magento theme, the difference between custom and off-the-shelf themes and the decoupled approach for Magento theme …

Read More »

Declarative Schema feature in Magento 2

First of all, what is declarative schema in Magento 2? It is a new way of working with database without developers having to write various scripts for each new module version. It was introduced in 2018 with Magento 2.3 and it’s one of the major changes. In this article you …

Read More »

Magento 2 logging

Logging is an important part of every development process. Logs provide insight into system processes of Magento 2 and are a great tool for tracking errors, significant events, exceptions and many more. In order for the logging library to be properly implemented with Magento 2, it must comply with PSR-3 standard. …

Read More »