Magento

Welcome to our Magento 2 post category, your go-to resource for everything related to Magento 2 platform (Custom Magento Development, Magento 2 Migration and Inchoo Flavored Magento).

Stay ahead of the eCommerce trends with our comprehensive articles and expert insights collection. From customization and extensions to performance optimization, we’re here to empower you with knowledge.

Whether you’re a seasoned developer or a curious business owner, we’ve got you covered. Join our awesome community and learn Magento 2 with us!


We Released the First Mage-OS Website

We Released the First Mage-OS Website

At the beginning of this year, we started familiarizing ourselves with Mage-OS after recognizing its potential. A small team within the company began exploring what Mage-OS has to offer, identifying differences between Magento and Mage-OS, and determining what needs to be done to adapt the platform to our internal development processes. We could not possibly imagine these actions would lead to making the first Mage-OS project ever released.

Read more

Group your Shipping Methods by Carrier on Checkout

Group your Shipping Methods by Carrier on Checkout

Having several different shipping providers on your site improves the user experience, which is crucial for converting customers into buyers. This article will show you how to group the shipping methods by carrier provider and allow your users to choose their preferred shipping method.

Read more

Mastering Magento Site Search: Strategies for Enhanced User Experience

Magento 2 search strategies for improved UX

In addition to the main navigation, search is typically the second most popular strategy for finding products on eCommerce websites. Customers often use the search function when they know exactly what they are looking for or when the main navigation does not yield the expected results.

How do you design and configure the search engine of your Magento site for the best usability? Keep on reading!

Read more

Is Hyvä Your Next Magento Frontend Solution?

Inchoo meets Hyvä

Magento, a global name in the eCommerce platform arena, has been the backbone for countless online stores since the year of Inchoo’s inception – 2008. Yet, despite its robust backend capabilities, Magento’s frontend has historically been its Achilles’ heel. In this article, we’ll delve into why Hyvä theme has emerged as the premier choice for many Magento stores.

Read more

How To Connect Google Analytics 4 To Magento 2

How To Connect Google Analytics 4 To Magento 2

Follow these clear steps to connect your Google Analytics 4 to Magento 2 store through Google Tag Manager!

This post has been updated, as the previous one had instructions for Universal Analytics (GA3) and Magento 1. Enjoy the refreshed instructions below.

The most basic way to connect your Google Analytics 4 (GA4) property to any site is by inserting the Google Analytics 4 tracking code in the <head> element of every page you want to track. You can find the code by taking these steps:

  1. Go to GA4 property Admin
  2. Then Data Collections and Modification
  3. Select Data Streams
  4. Click the Stream for details
  5. Select View tag instructions 
  6. Switch the tab to Install manually

You can also use one of many Google Analytics Magento extensions. After the extension is installed, it’ll ask for the Measurement ID — the number of your GA4 property, which can be found in step 3— in the Data Stream details.

To install any of these extensions, follow their instructions.

Installing Google Analytics using Google Tag Manager

While you can connect Google Analytics by placing its code into the <head> element or using an extension, using Google Tag Manager is, in fact, the best way. Google Tag Manager gives you many management options when handling Google Analytics and different marketing platforms such as Google Ads, Facebook Ads, Pinterest, TikTok, and many more; thus, it enables enhanced eCommerce events to collect information about your customers’ shopping behaviour.

You can read more about why we feel using GTM is the best way to connect your eCommerce site to Google Analytics here

1. Create a Google Tag Manager (GTM) account and container

Visit Google Tag Manager Home and hit the blue “Start for free” button. If you’re logged into your Google Account, you’ll see the “Add new account” interface asking you for your 

  • account name (usually company name), 
  • country, and
  • platform (in our case, it’s web).

After finishing this step, you’ll enter Google Tag Manager, where you’ll see the installation instructions. 

If you close the pop up with instructions, you can always find these instructions by clicking on the Container ID in the top right corner.

2. Install the Google Tag Manager 2 Extension

We can’t suggest any particular GTM extensions as they all do the job. The best thing for you is to Google them and choose the extension with the features that best suit your needs.

Here at Inchoo, we have worked hard to create our own performance-aware GTM extension, which we provide free of charge for our clients

Regardless of the extension provider, connecting GTM to the extension is more or less the same.

3. Connect your GTM container with the Magento GTM extension 

Open your GTM container, and you’ll see the previously mentioned Container ID in the top right corner.

Open your Magento GTM extension configuration and find the appropriate field to paste the Container ID.

Once you save the configuration, you can check your site’s source code and search for the Container ID in the markup to verify the installation.

4. Create a GA4 configuration tag in GTM

Assuming you already created the GA4 property (if you didn’t, check out this article), now’s the time to add GA4 to your site through Google Tag Manager.

Select “Tags” from the sidebar navigation and hit the “New” button.

Once the new tag interface appears, click the whitespace under the “Tag Configuration” title and select “Google Tag” from the list.

Once you add Google Tag, it will ask you for your Tag ID — your GA4 Measurement ID.

Since this information will be required each time a new tag is created, and you probably don’t want to copy-paste it each time, placing the Measurement ID into a variable is a good idea.

Click the little lego icon next to the input to proceed.

In the next interface, hit the plus icon in the top right corner to trigger the new variable interface.

Like before, click the blank space under the “Variable Configuration” title and select “Constant” from the list. Paste your GA4 Measurement ID into the “Value,” give the variable a meaningful name (GA4 – Measurement ID will work fine), and save it.

GTM will automatically populate the Tag ID in your new tag configuration with your new variable, and in the future, click the lego icon and select your variable when you need to add GA4 Measurement ID to a tag.

Now click the whitespace under “Triggering” title, and select “All pages” from the list.

Give the tag a name “GA4 – Configuration” and save it.

And that’s it. You have connected your Google Analytics property to your Magento webshop with Google Tag Manager!

5. Test your connection in GTM Preview Mode

You can test the connection using GTM’s preview mode.

Hit the preview button in the top right corner of GTM’s interface and type the URL for your eCommerce site.

GTM will open your site in another tab. If the connection isn’t successful, GTM will give you a message saying the tag is not found on the site. If it is successfully connected, you should see a page_view event when GTM opens your site in another tab. Continue to browse through your webshop and observe what events are starting to show in the preview mode!

6. Test your connection in Analytics Debugger

Besides testing whether the GTM connection works, you should check whether Analytics receives data from your eCommerce site. 

Open analytics property admin and go to Data Display > Debug view.

Reload the GTM preview mode, and you should see the same page_view event that happened when the GTM opened your webshop in another tab.

This means your Google Analytics receives hits and is connected to your webshop. Continue browsing your site and observing what events are starting to show in the DebugView in Google Analytics!

If you want to continue and set up Enhanced eCommerce events, feel free to reach out to us!

Read more

Reindex only required indexers in Magento 2 from CLI

Reindex only required indexers

Don’t you just love it when you change some config option or switch to another branch or something similar and all of a sudden, a warning message pops up in Admin, saying:

One or more indexers are invalid. Make sure your Magento cron job is running.

Well, if you “love” it as much as I do, I’m going to show you how to address the particular indexer(s) without any hassle of knowing which one caused the warning to appear in the first place.

Read more

Add static content in Magento Checkout address form

static content m2 checkout inchoo feat

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 of technologies can often make a simple straightforward task seem super complicated.

Usually, if you need to edit something on the Checkout, you need to create a custom module, which will override the Layout Processor. This approach makes sense if the Checkout modification is complex and there needs to be some kind of a dynamic.

But for simple tasks, such as updating input placeholders, adding the notes to the inputs or adding the text between inputs – custom modules are an overkill.

Let me share with you a simple frontend solution for situations when we need to add some text or an image banner, for example between the Last Name input and the Company input.

Read more

eCommerce Returns Management – a simple solution from the Fashion industry

Returns management

Returns can be a major headache for eCommerce retailers. While in-store purchases don’t get returned so often, there are estimates that customers return up to 40% of goods bought online.

This is especially the case in the Fashion & Apparel industry. Online store customers can’t touch the product, hold it nor feel it during online shopping.

Some customers deliberately resort to the practice of over-ordering. This increases the quantity of returns and their negative environmental footprint.

Since the Covid-19 pandemic turned the online store into the only sales channel for many retailers, the problem with returns is more critical than ever.

In this blog post, we’ll demonstrate how one of our clients improved their returns management by developing a custom Returns Portal on the Magento platform.

Read more

SEO vs. PPC: Structured data markup for product variants

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 face this issue on simple product pages (since product markup on these pages is pretty straightforward), we can often find it on product variants.

Since setting up correct structured data markup on grouped and configurable products isn’t always easy as it seems, I’ve prepared this short guide that should serve you for both SEO and PPC purposes.

Read more

Moving the Add to Cart validation error message on product page

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 of these changes, error validation on the Quantity field must not cause any issues whatsoever.

In this article, I will show you what needs to be done in such a case, which should be very easy and straightforward to implement in your custom theme.

Read more

Schema Markup for eCommerce Websites

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 is to add structured data markup throughout your online store.

Read more

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

What's New in Magento 2.4? Extra 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 Approval Workflows (only for Magento Commerce)
  • Two-factor authentication for improved security
  • Higher technical requirements overall
Read more

Magento 2 Webhook Notifications

web

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 also be a really handy way for developers to get instantly notified when an exception occurs, providing them with the information they need to quickly locate and fix the issue.

In this article, I will show you how to create a module that allows you to configure your very own webhooks for Magento 2, utilizing the Incoming Webhooks feature from Slack.

Read more

Is now the time to invest in PWA for your Magento website? Top questions for merchants answered.

Is now the time to invest in PWA for your Magento website? Top questions for merchants answered.

Progressive Web Applications (PWAs) are the next big thing in eCommerce. This topic has been on everyone’s lips and under everyone’s fingertips from the initial conversations around Magento 2 frontend and the introduction of the headless concept.

If you are a merchant considering this new frontend concept, you may be wondering what the fuss is all about, whether it makes sense to invest in PWAs, and how big of an investment should you plan? Here is a quick rundown of the main questions and answers for anyone still on the fence about PWAs in Magento, from a merchant’s perspective.

Read more

How to programmatically create customers in Magento 2.3.x

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 customers from a CSV file, provided that the customer data in the CSV is import-ready.

But what if we have thousands of customers whose data still needs to be processed before they can be created? The best way to do this would be to create the customers programmatically.

In this article, we are going to cover the topic of creating customers programmatically, and to this purpose, we are going to create a simple Magento 2 module which is going to have a custom console command and a couple of models that are going to be used to read, process and create customers.

Read more

Lazy load your images and iframes

lazyload 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

  1. images on scroll and
  2. iframes on demand.

Let’s get started with lazy load!

Read more

Best practices for Magento homepage design

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 to refer back to throughout the shopping experience.

The homepage introduces the website, explains what it sells, and sets some expectations. It should convey brand values, inspire customers to explore, display product ranges – and accomplish that without visual clutter.

It acts as a shop window to an online store, so cramming things inside might result in a lower perceived value. You wouldn’t clutter your shop window, would you?

Read more

How to set up taxes in Magento 2

setup taxes 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 of Magento 2 when it comes to sales tax setup, so it should be backward compatible as well.

The setup presented in this guide works the same way in Magento 2 Commerce (Enterprise), Magento 2 Open Source (Community), and Magento Commerce Cloud.

Read more

Best practices for Magento theme design

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 design and development.

Read more

Declarative Schema feature in Magento 2

Declarative Schema

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 will learn how to use declarative schema and apply data patches.

Read more

Magento 2 logging

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.

Magento 2 comes with built-in logging solution based on Monolog Library which will be analyzed further in this article.

Read more

Magento 2 Customer Groups Configuration

Magento 2 Customer Groups Configuration

Have you ever wondered how to apply different rules, discounts or tax rates only to a selected group of users? You’ve come to the right place! In this article, you will find out what customer groups are used for in Magento and how to use them.

Read more

How did we standardize Magento 2 frontend development?

How did we standardize Magento 2 frontend development?

Many Frontend developers in the Magento community felt a certain level of pain when they started working on their first Magento 2 project. So did we! “This is just a start. I will be faster on the next one“, was a common statement. However, new projects arrived and frontend development was still not as fast as it was with Magento 1.

To improve the speed, efficiency, joy of work and team synergy, our frontend team decided to refine our development processes. After a few completed projects, we got an idea of how to do things better and quicker. Modernizing the approach we’ve been using.

Read more

How to save custom data in cache in Magento 2

How to save custom data in cache in Magento 2

Recently I was working on rendering images on a custom template. More precisely, I created a widget for inserting pictures that serve as a picture loader. And by default, the administrator has to input some parameters (width, height, alt) and if he decides, he could upload another image.

Reference for creating a widget tutorial could be seen here. The exciting part of the task was when the widget is saved on some of the Magento pages and loaded on i.e. ‘About Us’, image or images and parameter values have to be saved in the cache.

So when you visit ‘About Us’ another time, image content will be served instantly.

In this article, we’re going to save simple custom data inside the cache and load it when Magento renders the template.

Read more

SEO Checklist for Magento 2 Migration

SEO Checklist: Magento 2 Migration

Whether you’re considering building a new store on Magento 2, or you have already started the transition, there are (more than) a few things to keep in mind to ensure your traffic and (more importantly) revenue don’t get lost during the migration.

Migration to Magento 2 is stressful for every store owner, but the change is inevitable. We have already prepared a list of the most common SEO mistakes during the migration, but we wanted to do more, so we decided to create this SEO checklist to make your transition as smooth as possible.

Read more