Cannot resolve reCaptcha Parameter Error on Magento Admin Login

How to fix it?

ReCaptcha is a Google service that can be utilized in Magento as part of the features provided by Magento, in which and Administrator can protect a site from abuse and spam.

Since security risks are getting more challenging, this service is being constantly updated by both Google and Magento; reducing the changes for any risk or attack.

However, an upgrade between Magento versions 2.4.3 and 2.4.4 caused a bug that will not allow the Administrator to normally login into the backend site. The Administrator sometimes could be able to login only after several attempts but the issue will re-occur after logout or the session is expired.

How to reproduce it?

If one needs to make sure the issue exists in the current page, the following steps are necessary to reproduce the issue:

  1. Go to Configuration > Security > Google reCAPTCHA Admin Panel

  2. Add your Google API Website Key & Google API Secret Key to any reCAPTCHA below:

reCAPTCHA v2 (“I am not a robot”)

reCAPTCHA v2 Invisible

reCAPTCHA v3 Invisible

Screenshot 2022-05-26 at 6 22 19 PM
Screenshot 2022-05-26 at 6 23 11 PM
Screenshot 2022-05-26 at 6 30 15 PM
  1. Select your reCAPTCHA version (with API keys above) for either below:
    Enable for Login
    Enable for Forgot Password

  2. Save config

  3. Flush cache

  4. Logout from admin backend.

After these steps, besides not being able to login back as Administrator, the following log line will be generated in your log files:

main.ERROR: Can not resolve reCAPTCHA parameter. {“exception”:”[object] (Magento\\Framework\\Exception\\InputException(code: 0): Can not resolve reCAPTCHA parameter. at /var/www/html/magento/vendor/magento/module-re-captcha-ui/Model/CaptchaResponseResolver.php:25)”} []

What is the root cause?

The reason for this is that the JavaScript client isn’t getting the token on submission. So the ReCaptcha param it is looking for is empty.

The client isn’t resolving correctly, because it’s being loaded asynchronously and the way it’s coded, will only activate the form interception after the the file

vendor/magento/module-re-captcha-user/view/adminhtml/templates/recaptcha.phtml

More specifically in the following lines:

const element = document.createElement(‘script’);

const scriptTag = document.getElementsByTagName(‘script’)[0];

element.async = true;

element.src = ‘https://www.google.com/recaptcha/api.js

        + ‘?onload=globalOnRecaptchaOnLoadCallback&render=explicit’;

Solution

In order to solve the issue the whole file recaptcha.phtml from above needs to be refactored as follows in order to resolved the captcha correctly.

Step 1 

Create a new module (not covered in this article)

Step 2

Create a new template at the folder YourModel/YourCompany/view/adminhtml/templates with any name you want, being in this case recaptcha html

Step 3

Copy and paste the following content in the new template:

<?php

/**

* Copyright © Magento, Inc. All rights reserved.

* See COPYING.txt for license details.

*/

/** @var $block Magento\ReCaptchaUi\Block\ReCaptcha */

$config = $block->getCaptchaUiConfig();

$renderingOptions = $config[‘rendering’] ?? [];

$isInvisible = !empty($config[‘invisible’]);

?>

<div class=”admin__field <?= /* @noEscape */ $isInvisible ? ‘field-invisible-recaptcha’ : ‘field-recaptcha’ ?>”>

   <div

       id=”admin-recaptcha”

       class=”admin-recaptcha-content<?= /* @noEscape */ !empty($renderingOptions[‘size’]) ?

           ‘ size-‘ . $renderingOptions[‘size’] : ” ?>”>

   </div>

</div>

<script>

   require([

       ‘jquery’

   ], function (

       $

   ) {

       const element = document.createElement(‘script’);

       const scriptTag = document.getElementsByTagName(‘script’)[0];

       element.async = true;

       element.src = ‘https://www.google.com/recaptcha/api.js’

           + ‘?onload=globalOnRecaptchaOnLoadCallback&render=explicit’;

       let isRecaptchaLoaded = false;

       let token = ”;

       let maxRetryAttempts = 5;

       let attempts = 0;

       let widgetId = 0;

       <?php if ($isInvisible): ?>

           $(‘#login-form’).submit(function (event) {

               if (!token) {

                   event.preventDefault(event);

                   event.stopImmediatePropagation();

                   event.stopPropagation();

                   let attemptRecaptcha = () => {

                       attempts++;

                       if (attempts > maxRetryAttempts){

                           console.error(“Could not fetch invisible ReCaptcha token. ” +

                               “Please refresh the page and try again.”);

                           return;

                       }

                       if (!isRecaptchaLoaded) {

                           setTimeout(() => {

                               attemptRecaptcha()

                           }, 1000);

                           return;

                       }

                       grecaptcha.execute(widgetId)

                           .then( () => {

                               event.preventDefault(event);

                               event.stopImmediatePropagation();

                               event.stopPropagation();

                           }, (reason) => { })

                           .catch(err => { console.error(err); });

                   }

                   attemptRecaptcha();

               }

           });

       <?php endif; ?>

       window.globalOnRecaptchaOnLoadCallback = function () {

           isRecaptchaLoaded = true;

           widgetId = grecaptcha.render(‘admin-recaptcha’, {

               <?php foreach ($renderingOptions as $key => $value): ?>

                   ‘<?= $block->escapeJs($key) ?>’: ‘<?= $block->escapeJs($value) ?>’,

               <?php endforeach; ?> ‘callback’: function (_token) {

                       <?php if ($isInvisible): ?>

                       token = _token;

                       $(‘#login-form’).unbind(‘submit’);

                       $(‘#login-form’).submit();

                   <?php endif; ?> }

           });

       }

       scriptTag.parentNode.insertBefore(element, scriptTag);

   });

</script>

Step 4

Create two new layout files called adminhtml_auth_forgotpassword.xml and adminhtml_auth_login.xml inside the folder YourModule/YouCompanyNamer/view/adminhtml/layout

Step 5

Copy and paste the original content from those files located at vendor/magento/module-re-captcha-user/view/adminhtml/layout

Step 6

Change the template name for the one you created in step 3 in both new layouts.

After this, the reCaptcha login issue will be solved and the Administrator will be able to login back successfully at first attempt.

Before implementing the solution please be sure to double check the issue is reproducible in your environment in order to avoid adding unnecessary modules or extensions to your project.

HTTP Basic Authentication for Magento Cloud

There is no doubt that live testing is much preferred before pushing to the Production environment, however, there are times when a new feature or changes on Integration/ Staging environment is preferred to be kept private or secret from the public network; for this, HTTP authentication would be a solution.

What is HTTP Basic Authentication?

The basic flow of any HTTP Basic Authentication is as follows:

  1. A client requests access to any page from the store.
  2. The web server returns a dialog box that requests username and password.
  3. The client submits the username and password to the server.
  4. The server authenticates the user,if successful, returns the requested page.

Magento Cloud provides a very simple web interface for enabling HTTP authentication; just click on the environment and go to Configure EnvironmentSettings; then click Edit on HTTP access control.

The interface will look like the following:

By using the above interface the administrator can set any amount of usernames and passwords, and/or restrict or allow by IP address.

After finishing setting up the administrator must switch HTTP access control to ON in order to apply the changes, this will display a login dialog if the client has not been authenticated yet.

This will add an extra security layer to those teams that require to live test under a certain degree of discretion, being also secured since Magento Cloud utilizes SSL as default for all communication.

Full Magento vs Shopify Comparison

Transcription:

Hey everybody, this is Ori from Astral Web. In today’s video, I’m going to showcase to you the difference between Magento and Shopify and help you choose better which platform is better fitting for you by sharing knowledge based on my experience. So our agency, Astral Web, we’ve been…we’re agency. We build websites. We build e-commerce websites, both with Magento and Shopify for years.

Magento, about seven years, Shopify about four years right now. And we range…our clients range from many different types of project from very small businesses to medium, to large companies, to multinational brands, enterprise, etc. And we really understand how to do that. So what I wanted to do today is just share with you the knowledge that we have and try to get you closer.

Now, what I’m trying to do is to share with you kind of the out-of-the-box or the more general. But every business has different requirements. So comment in the YouTube channel and specify the specifics that you need and I’ll help guide you even closer to that, okay? Happy to discuss with you guys to share this knowledge, okay? So now we begin. So I have two tables that I wanted to share that I tried to explain things.

Okay. So we’re going to go over some basic information first, and then give you requirements and recommendations along the way. So first of all, Magento, what’s the difference between Magento and Shopify? So first of all, Magento is an open-source platform, which means when you use Magento, you have full control over everything that the platform can do. And you can customize anything.

This is a very specific thing. With Shopify, it’s a closed system, which means they take care of the hosting, the code itself, and you can only customize some things. You can customize a lot of things but there’s certain things that are restricted that you cannot do, for example, URL structures of your product pages or collection pages, you can’t change that.

And there are certain restrictions about API restrictions or other things. So very simple put, if you really want to customize, you have heavy customization, then Magento typically is the way to go. If you have more simple site and you want to…you don’t want to handle all of the kind of, you know, the full customization, Shopify is a better solution. But again, these are very broad things.

Okay. So let’s talk about some quick stats. So Magento and Shopify are founded, started pretty similar times. Personally, we’ve been working with Shopify a lot later. We’ve been working with Magento a lot earlier. And Shopify over the last two or three years has really gotten better and better. And Magento is mostly in the last two to three years is focusing more and more on larger and enterprise projects.

There’s more Shopify sites than Magento. These are stats from their websites. Shopify has about a million merchants and Magento has about 250,000. From real data, they’re probably a lot lower, but the numbers are still by ratio bigger. This 1 million for Shopify is probably, you know, overall but the stores have closed and changed.

As far as app stores and marketplace, these are extensions that add on top of the out-of-the-box functionality. Shopify has a little bit more than Magento has. The ranges, Magento has typically…Magento and Shopify have kind of a lot of the same partners that make extensions like payments and promotion extensions, and shipping extensions, things like that.

Magento has some of the bigger ones like Salesforce integration, you know, CRMs, and things like that. And Shopify has a lot of functionality, marketing tools, things like that. But there’s a lot of overlap. There’s a lot more development happening and communities happening on Magento and a little bit less on Shopify. And Shopify focuses mostly on small business, SMB.

Most of the sites out of the 1 million sites are small business, really small drop shipping, one-person shows. Shopify is getting better at getting bigger and bigger clients and they have with Shopify Plus and really good in growing sites. But usually, their majority of…if you take a pie, majority of the sites are small sites.

And in Magento, the majority of the sites are about mid-market. Maybe they’re small to mid and then there’s quite a few enterprise. So it’s kind of different markets going for there. Magento uses all open source all… it basically uses PHP and MySQL. And then Shopify uses Shopify’s Liquid. So they have some different things. Obviously, HTML, CSS applies, JavaScript applies to all because it’s how you build the front end.

But the languages are a little bit different, okay? Industries. There’s a lot of overlap. But for Shopify, for example, there’s a lot of beauty, cosmetics, fashion, things like that. And in Magento, there’s a lot of manufacturers, retail. There’s a few things and one of the things that’s really big about Magento is you have B2B. So, most e-commerce sites are typically B2C, selling direct to consumer, right?

Customer goes, they buy, etc. Magento has grown to do a lot more B2B. They have in their Magento Commerce version of B2B add-on. It’s a really strong one. Shopify Plus also has an add-on for B2B, but the Magento one is really strong. And we’ve been seeing over the last few years…sorry, over the last two years, a lot more B2B projects and they really do good high, you know, high volume, high SKU, a lot of products, And the B2B is becoming more and more.

So that’s one of the focuses for Magento. Notable brands. There’s really big brands in Magento that we’ve noticed aside from us doing a lot of big brands. There’s companies like Nike, Ford, Olympus, etc. Aldo. And Shopify has also some brands, but they’re usually more bigger brands that are more simple sites like Tesla, things like that, okay?

So next one is plans. So Magento has multiple versions. They have the open-source version, which is a free, non-licensed version. There’s no cost for it. The code comes as is. And then they have paid versions, the enterprise versions called Magento Commerce, which is open source and commerce.

You have to host it yourself. Magento Commerce Cloud, the cloud… the hosting is part of the package from Magento using AWS. And then there’s also some add-ons for Order Management system. These are a separate platform that just…if you have multi-channels you have a lot of different systems, you can have one system that just manage only the orders. And then, Business Intelligence are really just reports and kind of advanced reports.

Shopify has Shopify platforms, Shopify Plans, and also Shopify Plus, and Shopify POS. So what does that mean? If you’re a basic seller, small business, in most cases or medium, you’re going to use Shopify and they have different packages that cost a certain monthly fee.

All of these are hosted by Shopify. Here all of these are hosted by you, by you as a company. So Shopify Plans, basically based on the number of SKUs and the functionality. You have basic and Shopify in advance. And that will decide how you pay a monthly fee and what features you get, and what your transaction fees are, things like that.

So what we’ll do is we’ll link in the comments. But basically, you can see here Shopify Plans, okay? And then you’ll be able to see this is the monthly fee, monthly fee, monthly fee and includes everything in one. And then, there’s Shopify Lite, which is basically barely making website. It’s more about you can just accept credit card, just a simple like Buy Now button, things like that.

And Shopify Plus is for high-volume merchants, starting about $2,000 a month, includes more functionality, more features. We’ll jump into it a little bit later. Okay. So, the simple difference, just to recap this is, Magento, you’re fully open source. You’re customizing yourself. There’s a free version, and then there’s paid versions that are annual fees based on your GMV, based on your sales.

And then, Shopify is very straightforward. This is your monthly fee. It includes hosting, includes all the functionality. So for these ones, open-source, these are the free ones. And then, Shopify, these are the basic functionality. So here we’re talking about for large businesses. The Magento Commerce, which is the enterprise version, and Commerce Cloud, and then the Shopify Plus.

So we’re comparing the enterprise features which cost extra money. So what else do you have out-of-the-box for the enterprise for the Magento Commerce version? You have Abandon Cart functionality. You can log your Admin Actions, whatever people are doing in the back end, for example, this is the backend of Shopify. This is the backend of Magento. You can basically log every action.

For Magento, someone saved the product, someone deleted something, someone made a promotion, you can see all of that. B2B functionality. That’s a big one. It’s, right, it’s selling to businesses, Custom Reports, and BI. This is a huge one. I’m going to jump a few things, Content Staging. You can schedule content to be set live at certain times.

Customer Segments, marketing features, Enhanced Ecommerce for Google Analytics, Page Builder, which is a huge one. It helps you build, create pages by yourself without a developer. Private Sales, Product Recommendation Engine. So real engine using Adobe’s Sensei, one of their basically AI or machine learning.

And RMA which is return management. And there’s just a lot of things and scaling for larger websites. In Magento… In Shopify Plus you have some different things. You have a more simplified B2B channel. You have obviously dedicated support. Also here you have dedicated support.

And you have some additional apps and extensions like Shopify Scripts and Shopify Flow, and etc., and Staging Sites. So these are kind of the functionalities, which we’ve covered. We already have some videos about Shopify, Shopify Plus, Magento, Magento Commerce, okay? Let’s talk about the advantages and disadvantages for both platforms. So what are the advantages for Magento?

Magento is really built for ecommerce only, right? And so, this is…this is a good thing. It’s an advantage over some of the other platforms like WordPress and other. It’s fully open-source, which means you can customize anything you want. Magento is really good for websites and businesses that have multi-store, multi websites. So if you’re a retailer or you’re a company that’s selling with one platform, selling in multiple countries with multiple languages, Magento is a no-brainer.

It’s just the best solution out there. Flexibility, scalability, you can do anything you want. There’s a lot of editions. You have a free edition and then, you have the paid enterprise editions that have more functionality. You can support a huge amount of SKUs. We have projects with hundreds of thousands of SKUs of products and Magento works well.

B2B eCommerce is a big one. It has really good strong core functionality. The features out-of-the-box are much better than Shopify’s feature out-of-the-box. There’s a lot of third-party integrations. There’s a big community. If you have a problem, you Google it, you’ll see a lot of communication in the forums, Stack Overflow, talks. Obviously, we make a lot of videos, things like that.

And there’s a big security focus or a lot of security updates regularly. Adobe is pushing it. And it’s just a really good platform. I really like Magento. I like Shopify as well but we’ve been really…most of our businesses doing Magento because we feel it’s the superior product for the type of businesses that we do. So we have more mid-market and enterprise clients, so that’s why we like Magento more.

But for small businesses, I like Shopify as well. So let’s talk about Shopify’s advantages. It’s also an e-commerce first platform. It’s really good at security. Why? Because Shopify, it’s a closed system. And just like Apple etc., they control certain things that you can do, and you can’t do.

And if they let you customize less things, it has better security. The more you close, the less holes or less potential there is. The other advantage is Shopify sites are much cheaper to make. They’re much simpler. You can launch quicker, quicker time to market. They cost less. You have to, you know, you have to manage less things.

If Shopify takes care of the servers, and then here, you have to take care of the servers in Magento, you’re paying less money. You have less headaches for that stuff. You pay Shopify to do that for you. And the other good thing about Shopify is you have a lot of apps. And you can add functionality by clicking, not asking the developer. In Magento, you have to ask a developer to either create something or install something for you on the server.

With Shopify just like Apple, you just click it works. It’s a really good thing for Shopify, okay? So the simple recap of this is a few things, if you really want to customize, you have a lot of customization requirements, all kinds of special integrations, APIs, you want to do special things, Magento is the go-to thing. If you want a simple just click, install an app, you want to take care of less…spend less money on your own IT, your own MIS, own server people, you want to go with Shopify.

So these are kind of some of the things. You want to launch quicker, you want to spend less money, Shopify. You want to build a beast, you want to build a bigger thing, multi-country, growing, flexible, scalable, you want to use Magento. What are the disadvantages and they’re basically the opposites of this. Magento takes longer, more money to build. Magento is slower to launch, right? It takes longer because it’s built.

Because you’re building more custom things. Magento requires you to do your hosting. Magento requires you to update your security regularly. More of the security is on you versus Shopify, less is of the security is on you. Shopify’s disadvantages. You can’t… There are certain things you can’t customize.

You have to do all these workarounds, make apps and all that stuff. There’s system limitations. There’s like, for example, you can only have a hundred variant products by default, like a hundred, like, for example, you’re selling a shirt and you have a size and color. You can only have a hundred of those. In Magento, there’s no limit. Now, there are workarounds for that, but just the date, the native platform has certain restrictions which you need to be aware of.

Another disadvantage, I think this is an advantage and a disadvantage. But there’s a lot of apps in Shopify that you just click and it works. But the disadvantage is because Shopify’s functionality is limited out-of-the-box and Magento has more things, when you need to expand, you need to extend your functionality, you need to install a lot of third-party apps.

But these apps are done by different providers. You’re going to find one company that does like marketing apps, and one company that does product customization, and one that does email marketing. So you’re starting to add so many different companies’ apps and they don’t necessarily work together well with them and they don’t…not every company is supporting the apps in the best way.

So if they’re down, for example, maybe you’re using a third-party company to do, for example, upsells, I don’t know. And then, their server is down, you are down, right? Your functionality is not working. With Magento, everything is…all the extensions, everything is done on your side. So you’re responsible for the code.

You can buy those or you can make it yourself, but you’re responsible. So if you’re up, you’re up. Now, if the third party is up, you have to start monitoring, like which one is up, sometimes you have support. We’ve seen a lot of issues with consistency and quality of different third-party apps. So you have to select carefully and you have to hope that they’re really supporting, and they’re making money, so they keep your apps running.

Well, this is the reason why we’ve actually started building our own Shopify apps because we’ve noticed that there’s a lot of missing link between the quality and consistency of app maker. So this is a kind of advantage, but also a disadvantage for Shopify. What about the cost structure? So with Magento, you’re paying based on your GMV, depending on how much you’re selling in the year, you’re paying for that.

With Shopify, it’s very straightforward. You’re paying a certain monthly fee and that’s it. Okay. So out-of-the-box, what type of products can you sell in Magento, okay? You can sell a lot of…a lot more things you can do a Shopify. You can sell simple products just, you know, click here, buy it. Configurable products like the t-shirt.

The customer can choose the size and the color, and then they can buy it. Virtual products, a product that’s…is not physical. You’re not shipping it. It doesn’t have a weight. It doesn’t have a shipment. It has digital. So for example, subscribe to this say, you know, pay some money and receive some access to a back end that you can access like a free, like a newspaper, digital newspaper, something like that.

Downloadable, a buy this, and download something like maybe sell an mp3 or something like that. Bundles, build a computer, right? You can select from which CPU you want, which GPU, which etc. and then you can buy it. Grouped, showcase a lot of products, customer can select what they want. Gift card, this is for Magento Commerce.

Buy a gift card and then reuse it later, send it to someone, for example. Magento’s products, one of the really good things about Magento is, the products are fully customized. We have attribute and attribute sets. What that means is, if you’re selling different products, like a t-shirt would have color and size. But a computer would have GPU, CPU, motherboard, ram, etc., so you can set up all the configurations to manage your products in very specific ways.

In general, aside from products, Magento has fully customization on so many things. The way you charge taxes is so custom. You can make…you can fit all the different business types for all across the world. The way you customize your products, the way you customize your customers, those are all fully customizable.

With Shopify, this is what you get and that’s it. What else do you have? You have multi inventory options. In Shopify, you also have that. You have Auto Associations. You can connect upsell, cross-sells related products. You can connect those manually and you can also automatically decide some kind of rule in Magento and then, you can actually recommend other products.

And obviously, in the commerce version, Magento has product recommendation engine, which is a huge thing that more and more platforms will use in the future. Okay. With Shopify, you have very small things. You have simple products, just buy it. Variants are similar to configurable products, which is the t-shirt, select this blue color and buy it.

Virtual and gift cards, okay? There’s no customization on product attributes. You have to use apps to do that, but the apps kind of suck honestly. There’s so many limitations you can do with it, you can achieve it but Magento’s customization on products are much, much better. You also have multi inventory, which is a great feature and Inventory Transfer. This is a nice feature which you can actually monitor how you have incoming stock that’s about to become part of your inventory, okay?

And Magento really the…just to summarize this, Magento has more product types. And it also has a way for you to customize each product with attributes and attribute sets. It’s a really good thing to have, okay? Orders. What can you do with orders in Magento? Oops.

You have front-end and back-end orders. You can customize the order flow. This is a big one. In Shopify, you can have front-end and back-end orders. You cannot customize the order flow. Order flow goes something like this for Shopify. Place an order, order gets created, ship the order, complete the order.

Very simple one, two, three. In Magento, you have invoices, shipments. You have creating the order, and most importantly, custom statuses. You can change the flow. You can have 13 steps if you want. Review the order for spam, ship it partially, prepare the order, pick and pack, etc., etc. Do this, do that.

And you can have variants like if this thing happens, do that, if the other thing happens, complete the order. And this is a huge thing for it. In addition to Magento out-of-the-box, both of them have full and partial refunds, full and partial refunds. And Magento has RMA. So when a customer wants to return something, they can go online themselves, click on their order, say I want to return this thing.

And then there’s a communication between the order flow, you can return the product and eventually, get a refund. Shopify doesn’t have it. You need to have an app for it. And it’s such a basic feature. So RMA is really important. Customer management. Shopify has customer groups, and you can tag them to create customers and then tag them via tags.

So basically, you can make group. These are the VIP. These are the regular customers, etc. Magento has customer groups and customer segments for commerce. So customer segments means you can create things like these tags, but you can actually set certain promotions based on these. And you can do things like dynamic content. So if a certain customer is on a page, they can see a different banner or a different product from other customers.

So there’s more functionality in marketing on Magento than Shopify. Shopify has the good tags, which is a nice feature, but you have to start using apps to achieve other things. Magento Commerce has this out of the… out-of-the-box. And then, Magento Commerce also has customer attributes. So when someone registers or someone checks out, if you want to collect more information than just name, email, password, with Magento, you can create it just click, click, click.

And with Shopify, you have to have a developer doing that. And it’s much more complicated in Shopify. So layout and themes. What is the most focus for most companies? They want to have a beautiful website. So both Shopify and Magento have a lot of different themes you can select from, some are free, some are paid.

And the…you have limitation on the themes, right? You just… Usually companies for Shopify, they just click. They use it. That’s it. In Magento, you can really customize everything much more than you can with Shopify. And a big thing for Magento Commerce is you can actually have the page builder.

You drag and drop. You click. It just works really, really well. It’s so easy to create pages, embed videos, animations, movement, blocks, products, maps, all these kinds of things, okay? Shopify obviously has apps for page builders. But again, we noticed that Magento… the theme, if you notice what’s going on, Magento is much more customizable.

You can customize the products out of the box, the customers, the pages. And in Magento, you need to use apps to achieve those and you have some restrictions, right? So marketing, let’s look at marketing. Magento has a lot of marketing things, advanced promotions, catalog promotions, cart promotions, special prices, tier pricing out-of-the-box, right? Tier pricing means buy this, it’s $10.

If you buy at least 50 of them, it’ll be $8 per piece. And you have each group like the VIPs can have this or the loyal customers can have a different price. You have abandon cart, you have content scheduling, you have just…you have a ton of features, private sales. You can invite people just for exclusive sales, you have Magento…you have Google Analytics eCommerce, you have a lot of things out-of-the-box.

In Shopify, out-of-the-box, you have the abandon cart, which is both. You have basic promotions, which are much simpler. Shopify’s promotions are either $1 off or a percentage off based on some basic information like the cart amount or the cart amount or maybe a date or something like that.

In Magento, you have a rule-based engine. You can combine promotions. You can set this, and this, and this, or this. So you can have all these rules. You can create much more advanced promotions. The good thing about Shopify is there’s easy integration with Google, Facebook, Amazon, eBay, a lot of these channels. In Magento, they’re…most of them are not so easy to integrate.

You need a developer to integrate it. So this is really a good advantage for Shopify. They have something called channels and channels easily allow you to integrate. For example, you want to start a Google Shopping campaign. You can click a few clicks, read a little bit, set it up and you can already start selling, promoting…shopping ads on Google. In Magento, it’s more complicated. But because…part of the reason it’s more complicated is because you have a lot of different products.

You have more customization like you have bundle products in Magento and you don’t have that in Shopify. So it’s easier to integrate more simple products in Shopify. And it’s…by the way, it’s really good. The Shopify channels is one of the biggest features that we like, for Shopify. In Magento, you have to do a little more effort to do that. Let’s talk about…

This is one of our… For most of our clients…most of our clients use Magento. And the reason for that is they’re larger brands and they sell multi countries like they sell, for example, in Taiwan, in Europe, in Australia, in New Zealand, and in North America, right, U.S. So we like to… Our clients require a lot of customization. I want this country to have this functionality, this country to have that functionality.

And I all want it all in one system. I only want it in one system. In Shopify, if you use Shopify Plus you can have multi countries in the same platform. But there’s a lot of limitations. And if you have regular Shopify, not Shopify Plus, you literally have to make for every country a different website.

You’d have to register multiple Shopify accounts. And each one would be its own country if you really wanted some customization. So that is not good. So Magento is really good for customization, flexibility, scalability, and growing for more countries. Payments. Both of them are pretty similar, honestly. Shopify makes it easy to accept payments.

Magento has some out-of-the-box like PayPal, and Braintree, and things like that. So I would say they’re pretty similar. There’s more payment gateways, like the not less popular ones on Magento than Shopify, but Shopify has a pretty good list as well. So I think they’re pretty close. Integrations, there’s a lot of lists for both of them.

SEO friendliness. I would say they’re both pretty similar. Magento is slightly better in SEO because it’s open-source. It means you can customize anything. One of the things you cannot do in Shopify, you can’t change the robots.txt. You can’t change the URL structure of products, like, you can change the product name in the URL, but you can’t change the /product/collections.

You have certain limitations. And it’s an advantage and disadvantage, right? It’s more secure. You can’t change things, harder to make mistakes and break the site but you can customize less. So I really like Magento for the SEO itself. Security. Both are focused on security.

Shopify is slightly better. So I want to correct myself for a second. So they’re both strong security-focused. But the difference between both of them is, Shopify can be slightly better in security because Shopify is taking care of the security and you’re taking care of less security, because there’s less things you can customize, break, or ruin the security.

In Magento, there’s strong security, but aside from the core code, whatever you customize in the code because you’re adding extensions, you have to take care of it. So if you do a good job of security, they’re very…they’re similar, right? They’re both secure and good. Magento releases a lot of security updates which is a big one. But more of the security is on you as the company and more of the security is on Shopify.

So this is the big differences. If you know what you’re doing, website is good. If you outsource something and you find the bad company that doesn’t have security practices and you add an extension on Magento, you have more problems. So it’s really about who’s managing it. This is kind of the responsibility in the security. Both of them are very strong, and they’re both better than a lot of others like WordPress and others.

And this is the difference. Okay. So multi-region. This is why I talked about. This is basically my favorite, one of my favorite things for our clients. Magento is just beating Shopify in multi-region, multi-country, multi-language. The reason for this is when you…even if Shopify has some things for multi-region, you will…

Basically, every country has to follow mostly the same kind of function of the same kind of settings. Magento allows you for each country, each language to have complete different settings or shared settings. So, for example, in Taiwan, for example, the tax is included inside the price, right? So when you buy something for $100, the final price is $100.

But in U.S. when you buy something, the $100 would be maybe on the product, but then when you go to checkout, you have to pay plus, you know, for example, 9%. So you can easily in the backend setup settings for each country, this is the currency, these are the tax things, these are the promotions. And every single setting in the back-end has, you know, basically your settings themselves.

So for example, if I go here to store configuration in Magento and I want to set up my default…sorry, one second. I want to set up my default settings for the countries I allow to ship to, I can specify those.

So I go to any setting, and I change my country here and then I change the setting. There’s so many things you can do out-of-the-box without a developer and customize for every country, every currency. You can have so many things. So localization, right? So for certain countries, Shopify is really a build more for kind of, you know, North America and Europe, really, North America is the biggest focus and then Europe.

So we call kind of the Western world, right? So they’re more payment gateways, more integration, more apps, more things in English. With Magento, it’s also built for that same market, but because it’s open-source, and there’s such a big community, there’s more things that are fitting, for example, Asian countries or, you know, other countries that speak different languages, like, you know, Europe, French, German, etc., so you’re going to have more things for that.

Okay. B2B functionality. Magento is killing it. Magento functionality is a real B2B channel. Shopify with Shopify Plus, this is B2B channels in Magento Commerce only. And so with Shopify, you have to do Shopify Plus. Shopify Plus B2B channel is much more basic.

It’s pretty nice, honestly. But it’s much more basic in function. This is a real B2B business flow. And this is a basic B2B business flow. And I think Shopify will be improving that over time. Education. In order to start using, Shopify is easier to use for a user for the business to run, manage their products, promotions, orders, Shopify is a little bit easier.

Magento takes longer time to learn. And it’s because this is more custom, this is more easy. Reports. Magento Reports out-of-the-box are not good. Shopify has better reports out-of-the-box. But if you use Magento Commerce, then you have BI and you have a lot more things. And you can also customize your own reports.

So depends which version you use. Magento has full APIs. They have APIs, rest APIs, GraphQL, they have a lot of stuff. Magento also has the PWA functionality, PWA Studio. I’m going to add that right here. And then, Shopify has also a lot of APIs. Shopify Plus has all of the APIs.

And then you have really cool things. One of my favorite for Shopify Plus is called Shopify Flow, which…flow…which you can set up automation. So these are the things here. So I just want to say…provide a small recap, and then go to the last thing, which I gave some scores. So in general, I like both of them. Magento and Shopify are good platforms.

They’re a little bit different. So Shopify is mostly smaller businesses, and they’re trying to get into more mid-market. And Magento is more mid-market going more and more to enterprise. So they’re kind of different. Magento is open source. You can customize anything. You pay more money for that, right?

It costs more. It costs more for your developers. You have to do the hosting yourself. Shopify, you can customize less. They take care of more. It’s easier to maintain. It costs less.

It’s a little bit easier. So it really depends on what you’re trying to do. So let’s go over kind of this scoring that I gave it and then I want to have a summary. And then most importantly, you guys ask questions and I’ll be able to help more. So let’s look at this. Okay. So this is some score.

Now, what I did here is I gave out-of-the-box scores that fit a lot of projects, but depending on your requirement, you know, there’s going to be, you know, differences in this. Okay. Ease of use. I would say that Shopify is easier to use than Magento by a very default. And the reason for that there are less functionality.

You can customize less things. Functionality. There’s more… Magento wins. There’s more functionalities out-of-the-box than Shopify, especially Magento Commerce versus Shopify Plus. Customizable. Fully open-source.

I can customize more things. With Shopify, I can customize less. I need to use more apps. And I rely on those app makers to be reliable and strong, etc. Security. They’re both strong on security but again, you’re doing more of the security yourself on Magento. Shopify is doing more of the security on their end.

Uptime. They’re both pretty similar but more responsibility is on you. If you have a bad team, then you have less, you know, uptime. You have more problems. With Shopify, they’re really pretty good on the uptime. Website speed. Out-of-the-box, Shopify is a little bit better, especially because of themes they have.

Magento is not. You have to do a lot more effort from your server-side and your coding side to make Magento faster than Shopify. But obviously, if you’re professional, you know how to do it. So I would say out-of-the-box, slightly less. SEO. You can do more things. It’s fully customized.

You can customize more things. Here you have some limitations in Shopify, right? Support. For Magento Commerce and Shopify Plus, I would say they’re pretty the same. It’s not that… They have some pretty good support. Magento has been improving their support lately.

And I would say they’re kind of two out of three, both of them, pretty similar. Integrations. Depending on which business you are it’s a little hard one for me to do because I would say maybe Shopify is two to three, Magento Commerce has pretty good in a…sorry. For integrations, Magento has more integrations for mid-market.

For Shopify, there’s a lot more for small business. So for our business, I would say better for… If you’re medium, mid-market, Magento has better integrations. But if you’re small business, maybe Shopify is better. So this is kind of…both of them are kind of between two and three, but for mid-market Magento wins.

Release time to market. So if you are a new business and you want to release it, Shopify sites cost less, so cost less on average and they can be released to market quicker. Magento project costs longer, which means they take longer to build, which mean takes longer to release to market.

So this is my summary, everybody. So I really appreciate this. Let me know again in the comments what your specific requirement is, give me some examples. And I want the community to share more and to talk more about this so you can help choose it. Shopify is great. Magento is great. This is the reason why our agency only does these two platforms.

We really like both of them. They’re for different customers, depending where you’re selling, depending what you’re selling, who you’re selling to, and what you need to customize to have your business fit the platform and your platform fit the business. So hope you enjoyed this video. We’ll be making more and more comparisons. Let me know what you guys are looking for.

Appreciate all the videos and take care guys.

Magento Multi Source Inventory Introduction

Magento’s latest version 2.3.0 introduced a much discussed feature, Magento MSI, or Multi Source Inventory. It gives Magento more flexible, more capable inventory management functions that match Magento’s already powerful multi site capabilities.

In a sentence: Inventory is managed across multiple sources that are mapped to sales channels (aka websites) via stocks .

This gives businesses the ability to:

  • Track physical inventory across multiple physical sources
  • Implement more complex multi source (or Omnisource) fulfillment strategies

The New Concepts:

Salable Quantity

Without MSI, Magento has a single QTY value for all simple products. A purchase of a product deducted directly from that number.

MSI introduces a new figure, Salable Quantity, that exists in tandem with QTY. Essentially, it’s an intermediate calculation to ensure that you don’t oversell, while the QTY is maintained across at source level and only updates with shipments or returns.

In order to maintain an accurate salable quantity, reservations made against salable quantities with unfulfilled purchases. In terms of what you see in the admin panel, there isn’t much difference but this is one of the features that allows tracking of salable inventory across multiple channels/websites.

magento multi source inventory diagram

Sources

A core component of MSI, sources represent physical inventory sources. Sources will generally represent warehouses, brick and mortar stores, or drop shippers but can be structured according to individual business structures.

Stocks

Stocks are simply a tool to organize sources into groups according to business flows. Sales channels (websites) are mapped to one or more sources via stocks . Taking a simple example, if we have both a warehouse and a brick and mortar store that are capable of fulfilling US orders, we might assign both of these sources to a stock called “US Ecommerce,” which serves as our stock for our US storefront (website).

How They Add Up

Let’s take a look at the graphic again. Below we have a single warehouse, with a single online sales channel/website. Our source is called “Warehouse” and our stock is called “Bicycle Shop Marketplace.” Salable Quantity at the Stock level is determined by the Quantity at Source level, minus any thresholds we’ve set, minus any pending orders on eBay(note we’ve just grabbed the the magento graphic here – eBay can be considered a website here).

This is essentially the non-MSI magento stock setup, the only exception being that salable quantity is takes two thresholds into its calculation.

magento muli source inventory diagram - one source one stock and one website

Let’s say our sales are growing and we’ve decided to open a new UK brick and mortar store (Flagship store), and two EU websites: UK and Germany (DE).

These two new websites can have orders fulfilled with inventory from both our original warehouse and the new brick and mortar store. This is achieved by assigning these two independent sources to a single stock, “Bicycle Shop UK,” which in turn serves inventory for both of the new websites.

Orders from our eBay storefront continue to be fulfilled only by our warehouse.

magento msi diagram, two sources, two stocks and 3 websites

Continuing to grow, we open up a new US Brick and mortar store, and build a new US website.

Fulfillment for our other websites remains unchanged, but we’ve decided to fulfill orders for our new US website from the two previous sources, as well as our new brick and mortar store.

This is accomplished by creating a stock for the US website which has all three sources assigned to it. This brings us back to the full graphic:

Configuration Overview

*Editors note: we’re starting form scratch and not using the same source, stock and storefront names used in the above diagrams.

Below is a brief look at where MSI shows up in the Magento admin panel:

Sources:

Each installation starts out with a Default source that can’t be disabled. If you’re setting up multiple sources you can rename the default source to better reflect the warehouse or store that it represents.

The only mandatory fields for a source are Name, Code (development use), and Country. Additional fields for unique source contact info and location data that would be utilized for any distance-based source selection algorithm.

Due to the fact that sources are integrally tied to order and shipment histories, they can’t be deleted. However, they can be disabled with the same effect, removing them out from any fulfilment equation.

When setup is completed, your “sources” page should represent all your physical inventory sources as in our sample below (Three US and one Canadian):

Magento MSI manage sources configuration

Stocks

magento MSI stock admin panel navigation

Again, stocks are used for source organization and mapping, so different operation’s stock setup will be unique. In the below example, we’ve set up our “US Ecommerce” stock to represent two of our US sources:

As the object that connects sources to sales channels, both websites and and inventory sources are selected in the Stock view (in this case we’ve added Amazon to represent multi channel operations).

Note that, if multiple sources are assigned to a stock, the admin can drag and drop into a different order. This order is used by the default MSI Source Selection algorithm outlined below.

Source Selection Algorithms:

One of the MSI features with serious potential is support for Source Selection Algorithms which programmatically suggest optimal fulfilment sources for items in an order.

At the time of writing, the only out of the box algorithm in MSI is the “SSA Priority” algorithm for Magento 2.3, but expect updates with new versions soon.

The primary feature of this algorithm is that it prioritizes Sources in the order chosen by the admin on the “Stock” level through a drag and drop list.

In the below screenshot, two sources are assigned to our “US Ecommerce” Stock, and our Seattle Warehouse source will be prioritized by the Priority algorithm due to its position here in the admin.

The full priority algorithm follows this logic:

  1. Checks each source for virtual salable quantity in their assigned order at stock level (top to bottom)
  2. Selects source if a stock level is present (including any aggregate configuration and out of stock thresholds)
  3. Moves down the list to fulfill entire order
    1. E.g. if Seattle source has right socks and New York source has left socks and we’ve sold a configurable product, “Pair of Socks,” 1 simple product will be deducted from each source.
  4. Skips disabled sources assigned to stock.

Custom Source Selection Algorithms

Appealing to multi-channel sellers and larger operations is the potential to customize a source selection algorithm to optimize inventory logistics and shipping costs.

According to Magento:

Magento supports custom development and extensions to add alternative algorithms to prioritize sources. For example, you can have one priority algorithm based upon geography and another based upon expense of stock or a customer attribute. When the cost of stock changes, your implementation can easily change algorithms to ensure the lowest cost.

In other words, you can create the algorithm that’s most appropriate for your operations.

A couple other examples that might be factored into a custom Source Selection algorithm:

  1. Choose source based on cheapest shipping cost
  2. Choose source based on fasted shipping time
  3. Choose source based on national (tax) borders

Again, these more complex algorithms need to be written by third party developers at this point, but the most widely applicable calculations to be incorporated into future Magento releases.

Magento Paypal Rounding Error – Quick Fix

Recently we came across an issue of a paypal window not functioning on a Magento 1.7 site after a site-wide 40% Off promotion began. There are likely coding /extension fixes to this issue, but we thought we’d share the simplest way to address this issue when it’s preventing users from checking out.

The Issue: The item values do not add up to the subtotal given to Paypal. The individual item prices displayed did not match the real subtotal. Magento rounds each items price to two decimal points (for USD, EUR, and others).

So, two items discounted at 40% will look like this:

Original price: 2.99 x .6 = 1.794 Price Displayed: $1.79

Original price 3.99 x .6 = 2.394 Price Displayed: $2.39

This is fine, but the Subtotal displayed is $4.19

The problem is that Magento is adding the actual values (1.794 + 2.394) to get the subtotal. When Paypal receives an order like this, it rejects the request because it does not believe 1.79 + 1.39 = 4.19. It’s receiving each item rounded to two decimal points and a subtotal that’s been calculated with up to four decimal points. These are not always the same value.

 

The Quick Fix: Although this solution leaves you with the problem of inconsistent numbers, it’s a quick solution to getting Paypal to accept these transactions. All you need to do is stop feeding the individual item prices to Paypal.

This is done through System > Configuration > Payment Methods > Paypal Express Checkout. Select Configure and then select No on the “Transfer Cart Line Items” dropdown:

magento line items checkout

Disabling this causes only the total to be read and displayed in Paypal. Users will still finalize their transaction on the Magento checkout page, enabling them to view a price breakdown before actually paying anything.

Ultimately, this still leaves you with prices that add up to more than the individual product sums, so it’s worth finding a more comprehensive solution. However, we should just reiterate that the subtotal is actually a correct sum, it’s just more precise than a sum of rounded sums.