Page 2 - Monthly Archives: 2018
- 2 min read
Since Magento offers you sophisticated tools for pricing and discounts, targeting specific customers or products is much easier. However, sometimes the necessary attribute is missing from the rule conditions, whether you're creating a cart price rule or .
Don't rush to give up on the idea of creating a custom catalogue rule or product labels. You can fix this and we'll show you how.
Why Attribute is Missing in Rule Conditions?
You to assign certain characteristics to a product. While we're focused on the type of attribute (text, dropdown, etc.) and how it's displayed on the frontend we overlook other useful options.
So the reason why an attribute is missing from rule conditions in Magento is one disabled attribute option.
How to Add Attribute to Sales Rules?
Once you know what attribute to add to the rule conditions, navigate to Stores > Attributes > Product and select it from a list. Then switch to the Storefront Properties tab and enable the Use in Promo Rule Conditions option.
Save yourihor
- 3 min read
Imagine that a customer comes to your support reporting an issue with placing an order. What do your support managers do first thing? Request customer's login details to check the issue "from the inside out". Then enter those details and log into a customer's account.
While it doesn't seem that long, requesting and entering login credentials takes a lot of time. It would be much faster to just log in as a customer without all those details, wouldn't it?
makes this possible. So, today you'll learn everything you need to know to log in as a customer in Magento and monitor the process to avoid issues.
Important note: Magefan Login as Customer Extension was . So, if you have issues you need to disable either our module or Magento login as a customer feature.
Configure Login As Customer Extension
Before you get to the main part, you need to fill out a few Login as Customer settings. For that navigate to Stores > Configuration > Magefan Extensions > Login As Customer.
General
1ihor
- 1 min read
If you don't want to , the other way is to run reindex via CLI.
To using CLI (Command Line Interface), navigate to your Magento folder in a terminal and use the following command:
php bin/magento indexer:reindex
It will reindex all indexes. Here is an example of the successful reindex execution:
Design Config Grid index has been rebuilt successfully in 00:00:00Customer Grid index has been rebuilt successfully in 00:00:00Category Products index has been rebuilt successfully in 00:00:01Product Categories index has been rebuilt successfully in 00:00:00Catalog Rule Product index has been rebuilt successfully in 00:00:01Product EAV index has been rebuilt successfully in 00:00:02Stock index has been rebuilt successfully in 00:00:00Product Price index has been rebuilt successfully in 00:00:01Catalog Product Rule index has been rebuilt successfully in 00:00:00Catalog Search index has been rebuilt successfully in 00:00:02
In case you need to reindex some specific index type, please use its nameihor
- 2 min read
Magento is one of their most popular eCommerce platforms that continues to release new versions with updates and bug fixes.
To keep up with the pace of your competition, benefit from new features, and keep your store safe, you have to regularly. However, before you you should be aware of the version you currently use.
That said, there are several ways to check Magento version. In this article, we'll look into each of them in detail.
1. Check Magento version via Admin Panel
For starters, we can check Magento 2 version from the admin panel. To do that, log into your Magento admin panel and scroll down to the footer. You'll see your Magento version in the bottom right corner.
2. Check Magento version using CLI
Besides, you can check Magento version via the command line. To do this navigate to your Magento 2 root directory and run the following command:
php bin/magento --version
The result should be the following:
Magento CLI 2.4.6
3. Get Magento version programmatically
Here is another optionihor
- 1 min read
When you run Magento 2 CLI command "bin/magento ..." and get the error:
Allowed memory size of xxxx bytes exhausted (tried to allocate xxx bytes)
You can easily fix it using this command instead of bin/magento:
php -dmemory_limit=-1 bin/magento ....
Examples:
php -dmemory_limit=-1 bin/magento setup:upgrade
php -dmemory_limit=-1 bin/magento setup:di:compile
This error is related to the memory limit configuration in PHP. Parameter -dmemory_limit=-1 allows to run PHP in the CLI without memory limits.
You can also change memory_limit configurations (php.ini file).
- 1 min read
In order to migrate AheadWorks Blog for Magento 1 to Magento 2 Blog please install extension. After that, navigate to Admin Panel > Content > Blog > Import and choose the Import from AheadWorks M1.
To import Aheadworks Blog from Magento 1 to Magento 2:
Set a Database Name and User Name.
Enter a database user Password.
Set a Database server host (location of a database) in Database Host field.
Set a Table Prefix if there is one.
Specify a Store view the blog from AheadWorks is to be imported to.
Once you have finished don't forget to press a Start Import button. Notice that you will have to copy featured image files to Magento 2 pub/media/magefan_blog directory once the import is completed.
Troubleshooting
1. Something went wrong: Warning: mysqli_connect(): (HY000/1045): Access denied for user
If you have received this error, try to copy AheadWorks blog tablets from Magento 1 database to some database on the same server as Magento 2. As far as you have done this, try toihor
- 1 min read
If you have a product attribute and want to assign it to a single attribute set, it's easy to do via Magento 2 Admin Panel > Stores > Attributes > Attribute Set.But what if you need to assign it to all your attribute sets? What if you have 50+ or ever 100+ attribute sets? It can be time costly.
So what you can do, is to create a simple script that will do all job for you.
1. Create a PHP file "myscript.php" in your Magento 2 root directory.
2. Insert the code:
<?phperror_reporting(E_ALL);ini_set('display_errors', 1);
$ATTRIBUTE_CODE = 'my_attribute';$ATTRIBUTE_GROUP = 'General';
use Magento\Framework\App\Bootstrap;require __DIR__ . '/app/bootstrap.php';
$bootstrap = Bootstrap::create(BP, $_SERVER);
$objectManager = $bootstrap->getObjectManager();$state = $objectManager->get(Magento\Framework\App\State::class);$state->setAreaCode('adminhtml');/* Attribute assign logic */
$eavSetup = $objectManager->create(\Magento\Eav\Setup\EavSetup::class);$config = $objectManager->get(\Magento\Catalog\Model\Config::class);$attributeManagementihor
- 3 min read
Social media is one of the best ways to drive attention to your brand, especially in eCommerce. But that's not the only benefit. You can also drive more traffic to your store and increase sales correspondingly. There's just one thing — the links you share on social media have to be attractive to drive clicks.
That's something help you with. So, today you'll learn how to implement OG tags in Magento directly in the admin panel, using only Extension.
Configure Open Graph Tags in Magento
Before you start setting up OG tags for specific pages, you must configure default Open Graph tags.
1. Enable the extension at Stores > Configuration > Magefan Extensions > Open Graph > General.
2. Specify your Facebook App ID.
3. Choose pages to Use Open Graph Meta Tags For.
Note: you can only if you use Magefan Blog Extension.
4. Fill out Default OG Image and Description. They are used in case no other OG image or description is defined.
5. Choose what customer group to Display Productihor
- 9 min read
Managing a single-language website is significantly easier than managing a multi-language one. However, creating a Magento multi-language store is a must if you want to take your business beyond borders.
So, whether you are setting up your first multi-language store in Magento or scaling an existing one, you're in the right place. Here you'll learn everything you need to connect with global customers and drive more traffic to your store.
From installing the language packs to translating content and enabling the — we've got you covered.
Benefits of Magento 2 Multi-Language Store
Once you start a multi-language Magento 2 store, you'll see that it's not about technical changes only. It's about a strategy that makes your business reach the international level. But that's not the only benefit.
Expanded global reach
If your store "speaks" several languages, you reach more customers around the globe. Instead of being limited to one region only. Therefore, setting up a Magento multi-languageihor
- 3 min read
Delivering a personalised user experience when you sell worldwide means a lot of things — displaying customer-specific banners, , categories and more. However, one of the first steps includes enabling language and currency switchers. Let's focus on the latter.
Magento by default allows you to add multiple currencies and display them in the header. However, it's not always enough. People still need to switch between them manually.
So, today you'll learn how to take that to the next level. You'll discover how to switch currencies for visitors automatically using the .
Configure Auto Currency Switcher
Once you install the extension navigate to Stores > Configuration > Magefan Extensions > Auto Currency Switcher and enable the extension to start the configuration.
1. Complete general settings
In the general setting, you just choose whether to Round Prices and Base Currency Prices. Then choose the Rounding Algorithm.
Here are some examples of the round algorithms:
Round (14.3 -> 14.00, 14.5ihor
- 1 min read
You can install by Magefan, using composer or archive installation methods.
Note: if you want to install the or please navigate to your Magefan Account > Downloads > Install via Composer to get the composer installation instructions.
Installation via composer (recommended)
Important: this method works only for Blog Basic versions lower than 2.13.0. If you want to install the Blog Basic version starting from 2.13.0 you need to and get a product key.
Open command line.
Using command "cd" navigate to your Magento 2 root directory.
Run CLI commands:
composer require magefan/module-blog ^x.x.x# replace x.x.x with the version you want to install
# Authentication required (repo.magento.com)# Get your Magento Marketplace authentication keys or use these: # Username: 7c018006799466c681ad507e27904677# Password: 289077c86e811661a8f7751828485d3aphp 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 downihor
- 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 Auto Currency Switcher Extension ZIP-Archive from magefan.com website (not GitHub or other sources).
Extract files.
Copy app and lib 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 install the extension, you might need to update the Geo IP database:
mkdir var/magefanmkdir var/magefan/geoipwget -O var/magefan/geoip/GeoLite2-Country.mmdb https://magefan.com/pub/media/geoip/GeoLite2-Country.mmdb
Once you have installed the Magentoihor
- 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 Open Graph Extension 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 Open Graph extension you can start the .
- 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 Convert Guest to Customer Extension 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 Convert Guest to Customer extension you can start the .
- 1 min read
You can install by Magefan, using composer or archive installation methods.
If you use Magento 2.4.x or greater please .
Installation via composer (recommended)
Open command line.
Using command "cd" navigate to your Magento 2 root directory.
Run CLI commands:
composer require magefan/module-login-as-customer# Authentication required (repo.magento.com)# Get your Magento Marketplace authentication keys or use these: # Username: 7c018006799466c681ad507e27904677# Password: 289077c86e811661a8f7751828485d3aphp 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 .
Installation using archive and FTP
Download Login As Customer Extension 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/magentoihor
- 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 Auto Language Switcher Extension ZIP-Archive from magefan.com website (not GitHub or other sources).
Extract files.
Copy app and lib 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 Auto Language Switcher extension you can start the .
- 1 min read
Sometimes you can see notifications in Magento 2 panel that are displayed over and over again. This is Magento 2 admin notifications.
To stop showing these messages you need to mark them as read.
For this please navigate to Noficiations Manage page. Click on the bell icon in the top right corner in the admin panel and then press the "See All (X unread)" link.
Select the messages you want and mark them as read.
Tha's all.
However, there are some notifications that are useful for you, as the admin, to receive.
e.g. new review, disabled cache and low stock notifications
Check out to receive emails about changes on your store directly to your email box.
- 1 min read
If you have installed or updated Magento 2 extension and received the error message e.g.:
Module 'Company_Module' from 'app/code/Company/Module' has been already defined in 'vendor/company/module'.
this means that you have 2 versions of the extension:
1) in the folder app/code/Company/Module2) in the folder vendor/company/module
In vendor folder Magento stores all components (extensions, themes, language packages) that have been installed using Composer.
As installing or updating extensions via Composer is preferred, you need to remove the extension folder app/code/Company/Module (please don't forget about a backup before removal) and run installation commands.
Example:
If you get the error:
Module 'Foo_Bar' from 'app/code/Foo/Bar' has been already defined in 'vendor/foo/module-bar'.
You need to:
1. Make a backup of "app/code/Foo/Bar" folder
2. Remove "app/code/Foo/Bar".
3. Run commands
php bin/magento setup:upgradephp bin/magento setup:di:compilephp bin/magento setup:static-content:deployihor
- 1 min read
Originally you cannot reindex Magento from admin panel. To perform you need to use PuTTY or another terminal application to run the CLI commands, e.g. command for reindexing:
php bin/magento indexer:reindex
So, most often developers use . However, wiith FREE Magento 2 Command Line (CLI) Extension by Magefan you can run CLI commands directly from Magento 2 admin panel.
To reindex Magento 2 from admin panel:
1. Install the Magefan CLI extension to see a new menu item "System > Command Line" to be added to the admin menu.
2. Enter your current admin user password (for security reasons) On the "Comand Line" page and enter the Magento 2 reindex command.
3. Press ENTER to start the reindexing after you have entered the "php bin/magento indexer:reindex" command.
Result:
With the Magefan CLI module, you can run any other Magento 2 commands.
Check out the video to see how easy it actually is:
- 1 min read
If you use Magento 2.2.x or greater and receive the error message:
1 exception(s):
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'class': [facet 'pattern'] The value '\Magento\Framework\View\Element\Text\ListText' is not accepted by the pattern '[A-Z][_a-zA-Z\d]*(\\[A-Z][_a-zA-Z\d]*)*'.
Line: 982
Element 'block', attribute 'class': '\Magento\Framework\View\Element\Text\ListText' is not a valid value of the atomic type 'blockClassType'.
Line: 982
Exception #0 (Magento\Framework\Config\Dom\ValidationException): Element 'block', attribute 'class': [facet 'pattern'] The value '\Magento\Framework\View\Element\Text\ListText' is not accepted by the pattern '[A-Z][_a-zA-Z\d]*(\\[A-Z][_a-zA-Z\d]*)*'.
Line: 982
Element 'block', attribute 'class': '\Magento\Framework\View\Element\Text\ListText' is not a valid value of the atomic type 'blockClassType'.
Line: 982
You need to check all layout files in your theme and custom extensions, they may have aihor
- 2 min read
If you need to extend Magento 2 Blog Module by Magefan and add a new custom text field to Blog Post edit page in Magento 2 Admin panel (Content > Blog > Posts) you must to create a simple custom Magento 2 Extension.
You can download a sample extension from our GitHub page or you can create it manually using the steps below:
1. Create composer.json file
app/code/Magefan/BlogCustomField/composer.json
{ "name": "magefan/module-blog-custom-field", "description": "Implements Blog functionality on Magento 2 store", "require": { "magefan/module-blog" : ">=2.8.0" }, "type": "magento2-module", "version": "2.0.0", "license": [ "OSL-3.0", "AFL-3.0" ], "autoload": { "files": [ "registration.php" ], "psr-4": { "Magefan\\BlogCustomField\\": "" } }}
2. Create registration.php file
app/code/Magefan/BlogCustomField/registration.php
<?php/*** Copyright © Magefan (support@magefan.com). All rights reserved.* See LICENSE.txt for license details (http://opensource.org/licenses/osl-3.0.php).*/
\Magento\Framework\Component\ComponentRegistrar::register(ihor
