Page 2 - Monthly Archives: 2020
- 1 min read
As you may know extension by Magefan was integrated into the Magento 2.4.0 core, and we transferred the copyright for "Login as Customer" extension to Adobe. More about it you can read in the article about .
So if you use Magento 2.4.x or greater you have 2 options:
1. and use core Magento Login As Customer
2. Disable core Login As Customer and continue using original Magefan Login as Customer.
To disable core modules you can run these commands:
bin/magento module:disable Magento_LoginAsCustomerbin/magento module:disable Magento_LoginAsCustomerAdminUibin/magento module:disable Magento_LoginAsCustomerApibin/magento module:disable Magento_LoginAsCustomerAssistancebin/magento module:disable Magento_LoginAsCustomerFrontendUibin/magento module:disable Magento_LoginAsCustomerLogbin/magento module:disable Magento_LoginAsCustomerPageCachebin/magento module:disable Magento_LoginAsCustomerQuotebin/magento module:disable Magento_LoginAsCustomerSales
Since there are different Magento versionsihor
- 1 min read
This year Magefan is proud to be among the Silver Sponsors of an online MageCONF that will take place on October 24, 2020.
Mageconf 2020 is a must-attend online conference that allows you to dive into the world of unique shared experience presented by Magento expert agencies, service providers and developers, learn about the latest eCommerce trends and innovations.
Register now for free. Don’t miss it!
- 2 min read
Since Magento is a complex platform, it might be hard to cover all the sections on your own. You need to create other Magento admin users who will manage products, monitor orders and create email templates, etc.
However, you must grant each user access only to certain areas of your store to ensure high .
So today you'll learn how to create admin users in Magento and .
Magento 2: Create Admin User in the Admin
1. Go to Admin Panel > System > Permissions > All Users and press the Add New User button.
3. Fill out the new user Account Information:
Set the User Name that will be used during login, and specify the First and Last Names.
Enter the user's Email.
Create a Password, and confirm it in the Password Confirmation field.
Choose the interface for the user in the Interface Locale.
Note: we recommend choosing English since Magento has some issues in other locales. If you choose some other language make sure you of your preference.
Active new user in the This account is select box.
4ihor
- 2 min read
In case you use one of the Amasty extensions, e.g. Amasty Layered navigation, you may face the issue of the broken blog featured images after the upload.
We have found the issue in Amasty_Shopby extensions, that breaks some other extensions using image upload functionality, including our .
Amasty_Shopby in this file:
app/code/Amasty/Shopby/etc/adminhtml/di.xml
adds the plugin to Magento\Catalog\Model\ImageUploader model.
Judging from the code in the following file:
app/code/Amasty/Shopby/Plugin/Catalog/Model/ImageUploaderPlugin.php
it looks like some fix Amasty added for Magento 2.3.4. and the issue lies in the plugin beforeMoveFileFromTmp.
The original Magento MoveFileFromTmp declaration looks like this:
public function moveFileFromTmp($imageName, $returnRelativePath = false)
and Amasty's plugin missing the second parameter $returnRelativePath:
public function beforeMoveFileFromTmp(\Magento\Catalog\Model\ImageUploader $subject, $path)
So, basically, Amasty's plugin kills the second functionihor
- 1 min read
If you face an unexpected 301 or 302 redirect in Magento 2 and you don't know why it happens or what code causes it, you can easily find this out by temporarily editing the following files:
/vendor/magento/framework/HTTP/PhpEnvironment/Response.php
/vendor/magento/framework/Controller/Result/Redirect.php
Open Response.php and add the following line to the beginning of the setRedirect function:
var_dump($url); \Magento\Framework\Debug::backtrace(false, true, false); exit();
Example:
public function setRedirect($url, $code = 302){
var_dump($url); \Magento\Framework\Debug::backtrace(false, true, false); exit(); $this->setHeader('Location', $url, true) ->setHttpResponseCode($code); return $this;}
Now open the second Redirect.php file and add this:
var_dump($this->url); \Magento\Framework\Debug::backtrace(false, true, false); exit();
after each line containing:
$this->url =
Example:
public function setRefererUrl(){ $this->url = $this->redirect->getRefererUrl();ihor
- 1 min read
If you decided to remove , please follow the steps below. You can contact our team for a free consultation in case you have any issues with Magefan's extension.
Remove Extension Files
Removing files instruction depends on the way the Extended Product Grid has been installed in.
1. If you can find the extension files in the folder
app/code/Magefan/ProductGridInline
then remove this folder.
2. If the extension was installed via the composer and its files are located in the folder
vendor/magefan/module-product-grid-inline
then run composer CLI command to remove it
composer remove magefan/module-product-grid-inline
Once extension files have been removed, run these Magento CLI commands:
php bin/magento setup:upgradephp bin/magento setup:di:compilephp bin/magento setup:static-content:deploy
Note: if you don't want your website to be down during deployment, try these .
Remove Extension Data (optional)
Attention! This will clean all product grid editor data and configurations, etc.
1. Justihor
- 1 min read
If you need to update by Magefan, please follow the steps below.
Note: the updating instructions depend on the method the Extended Product Grid extension was installed with.
Update using composer
If the Extended Product Grid was installed via the composer (check if vendor/magefan/module-product-grid-inline folder exists), then you need to run these simple CLI commands in Magento 2 directory:
composer remove magefan/module-product-grid-inlinecomposer require magefan/module-product-grid-inline ^x.x.x# replace x.x.x with the version you want to usephp bin/magento setup:upgradephp bin/magento setup:di:compilephp bin/magento setup:static-content:deploy
Note: if you don't want your website to be down during deployment, try these .
Update using archive and FTP
If the Extended Product Grid was installed via FTP (check if app/code/Magefan/ProductGridInline folder exists), then follow these commands:
1. Download the latest version of the Extended Product Grid archive from magefan.com.
2. Extractihor
- 1 min read
You can install by Magefan, using composer or archive installation methods.
Installation via composer (recommended)
Please navigate to your Magefan Account > Downloads > Install via Composer to get the composer installation instructions.
Installation using archive and FTP
Download Extended Product Grid ZIP-Archive from magefan.com website (not GitHub or other sources).
Extract files.
Copy app folder from the archive to your Magento 2 folder.
In a command line, using "cd", navigate to your Magento 2 root directory.
Run CLI commands:
php bin/magento setup:upgradephp bin/magento setup:di:compilephp bin/magento setup:static-content:deploy
Note: if you don't want your website to be down during deployment, try these .
Once you have installed the Magento 2 Extended Product Grid extension you can start the .
- 1 min read
There are situations in Magento 2 when page keeps loading and then you get 500 fatal error, memory limit, or timeout error. This is an infinite loop in the PHP code, when the same code is executed over and over again. It is related to some core Magento issues or, most likely, third party extension.
To debug an infinite loop and find the loop entrance, please follow the steps below:
1. Open the app/bootstrap.php file and add this code right after PHP open tag <?php in the next line
$_SERVER['MAGE_PROFILER'] = 'html';
2. Open the vendor/magento/framework/Profiler.php file and add this code to the beginning of "public static function start($timerName, array $tags = null)" function, e.g.
private static $firsttime = null;
public static function start($timerName, array $tags = null){ if (!self::$firsttime) { self::$firsttime = time(); } if (time() - self::$firsttime > 10) { //10 - is seconds to wait \Magento\Framework\Debug::backtrace(falseihor
- 2 min read
In case you work with a lot of different Magento instances as a temporary project you might want to have a nice method to check debug backtrace of some function execution in Magento 2 quickly without installing or enabling additional software on the server, e.g. Xdebug.
In this case, you can use the native Magento backtrace function from \Magento\Framework\Debug class and call it whenever you need:
\Magento\Framework\Debug::backtrace(false, true, false);
As a result, you will get this nice HTML debug-backtrace:
You can also call the exit function to stop further code execution right after the backtrace.
Here is more information about the backtrace method:
/** * Prints or returns a backtrace * * @param bool $return return or print * @param bool $html output in HTML format * @param bool $withArgs add short arguments of methods * @return string|bool */ public static function backtrace($return = false, $html = true, $withArgs = true)
Additional Debug Backtraceihor
- 3 min read
Hello there, Magento fans!Summer is hot this year the same as the extension updates we've prepared for you. Are you ready?
will work even better on different Magento instance since we’ve improved the HTML parsing for WebP conversion. Also, from now on you should face no errors during manual webp converting via bin/magento magefan:webp:convert command regardless of your Magento version.
Integrated better compatibility with other lazy load extensions and notification messages about invalid WebP PHP GD library on the extension configuration page will allow you to benefit from improved WebP extension.
Blog extension is a great contribution to your store especially if it is our we continuously work on improving. This month we’ve fixed the errors appearing on Magento 2.4.x.
Besides, datepicker won’t save wrong data if using en_US locale in the admin panel since we’ve fixed that too. If you want to track the Magento 2 Blog extension improvements you check the extension .
ihor
- 1 min read
If you save a post in , your post is not saved and you are redirected to the Magento dashboard, most likely it happens when the post has a lot of related products or posts. This issue is connected with your server PHP configurations.
The max_input_vars PHP setting parameter defines the number of requests (posts) data PHP can receive. When a blog post has many related posts or products a lot of data goes with the request to PHP and it just doesn't receive part of this data.
In order to fix the issues with post saving:
1. Change the value of the max_input_vars parameter from 1000 to 5000 in the main php.ini file on your server.
2. Restart the Apache/Nginx or PHP-FPM if it is used.
Note: you need to have the superuser server permissions to be able to change this setting.
Once you change the max_input_vars parameter value the issue should be resolved. If it still doesn't help, please feel free to contact us and we'll assist you happily.
- 3 min read
Reasonable pricing is one of the milestones of a successful store. Not only does it improve your revenue, but encourages customers to buy more from you. You can set up special price, or offers discounts for the entire catalogue.
However, today we want to talk more about Magento 2 customer group pricing. It allows you to set different product prices in accordance with their quantity and . Yet, if you haven't had a chance to use this feature in your store, it's time to learn how to do it properly.
In this article, you'll learn more about Magento 2 tier pricing and how to apply it to the items you offer.
Shall we start?
Want to track price changes in your store? Get and display the lowest price over a certain period of time on the front end.
What is Magento 2 Customer Group Pricing?
Magento 2 Customer Group Pricing is the Magento feature that makes it possible to set discounts based on the customer group and product quantity.
In other words, it defines lower prices for different customer groupsihor
- 2 min read
Having your online store secure and with fewer bugs is one of the top priorities of each merchant. You can achieve it by updating Magento and .
It's a relatively easy task for the experienced developer. But updating an extension in Magento can be challenging if you perform it for the first time. So it's important to know the precise steps you have to take.
Note: the update instructions usually depend on the method used to .
Update Extension in Magento via Composer
If the extension files are located in the folder vendor/company/module-name, then the extension was installed using the composer. So you need to use the following steps:
1. Open CLI (Command Line Interface).
2. Navigate to Magento 2 root folder.
3. Run the following commands:
composer remove company/module-namecomposer require company/module-name ^x.x.x# replace x.x.x with the version you want to usephp bin/magento setup:upgradephp bin/magento setup:di:compilephp bin/magento setup:static-content:deploy
Note: if you don't wantihor
- 2 min read
Page Speed is taken very seriously by a lot of Magento stores since it directly influences your general website performance. That's why everyone constantly tries to improve it and looks for the best ways to do so.
In case you're checking your website speed in Google PageSpeed you can face the Serve images in next-gen formats issue. According to it, Google recommends you to save images in JPEG 2000, JREG XR and WEBP formats instead of old PNG and JPG. Best of all - WebP.
Never heard of it?
Find out more about what is WebP, why should you use it in your Magento 2 store and how is it different from PNG and JPG in this article about .
Implementing this Google recommendation gives you an advantage and allows to reduce the size of images by half.
Fortunately, there is no problem that wouldn't have a solution. So, to solve the Serve images in next-gen formats issue you have to install and enable the .
This module allows you to convert all current and future images into WebP fileihor
- 2 min read
Hello, Magento fans!
Since Magento is our favourite eCommerce platform and we all eagerly waited for Magento 2.4.0 release we are happy to bring the great news.
A Little Background
Our Extension made a great impact on Magento community. It's a valuable contribution to any Magento 2 store. That's why Magento got interested in adding it to Magento 2.4.0 core.
So, in the fall of 2019, Adobe Systems Incorporated, which owns the Magento platform, contacted us with an offer. Of course, we couldn't refuse, because Magefan are Magento fans.
Instead of writing new code from scratch, Magento asked about the integration, which we definitely supported.
Thus, we transferred the copyright for the "Login as Customer" extension to Adobe. Then in early 2020, we worked with the Magento Community Engineering Team on integrating our module into the Magento core. The module came out with code improvements and some new features.
What's New in Login as Customer?
Now Magefan Login as Customer extension isihor
- 1 min read
If you use with attached featured images to a blog post but these images are not displayed on the storefront, then most likely the issue is in your theme. A lot of themes provide custom blog layouts and template files that override the original view and can miss some blog functionality like featured images. To check and fix this, please follow steps below:
1. Open this file if exists (if does not exists skip steps 2-3):
/app/design/frontend/[ThemeVendor]/[themename]/Magefan_Blog/templates/post/list/item.phtml
2. Check if the file has the code like "getFeaturedImage". You can find the original code here
https://github.com/magefan/module-blog/blob/master/view/frontend/templates/post/list/item.phtmlhttps://prnt.sc/tcl3sj
3. If this code is missing, add it to your custom theme file.
4. Open this file if exists (if does not exists skip steps 5-6):
/app/design/frontend/[ThemeVendor]/[themename]/Magefan_Blog/templates/post/view.phtml
5. Check if it has the codeihor
- 3 min read
Magento development requires a lot of effort, especially when working with templates. Thus when you or override existing theme files, you need to know the exact location of the templates.
Since endless searching in the code won't suffice, you need some tips — Magento 2 template hints. So, in this article, you'll learn how to enable the Magento template path hints for admin and storefront in two different ways.
Before we get to the methods of enabling template path hints in Magento, let's define what they are first.
What are Magento 2 Template Hints?
Magento 2 template hints are the tips that help you define a .php block class or a .phtml template that corresponds to a specific page area on your Magento 2 store.
In other words, template path hints add a notation with the path of each template to help you locate the .phtml files more easily and edit them faster correspondingly. You can locate the code in the Magento file structure both on the frontend and the admin.
There are two ways toihor
- 1 min read
Magento 2 Canonical Meta Tags are tags used in the HTML code of the page in order to define the original content URL to avoid duplication issues.
That is why it is important to set canonical tags for your pages to improve your blog SEO.
In order to use canonical meta tags for your blog pages navigate to Stores > Configuration > Magefan Extensions > Blog and find the Search Engine Optimization section. There choose pages you want to Use Canonical Link Meta Tag For.
Once you finish don't forget to Save Config. As an alternative, you can enable canonical tags for blog and other website pages as part of the .
- 1 min read
In case you use extension and face the issues of double canonical tags on blog pages know that it most commonly happens because you use some third-party SEO extension. And that SEO extension adds the additional canonical URL for your blog pages.
If the SEO module you use is Mageworx SEO extension you need to go to Stores > Configuration > Mageworx > SEO Base > Canonical URL Settings and set the following items in the Canonical URL won't be added for those pages:
blog_index_indexblog_post_viewblog_category_viewblog_archive_viewblog_author_viewblog_tag_view
Once you add them, the second canonical URLs won't be set for blog pages and the native blog canonical URLs will be used.
In case you use SEO extension provided by some other company we recommend you to contact them and ask to provide documentation or guidance on how to remove the canonical URLs set by their extension from Magento 2 blog pages.
We also recommend you to use only native or to build correct canonical URLsihor
- 2 min read
If you decided to remove , please follow the steps below. You can contact our team for a free consultation in case you have any issues with Magefan's extension.
Remove Extension Files
Removing files instruction depends on the way Multi Blog extension has been installed in.
1. If you can find the extension files in the folder
app/code/Magefan/SecondBlog
then remove this folder.
2. If the extension was installed via the composer and its files located in the folder
vendor/magefan/module-secondblog
then run composer CLI command to remove it
composer remove magefan/module-secondblog*
Once extension files have been removed, run these Magento CLI commands:
php bin/magento setup:upgradephp bin/magento setup:di:compilephp bin/magento setup:static-content:deploy
Note: if you don't want your website to be down during deployment, try these .
Remove Extension Data (optional)
Attention! This will clean all Multi Blog configurations.
1. Just in case please make a full backup (dump) of your Magento 2ihor
