Page 13 - Blog
News, insights and resources from the world of e-commerce
- 10 min read
Although Magento 2 cookies may seem unimportant to users, they are essential for merchants. They help collect customers' personal data for marketing and analytics. But most importantly, they help maintain .
There are some basic Magento 2 cookie settings you can configure by default. They include Magento cookies policy, cookie lifetime, cookie consent bar, cookie restriction mode and others.
This guide teaches you how to configure Magento cookies properly and how to make them compatible with Google Consent Mode v2. There are also details on how to set up the cookie consent bar and add new cookies to track in Magento.
Key takeaways
Magento 2 cookies are used to keep track of customer sessions, analyse their behaviour, and provide personalised web browsing.
Magento cookie settings allow merchants to set up cookie lifetime, domain, cookie restrictions, and consent.
Magento collects essential (session id, customer authentication, customer group, consent, etc.) and non-essential (_ga, _gatihor
- 2 min read
Product page optimization is one task that is never crossed out of the eCommerce TO-DO list. You need to optimize , create more engaging images and update product information regularly to keep people coming to your store.
Product attributes, in particular, are essential on the product page since they hold a quick summary of the product details. However, unfortunately, Magento allows you to add new attributes to the storefront only in the More information product tab.
So, in this guide, you'll learn how to display current product attributes in the product short descriptions or any other place on the product page.
You can do that with the Current Product Attribute Widgets that com with the .
Add Сurrent Product Attributes to Product Description
To display current product attributes on product pages in Magento:
1. Navigate to Catalog > Products and chose a product to which you want to add current product attributes.
2. Scroll down to the product Short Description and press on Widgetsihor
- 1 min read
It is vital to keep track of all products you can sell, especially when managing . Magento provides multiple options for that, the most basic being . It reflects a sum of items from all sources and allows you to see how many products you have left.
However, there is no way to filter products by salable quantity in Magento. At least, there isn't an easy way to do that since most guides show you how to do it programmatically.
Since Extension offers you this feature by default, we want to share how easy it is to filter products from the admin panel.
To filter products by salable quantity in Magento 2:
1. Navigate to Catalog > Products and open the product Filters.
2. Find the Salable Quantity field, type the number you'd like to filter the salable products by and press the Apply Filters button.
Once you apply the filter, you will see the products with the salable quantity you've just entered in a corresponding field.
The next thing to do is to to increase the salable quantityihor
- 3 min read
No matter how hard you try to prevent your store's data from a sudden disappearance, there is always a slight risk of different attacks or system failures. No matter how well-organized your store operation is, anything from and to updating Magento can cause some data to get lost.
To prevent this from happening you need backups. And luckily, you can back up Magento 2 in multiple ways.
Today, you'll learn about each of them in particular, so a copy of all the necessary data is created and can be easily restored.
Pro tip: use to get notified about when there are sensitive backup files in the Magento directory.
Create Magento 2 Backup via Admin Panel
To create and schedule backups in Magento 2:
1. Go to Stores > Configuration > Advanced > System > Backup Settings.
2. Enable the backup by choosing Yes in the corresponding field.
3. Select Yes in the Enable Scheduled Backup field if you want to back up your data regularly.
4. Specify the Scheduled Backup Type. You've got 4 optionsihor
- 2 min read
Since Magento architecture is structured in a way to store data in different database tables, all data have to be reindexed when you make any changes to your store. And while you can or even the , this process is still time-consuming.
In this guide, we want to help you optimize the process.
Since the Catalog Category Product indexer takes the longest to execute we'll take it as an example for this article. So, you can optimize execution time by changing with batch_size of the Catalog Category Product indexer.
However, to get a better picture of how this works, let's define what is a batch size and why you need to modify it.
How Magento Reindex Works?
Batch size is a number of indexes that will be processed at a time, one MySQL query.
Imagine that you have a store with 40k products, and you do some changes, like , to all of your products. This will cause 40K indexes to be invalidated.
Magento splits data for reindexing in the following way:
Number of batches = number of indexesihor
- 2 min read
Providing high-quality service requires you to optimize multiple processes in your store, including order management. That being said, looking for certain order details might take some time, especially with hundreds of products.
Nevertheless, Magento allows you to eliminate the hard work. You can get order data by increment ID in Magento in multiple ways, the same as you can or .
So, in this article, you'll learn how to use each method.
Get Order Data by Increment ID Using Factory Method
The factory method is used the most frequently. Use the following code:
protected $orderFactory;
public function __construct(
\Magento\Sales\Model\OrderFactory $orderFactory
) {
$this->orderFactory = $orderFactory;
}
public function getOrderByIncrementId()
{
$orderIncrementId = 10000003;
$order = $this->orderFactory->create()->loadByIncrementId($orderIncrementId);
}
Get Order Data by Increment ID Using API Repository
Here is one more option. You might as well use the API repository to get order by incrementihor
- 4 min read
With thousands of blog posts appearing on the web monthly, simply writing good content is not enough to lure more readers in. You need to come up with something to set your content apart from others in search results. Fortunately, Google and other search engines have already introduced that "something". It is structured data.
Except for the BlogPosting article schema our already adds to the blog posts by default there is also a HowTo structured data. While the former merely tells Google that your content is a blog post, the latter makes your blog post eligible for rich results.
Today, you'll learn what exactly is HowTo schema markup, why you need it for your blog posts in Magento and how to add them easily with no coding skills.
What is HowTo Structured Data?
HowTo is a special type of structured data that helps you to define your content as a how-to, especially if your blog posts provide a set of steps for completing a task (including text, images and videos).
Marking yourihor
- 2 min read
Invoices are important elements of efficient . This is a special type of document containing all the order details that are of great importance for both a customer and a store.
In most cases, invoices are created automatically, based on the you have. But when it comes to printing, you have to do it manually. Fortunately, Magento allows you to print invoices in more than one way. You can either print a particular invoice or print several in bulk.
So, don't miss an opportunity to learn how to print invoices in Magento 2 using this guide.
Want to send order-related documents automatically? Attach PDF Invoices and other files to the sales emails using .
How to Print an Invoice in Magento 2?
To print an invoice in Magento 2:
1. Go to Sales > Invoices, choose the order you would like to print the invoice for, and press the View link.
2. Press the Print button on the top menu and the PDF file will be downloaded.
It really couldn't be simpler. However, if you want to print multiple invoicesihor
- 3 min read
Hello, Magento fans,
Eager to learn about the first news and updates digest in 2023?
Here we go.
New features of the !
As you know, a well-structured SEO strategy brings more revenue, the same as choosing the right tools. Our SEO extension is a must-have since it helps Google to discover, index and rank your store which brings more traffic as a result.
So, in the latest release, we’ve improved it for better results.
We’ve extended catalogue category pagination settings for SEO-friendly pagination pages. Besides, we’ve improved the meta title, description, keywords, H1 tag masks and crosslinks processor.
New features of !
Every SEO specialist would confirm that structured data is more than important for improved visibility on Google.
Product, organization, search bar and FAQ snippets are important, same as is the HowTo markup. That’s why we’ve added a new in the latest version of the Rich Snippets extension. With the ‘HowTo’ rich snippet widget you can easily drive moreihor
- 3 min read
Magento backorders allow customers to place orders even if the desired product is out of stock. That's a great feature since it prevents people from leaving their carts and moving to different stores. It comes in handy at times when the inventory hasn't been restocked, but you want to keep customers engaged.
Note: to prevent unexpected out-of-stock situations, you might want to enable to optimize your stock management.
Magento 2 allows you to set up backorders in two ways: globally or for a certain product. In this article, you'll learn how to apply both of these methods and tackle what backorders actually mean.
What are Backorders?
Backorder is a specific type of order placed by the customer when an item is currently out of stock. So, basically, you can buy an item the moment you visit the store. But it won't be delivered until it appears on the shelves again.
Store owners can benefit from the Magento backorders since they know what products are selling well and whichihor
- 3 min read
While working with Magento 2 you perform a wide variety of tasks from to configuring indexers and running . Magento CLI is a useful tool that not only enables you to run a variety of operations but simplifies Magento development in general.
However, you might get overwhelmed by running the same commands over and over again. That's exactly when Magento 2 command shortcuts come in handy.
Surprisingly, many developers don't know about this. So in this guide, we've gathered the and command shortcuts for your convenience.
SSH
Full command
Shortcut
php bin/magento list
php bin/magento l
Cache
Full command
Shortcut
php bin/magento cache:clean
php bin/magento c:c
php bin/magento cache:enable
php bin/magento c:e
php bin/magento cache:disable
php bin/magento c:d
php bin/magento cache:flush
php bin/magento c:f
php bin/magento cache:status
php bin/magento c:s
Setup
Full command
Shortcut
php bin/magento setup:backup
php bin/magento se:b
php bin/magento setup:config:set
php bin/magento se:c:seihor
- 4 min read
It's hard to overestimate the importance of making a customer's journey on your website as flawless as possible. If your store is easy to interact with, people will definitely want to come back. As it happens, lots of those interactions happen through the customer account.
That's why you have to make use of the Magento customer account configuration settings. So you can not only make engaging with your store easier but manage customer account options according to your requirements.
Want to track how many customers sign in or create an account on your store? Add to your store and get in-depth data reports on customers' behaviour.
The whole process may seem a bit complicated, considering the number of options Magento provides. However, in this article, we'll guide you through all the steps you have to take.
In order to configure customer accounts in Magento 2, navigate to Stores > Configuration > Customers > Customers Configuration. As you can see, there are a lot of sections you'll needihor
- 2 min read
Configurable products definitely stand out in the list of other . They come in handy when you want to provide your customers with multiple product options.
By default, Magento 2 doesn't allow you to assign the existing to the existing from the admin panel. The only option is to create a so-called placeholder in the configuration and then add the product you need instead of it.
That kind of solution is not really helpful, since it requires too many unnecessary steps. That is why a programmatic way to perform this task might of more use.
So, to add a simple product to a configurable product in Magento 2 programmatically, refer to the method below.
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$simple_product = $objectManager->create(\Magento\Catalog\Model\Product::class);
$simple_product->setSku('test-simple');
$simple_product->setName('test name simple');
$simple_product->setAttributeSetId(10);
$simple_product->setSize_general(193); // value id of S sizeihor
- 3 min read
Google search results are becoming more elaborate than ever to deliver the almost experience to searchers. If you know how to leverage it to your benefit you'll be able to drive more traffic to your store and establish a better relationship with search robots.
HowTo structured data is a markup you use to explicitly tell Google that your pages are how-tos. While it might not be among the most , it is quite important for content pages if you want to make them eligible for rich results.
Just like any other type of structured data, you will have to add the HowTo markup using JSON or microdata. To save from the hassles of code editing, we've added the HowTo rich snippet widget to the to help you add it directly from the admin.
Eager to find out how it works?
To add HowTo structured data in Magento 2:
1. Navigate to the page you'd like to add the HowTo markup to and jump to the Content section.
We've added the markup to the CMS page, but it could be a product, category, or any other how-toihor
- 7 min read
Managing can be overwhelming, especially when the holiday season is just around the corner. If you want to display different CMS blocks based on sales, be ready for a lot of repetitive enabling/disabling. Unless you use the Magento CMS Block scheduler.
In this guide, you'll learn how to schedule CMS blocks in Magento and see when it comes in handy.
Key takeaways
Magento CMS block scheduler is a tool that lets merchants schedule CMS content by time, customer groups, store views, or cart conditions.
The default Magento doesn't offer CMS block scheduler out of the box.
The extension by Magefan enables CMS block scheduler in Magento.
Magefan Extension also enables a scheduler for CMS pages.
What Is Magento CMS Block Scheduler?
Magento CMS Block Scheduler is a feature that allows merchants to show or hide CMS blocks automatically based on a predefined schedule or different cart or customer rules. It allows store owners to automate promotion campaigns and plan content for sales aheadihor
- 1 min read
While product attribute is an individual characteristic of a product, is a group of those characteristics that define a product. You will use product attributes every time when creating products in Magento.
If you need to create multiple product attributes, doing this via the admin panel might require a lot of time. So in case, you need to do it fast, create an attribute set in Magento 2 programmatically.
Note: before you create attribute sets you have to create product attributes. So you might need to have a look at our guide on .
Use the following code to create an attribute set programmatically. Create the InstallData.php file in the app/code/Vendor/Module/Setup/InstallData.php.
<?phpnamespace Vendor\Extension\Setup;
use Magento\Framework\Setup\InstallDataInterface;use Magento\Framework\Setup\ModuleContextInterface;use Magento\Framework\Setup\ModuleDataSetupInterface;use Magento\Catalog\Setup\CategorySetupFactory;use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory;ihor
- 2 min read
While creating new accounts, your customers have to fill in some of their personal information. Depending on the policy of your store, you can add or remove the fields that contain customer name and address data and set them up according to your needs.
are very flexible in this regard. So, in this article, we'll explain how to do that.
To configure customer name and address options in Magento 2, take the following steps:
1. Go to Stores > Settings > Configuration > Customers > Customer Configuration > Name and Address Options.
Note: You have to clear the Use System Values checkboxes to configure all the fields, or you can enable those checkboxes to use the default options.
2. Enter the Number of Lines in a Street Address. The default value is 2, however, you can use a different number on the scale from 1 to 4.
3. In the Show Prefix field, choose either Optional or Required to use the name prefix in the new customer account forms. You can disable the feature by choosingihor
- 2 min read
Product attributes are characteristics of a product that help you offer customers a wide range of options and influence their purchasing decisions. Once you , it doesn't end there. You can also use product attributes to define , cart price rules, , and multiple other options.
That being said, it is important for you to know how to create product attributes in Magento programmatically. Just in case you'll need to create multiple attributes faster.
To create product attributes in Magento programmatically create the InstallData.php file in the app/code/Vendor/Module/Setup/InstallData.php.
<?phpnamespace Vendor\Module\Setup;
use Magento\Eav\Setup\EavSetupFactory;use Magento\Framework\Setup\InstallDataInterface;use Magento\Framework\Setup\ModuleContextInterface;use Magento\Framework\Setup\ModuleDataSetupInterface;
class InstallData implements InstallDataInterface{ private $eavSetupFactory;
public function __construct(EavSetupFactory $eavSetupFactory) { $this->eavSetupFactoryihor
- 2 min read
It is crucial to use the correct technics to keep your clients engaged and drive more of them to your store. Since it all comes down to customer experience, you have to optimize all the processes during the customer's journey on your website, including customer account options.
Fortunately, Magento 2 gives you multiple features for the configuration of new customer accounts. And in this article, we'll provide more details about them.
To configure new customer account options in Magento 2 take the following steps:
1. Navigate to Stores > Settings > Configuration > Customers > Customer Configuration > Create New Account Options.
2. Choose whether to Enable Automatic Assignment to Customer Group.
3. If you chose Yes in the previous field, set the Default Group to which your customers will be assigned automatically.
Note: if you enable no customer will be created. So, no customer group will be assigned to them unless you .
4. Set the Default Value for Disable Automatic Groupihor
- 1 min read
Related products are one of the most common ways to drive more sales in e-Commerce. You have to manually or automatically through the to increase the average order value. But there is one more way. You can get related products collection in Magento programmatically.
So if you want to avoid monotonous manual configuration of related products in Magento, keep reading.
To get related product collection in Magento 2:
1. Create an Extension.php file at app/code/Vendor/Extension/Block folder.
<?phpnamespace Vendor\Extension\Block;
use Magento\Framework\View\Element\Template;use Magento\Backend\Block\Template\Context;use Magento\Framework\Registry;
class Extension extends Template{ protected $registry; public function __construct( Context $context, Registry $registry, array $data = [] ) { $this->registry = $registry; parent::__construct($context, $data); } public function _prepareLayout() { return parent::_prepareLayout(); } public function getCurrentProduct() { return $this->registry->registry('current_product');}ihor
- 3 min read
Magento 2 offers you outstanding features for stock management. Except for the global , you can also benefit from the advanced settings.
Thanks to the Magento advanced inventory, you can track quantities of multiple products and manage inventory more efficiently on a per-product basis.
Depending on your requirements, there are two ways to configure advanced inventory in Magento 2. You can either exclude stock management (short form) or include stock management (long form). The difference is in the number of options you can configure for an individual product.
In this article, you will learn how to configure Magento 2 advanced inventory using both of these methods.
To configure Advanced Inventory in Magento, go to Catalog > Products, choose a product you would like to set up advanced inventory for and press a corresponding button under Quantity.
Exclude Stock Management
1. Set the Manage Stocks field to No.
2. Complete the Minimum Quantity Allowed in Shopping Cart.
3. Specify theihor
