Page 12 - Blog
News, insights and resources from the world of e-commerce
- 1 min read
Although CMS blocks are managed directly from Magento admin using widgets there are other ways to .
If you have some technical skills you can just call CMS block in Magento using the XML file.
Call CMS Block Using XML File
Use the following code to add CMS blocks using Magento 2 layout XML:
<referenceContainer name="content">
<block class="Magento\Cms\Block\Block" name="unick_block_name">
<arguments>
<argument name="block_id" xsi:type="string">my_cmsblock_identifier</argument>
</arguments>
</block>
</referenceContainer>
You need to replace "my_cmsblock_identifier" with your CMS block Identifier or ID (we recommend using Identifier).
Display CMS Blocks Dynamically (by Date)
Even if you add CMS blocks programmatically using the XML file, they will still be static. It means that you'll need to replace the identifier or disable a block manually. But not if you use the .
This way, you can display your CMS blocks dynamically, by different dates, times and days of the week.
But that'sihor
- 9 min read
Magento 2 static blocks are a great way to drive customer's attention to certain products, offers, or services. Although creating is super easy, adding them to pages is quite a challenge.
All because there are different ways to insert CMS blocks in Magento. Everything depends on how and where you prefer them to appear.
This guide covers the main tools and locations to add static blocks, including how to display them dynamically: by custom group, date or other conditions.
Key takeaways
You can display CMS blocks in Magento through category settings, widgets, the WYSIWYG editor, and page builder.
Category settings are the fastest way to add banners in Magento, but they allow placement in predefined areas only — at the top of the category, near the description.
Magento widgets are the most popular method to insert CMS blocks since they give full control over the pages and containers where the block will appear.
The WYSIWYG editor and Page Builder let you add blocks directly into page contentihor
- 2 min read
When it comes to purchasing decisions, customers pay attention to a lot of things in your store. Loading speed is one of the most important ones. While you can improve website speed by enabling lazy load or images or disabling the JS bundling, it is not always enough.
In this guide, you'll learn how to lazy load CMS blocks in Magento using the and Pages Extension.
CMS Blocks Display Modes
We've created two CMS pages with the same content: a banner and a product slider. One page contains a CMS block with default display mode, second — a CMS block with display mode Ajax load on first scroll.
Now, let's compare display modes Default and Ajax load on the first scroll.
CMS Block - Products Included In DOM
CMS Block - Products Loaded Via Ajax Request
Param
Default mode
Ajax load on first scroll mode
Page Size
26.2kb
15.9Kb
Time To Load Page Content
783 ms
591 ms
DomContentLoaded
1.43 s
1.11 s
Page Load
3.13 s
2.58 s
Page speed score is better if some elements like sliders, and widgetsihor
- 5 min read
Even though you improve and focus on getting more organic traffic, sometimes you need to change your approach to increase conversions. While SEO will help you to drive traffic to your store, it doesn't guarantee this traffic will bring conversions.
So, if you want to improve the conversion score, since there are people who browse your website but buy nothing, you've landed on the right page.
Today we want you to learn more about Google Ads Dynamic Remarketing and help you to set it up for your store with .
Before we start, let's define what dynamic remarketing is and how it is different from remarketing.
What is Google Ads Dynamic Remarketing?
Google Ads dynamic remarketing is the campaign you can set up to display personalized ads to people who visited your website previously but didn't make a purchase.
Unlike remarketing, dynamic remarketing allows you to go one step further and display ads with products and services people visited.
A great advantage is the dynamic remarketingihor
- 2 min read
If you're a Magento developer, you certainly know that effective store management often requires programming work. There are lots of tasks you need to perform — from running static content deploy and to and media URLs. Some of these are rather time-consuming or even complicated at times.
However, it is much easier if you know the proper methods to use.
In this article, in particular, you'll learn how to get media URLs in Magento 2.
Get Media URL Using Dependency Injection
The dependency injection method is among the most common ones when it comes to getting media URLs in Magento.
So, to apply it, go to your phtml block file and create a _construct function:
public function __construct ( \Magento\Store\Model\StoreManagerInterface $storeManager ) { $this->_storeManager = $storeManager; }
After that you can get a media URL in your phtml file:
$mediaUrl = $this ->_storeManager-> getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_MEDIA);
echo $mediaUrl;
Get Media URLihor
- 2 min read
The began on February 24, 2022. It was a day that changed us and our way of living. We thought these terrific events would last for a few days or at least a . Unfortunately, this horrible war that has already taken so many lives of adults and children has lasted for a and is still not over.
Donations have become a part of Ukrainians’ ordinary lives throughout this year.
And Magefan is not an exception. Our company keeps working and donates to the humanitarian aid organizations.
Here are some main foundations we support with our monthly donations.
Comeback Alive Fundation
Comeback Alive is one of the biggest Ukrainian charitable foundations. Ukrainians and people from around the globe had donated to this fund over 140 million dollars since February 24, 2022. The main project of this fund is Army Assitance. This is also one of the first charity funds that has been providing army assistance since 2014 when russia first invaded Ukraine.
Prytula Foundation
Prytula Foundation is anotherihor
- 2 min read
Creating and adding different ensure visitors can find relevant content on your blog faster. However, it is equally important that readers can navigate through your blog post content. One of the best ways to achieve that is Post Contents.
In the Magefan's , post contents is generated based on the <h> tags and added through a widget. So, today, you'll learn how to do that.
Note: Blog Post Contents feature is available only in the edition.
How to Add Contents to Post Content?
1. Navigate to Content > Blog > Posts and choose a blog post you'd like to add the contents to.
2. Jump to the Content section and click on widgets.
3. Choose Magefan Blog Extra Extension - Blog Post Contents as a Widget Type and press Insert Widget.
Don't forget to Save your post and check the contents on the frontend.
However, if you want to display post contents in the sidebar, keep reading.
How to Add Contents to Blog Sidebar?
1. Go to Content > Blog > Configuration > Sidebar > Post Contentsihor
- 4 min read
Hello, dear friends,
We are ready to share with you the first news and updates digest of spring 2023. A lot of great updates from Magefan this March. Let’s start!
New features of the !
Big updates to our bestseller – Magefan Blog! We added an option to set a custom blog category canonical URL. Another great addition — is an option to reset extension configuration options to use system values.
We also updated some localization vocabularies and improved import for Hubspot Wizard and via CSV. We made some design improvements for compatibility with different themes. New PHP 8.1 code compatibility changes was added too.
We have also fixed the "Previous" and "Next Post" links that lead to the wrong articles.
New features of !
We changed the default value for the "Apply By" option. We also removed the option "Assign Product With Attributes" from the category. Now, this option is hidden and for technical use only.
In this version, you will also be able to rename categoriesihor
- 2 min read
XML sitemap is one of the most important SEO concepts that helps to get your pages crawled and indexed. Think of it as a roadmap for search robots who need to discover new "routes" (pages) while crawling your website.
As you might know, Shopify generates a sitemap.xml file with all the product images, pages and collections automatically. However, in our we have our custom blog XML sitemap and in this guide, you'll learn how to find and configure it.
How to Find Shopify Blog Sitemap?
Your blog sitemap will always be available via the following path by default:
https://your-shopify-domain.com/a/blog/sitemap.xml
You can also find the direct link in the sitemap configuration section which we're covering below.
Note: if you've changed your app proxy — /a/blog/ — the sitemap path will be different.
Once you find your blog sitemap you can submit it to Google and other search engines.
Google Search Console Throws Errors
Sometimes it happens that Google Search Console can readihor
- 8 min read
If merchants need to announce special offers, show banners, or just make their pages more engaging, they need Magento CMS blocks.
These blocks can be easily created directly from the admin panel. However, as the number of blocks grows, managing them efficiently may become challenging.
So, in this article, you'll learn how to create CMS blocks in Magento, what they are used for, and how to make the most of their usage. We'll also cover how to for better block management.
Key takeaways
Magento 2 CMS blocks are reusable content units that can display text, images, videos, links, buttons, and widgets across multiple locations on your website.
The blocks can be added to CMS, category, product, cart, checkout and other pages.
Widgets are the most flexible method for displaying static blocks on any page or layout position.
Unlike CMS pages, CMS blocks do not have their own URLs and are designed for repeated use.
The static blocks support localisation and store-view-specific content.
By defaultihor
- 5 min read
Magento 2.4.6 has been launched on March 2023. It features scalability and performance enhancements, over 300 quality fixes and updated core composer dependencies and third-party libraries.
In this guide, you'll learn about the Magento 2.4.6 release notes and the patch versions before you .
Magento 2.4.6 Release Notes
Magento gets better with each version. So 2.4.6. definitely has a lot to offer. Let's dive into the most important , performance, and usability updates.
Platform
For high performance Magento 2.4.6 introduces support for PHP 8.2 (PHP 8.1 will continue to be supported).
Composer 2.2.x support
OpenSearch 2.x support
Redis 7.0.x support
Compatibility with ElasticSearch 8.x and MariaDB 10.6
Updated outdated JS libraries and removed outdated dependencies
Security improvements
This release contains 8 security fixes, even though there are no confirmed attacks to date. Most of them are related to the admin panel since it's the first thing the attacker would target. So the followingihor
- 4 min read
Want to improve navigation through your blog, display some popular posts on all blog pages or enable search? In this case, you need to add the Shopify Blog sidebar. Magefan features 7 different blog sidebar elements including posts, categories, search, archive and others. The biggest benefit is — you don't need to know any coding to enable them. Just click a few buttons and that's it.
So, today you'll learn how to configure each sidebar widget to improve customers' experience on your blog.
To add Shopify blog sidebar you need to navigate to Apps > Magefan Blog > Configuration and find the Sidebar section. Here you can enable and configure all Shopify blog sidebar widgets.
Note: each sidebar widget has the Sort order option. It defines the position of the widget in the sidebar. The lower the number, the higher the widget will be displayed in the sidebar.
Search Form
Here, you only need to enable the form, set the Label and the Sort order for it. The advanced algorithmihor
- 9 min read
At a time when online shopping is at its peak, a Magento free shipping offer is one of the best ways to reduce cart abandonment, encourage customers to buy more, and increase sales.
A lot of Magento stores actively use this marketing technique, along with other , as one of the greatest ways to attract customers. All because free shipping may be applied to a certain kind of product, items total, or a particular group of items.
In this article, you’re going to learn how to set up and optimize Magento 2 free shipping promotions. We'll also share helpful tips to make your shipping strategy even more effective.
Let's begin.
Why Free Shipping in Magento Matters?
Shoppers often hesitate when finishing the checkout when they see unexpected shipping costs in their carts. Yet, if you remove or modify this burden, you can unlock a wide range of advantages.
Boost in conversions
Don't be surprised to hear that free shipping is an effective strategy to encourage customers to buy more. No hidden costsihor
- 3 min read
Blog comments are one of the best ways to keep your blog readers engaged. They help you to build trust, keep a dialogue with your audience and get ideas for your future blog posts.
Unlike many other apps, which require additional Shopify blog comment apps to enable comments, our comes with three comment types out of the box.
Today we'll discuss all of them so you can choose which type of Shopify blog comments to choose for your blog.
Shopify Blog Comment Types
Since blog comments are related to a , you can configure them in the Post Page (Post View) section. For that go to Apps > Magefan Blog > Configuration > Post Page > Comments. Here you can disable blog comments or choose which type to use.
Magefan Comments
To configure Magefan comments in Shopify you need to specify the Number of Comments and the Number of Replies you want to allow. If you go with this comment type you will be able to approve and edit Shopify blog comments.
This is how Magefan blog comments will lookihor
- 2 min read
Creating great content is not always enough to get ranked high in search. Except for the SEO-optimized content, you need to configure , canonical tags, breadcrumbs, metadata, rich snippets, etc. Shopify blog URL structure is also one of the important factors to pay attention to.
Our offer you very flexible URL settings. So you can create SEO-friendly blog URLs. Today we'll discuss how you can configure blog URLs and change them when needed.
Note: the option to change blog pages paths is available in the plans.
Blog URL Structure
To configure the Shopify Blog URL structure:
1. Navigate to Apps > Magefan Blog > Configuration and scroll down to the Permalink Settings section and set the Blog Route.
Note: if you want to keep the /a/blog/ path in the blog URLs you can leave Blog Route empty.
2. Define Post Path Schema. Available variables here: {|{parent_category}}, {|{id}}, {|{year}}, {|{month}}, {|{url_key}}.
e.g. some examples of the blog post URLs include:
https://myshopify.com/a/blog/post/best-hotels-in-dubaiihor
- 2 min read
Categorizing helps to make navigation through your blog easier, especially if you cover different topics. makes it even more convenient since you can not only create categories but add them to the sidebar category tree for better navigation.
In this article, we'll discuss it in more detail. However, if you prefer to follow video instructions, jump to the bottom of the article.
To create blog categories in Shopify:
1. Go to Apps > Magefan Blog > Categories and press the Add new category button.
2. Give your category a Title and write a description in the Content section.
3. Change the Status to Active.
4. Specify whether to Include a category in the sidebar.
5. Set the Parent category for your category. If a category you're creating is to be a parent category, just leave this field empty.
6. Choose whether to Show child categories in the sidebar.
7. Set the category's Position. It defines the place of a blog category in the sidebar. The lower the number, theihor
- 4 min read
Creating blog posts is harder than it sounds, and it's not only about the content or keyword research. The tools you use to create a blog in Shopify matter too. In case you're tired of ineffective drag-and-drop page builders and want to create Shopify blog posts easier, you've landed on the right page.
Today you'll learn how to create blog posts in Shopify with a handy .
Before you begin working with your first blog post, note that you need to . It defines whether certain elements (e.g. related posts, view count, etc.) will be displayed on the blog post page.
Then to add a blog post in Shopify navigate to App > Magefan Blog > Posts and press the Add New Post button. And here's when we begin.
Step 1: Set a Date and Category
The basic Shopify blog post information includes the Status, Publishing date and Category it belongs to.
Once you start creating the blog post, it's in the Draft status. We recommend keeping it this way till you finish creating your blog post.
Note: if you wantihor
- 2 min read
Even though Magento 2 is a very flexible and easy-to-manage eCommerce platform, operating an online store may be rather challenging sometimes. Same as , getting products by ID is certainly a crucial skill.
Since it is one of the most frequent operation ones comes across when working with Magento, you have to know how to do it. There are a few ways to do so, and in this article, you'll learn how to use each of them.
Get Product by ID Using Factory Method
The most common way to get a product by ID in Magento 2 is to use the factory method. To do that, use the following code:
protected $_productFactory;public function __construct( \Magento\Catalog\Model\ProductFactory $productFactory) { $this->_productFactory = $productFactory;}
After that, get the product by ID, by executing the below command.
$product = $this->_productFactory->create()->load($id);
Get Product by ID Using API Repository
API repository is the other method you can choose. Execute the following code to get product objects:ihor
- 2 min read
Speed optimization is one of the ultimate goals of every store. That's why when trying to , you'll definitely come across lazy loading, one of the best ways to optimise images.
For those of you who don't know , it is a loading technique that helps you to load only images available within users' viewport. This helps to improve page loading and deffer unnecessary resources.
Image lazy load configuration is not that hard but you might sometimes encounter issues with configuring the lazy load of CSS background images. And that's what we'll be working on today.
How Do Lazy Load Extensions Work?
Before moving any further we need to revise the basic principle used in Lazy Load extensions to learn how to apply it to the CSS background images.
By default browser loads an image added in the src attribute of the image tag during page load:
<img src="image.jpg" />
e.g. so if your page has 50 images added the same way, as described above, all of them will be loaded at once during pageihor
- 4 min read
Hello, Magento fans,
Catch the news and updates that took place this February. The winter is almost over, so get ready for the sunny days and new great things from Magefan.
New features of the !
Saving time while updating Magento catalog is key to effective management. And dynamic category is a perfect tool for improving the creation and updating of categories.
Now, it works even better, since we’ve improved compatibility with Magento Commerce and Commerce on Cloud.
Besides, we’ve fixed an issue with the Idle (backlog items) appearing repeatedly because of the enabled "UPDATE BY SCHEDULE" index mode. The SQL error on the dynamic product attribute value update that appeared on Magento Commerce is fixed as well.
New features of !
If you’ve planned on displaying product attributes in the description, you can now do that with the widget we’ve added.
We’ve also fixed the display issue on the store view level — displaying custom product tabs on different store views is even moreihor
- 2 min read
February 24, 2022.The day when the full-scale war started changed the lives of all Ukrainians and the world. Since 2022, February 24 is not just another day on the calendar. For us, it’s the beginning of a new era.We thought it would last for a few days or just a few weeks. And these few days turned into 365 days of war and it's not over. Every day of this war is hard less or more for each of us.
Although the first days were full of fear, tears and ignorance, we began to act and fight. We united in one strong nation, one big family that could resist anything.We'd like to share how the lives of our team members changed this year.
Viktoria:
"If I say that 2022 was a difficult year, it won't cover even a tiny bit of all the horrors we, Ukrainians, had to face. I consider it to be a turning point in my life that made me sort out my priorities and become much more mature. At the same time, I fell in love with our country, culture and people all over again. This is why I know thatihor
