Magento, Magento 2, PHP

Magento2: How ScandiPWA leverages the Magento stack to make your life easier

Since the very beginning, ScandiPWA was created as a Magento-first PWA solution.

By being tightly coupled with the Magento 2 backend, ScandiPWA stands out from the competition and providing a powerful experience for both merchants and developers.

Here are three simple examples why it is not necessary to reinvent the wheel to get the best PWA solution for your Magento store.

Handling Redirects

Think about 301 redirects. Dealing with redirects is a very common issue for everyone working in eCommerce. There are plenty of reasons why one should set up a redirect — an outdated link shared on social media, disabled product or category, website structure change — you name it. So how should a good PWA solution handle 301 redirects? And what happens when a user clicks the outdated link?

In case of ScandiPWA, the first hit always goes to the core Magento installation. The website then redirects a user from the old URL to the correct one based on the redirect rule specified in Magento backend. As a Magento-first PWA solution, we should not worry about where to land a user since website managers can set up any redirect rules in their Magento store backend themselves — a backend they are already familiar with.

So why is this an advantage? Think of other Progressive Web App solutions available out there — the ones that built their PWA solutions as separate storefronts. With a separate storefront, you have to capture all incoming requests and figure out how to land a user to the correct URL address. Unlike ScandiPWA, these solutions do not have any direct relationship with the Magento backend and they only speak with the website’s database.
Of course, it is always possible to build a workaround, but why choose a solution that must be rebuilt?

Template loading

Another great example that demonstrates Magento’s and ScandiPWA’s synergy is how ScandiPWA handles the template loading.
As you know, Progressive Web Apps are known for almost instant page loading speed. To provide a seamless user experience we have a system of placeholders in place, but we might not always know what kind of placeholders must be used. There are different types of placeholders for CMS pages, category pages, product pages etc. In case of ScandiPWA, we can ensure a seamless user experience relying on the data on what kind of template is expected to be loaded, sent from the Magento server.
When using “storefront-based” PWA solutions, such mechanisms must be built from scratch.

Shopping cart price rules

Shopping cart price rules is an essential functionality every eCommerce website may want to use, as it’s a great way to reward customers with discounts.
Magento made it simple to work with price rules. All you need to do is create a cart rule, add some rule information, apply conditions, actions, and eventually get your shopping cart price rules running on your eCommerce website.

Being a tightly integrated solution with Magento, ScandiPWA is ensuring that all these features will work out of the box without putting in a lot of effort. To keep it short, ScandiPWA is simply querying a “price object” based on the user’s selection and Magento returns the correct price based on rules that were previously created in the Magento backend.

If middleware is used, as with other PWA solutions, and NoSQL database in between, it is first required from a user to create the price rules in Magento, and then one should think how to sync these rules with the middleware, sync with NoSQL database. In other words, some extra data structure must be developed to uphold all these complexities Magento has already spent a great amount of time to build.

Conclusion

Here at ScandiPWA believe it is crucial to make things right from the start. By being a part of the Magento stack, ScandiPWA ensured a major reduction of complexity of PWA solution by relying on the tools that were already built by Magento. Tools, that has proven to be working seamlessly, and are well-known to merchants and developers.

Referance: https://medium.com/progressivewebapps/how-scandipwa-leverages-the-magento-stack-to-make-your-life-easier-c885f798aa43

Tags :