How to Setup Currencies in Magento 2?

You need to test and experiment with various ideas on your online store if you wish to succeed and scale it eventually. And if your store has visitors from different countries, you need to cater to them as well.

Providing an option for Multiple Currencies option is a great way to start.

In Magento 2 you can easily set multiple currencies after a little bit of configuration. Let’s learn how to setup Currencies in Magento 2.

Configure Currencies

Open the admin panel of your store and go to STORES → Configuration:

 
configuration
 

Now click on Currency Setup under the General Tab:

 
genral tab
 

Unfold the Currency Options section and configure it according to your need. Let’s discuss each option:

Base Currency: The currency which will be used for online transactions.

Default Display Currency: The default currency which will be displayed in your store under the pricing.

Allowed Currencies: You can allow multiple currencies in your store. Just press Ctrl and select the allowed currencies.

I am selecting US Dollar and Euro in Allowed Currencies:

 
Allowed Currency
 

Unfold the Webservicex section and enter the time in seconds for the timeout of import connection:

 
Webservicex
 

Unfold the Schedule Import Settings and configure it according to your need. Let’s discuss all the options:

Enabled: Select Yes to update the currency rate automatically on your store

Service: Select the service of your choice from the provided list.

Start Time: Configure the time after which the currency rate will be updated automatically. The format of time is: Hour, Minutes, and Seconds.

Frequency: Set the frequency of rate update. You can set it as Daily, Weekly, or Monthly.

Error Email Recipient: Enter the email address on which you want to get notifications about the errors.

Error Email Sender: Name of the sender that will display on the sent email.

Error Email Template: To inform the people about the errors, select the email template.

 

 

Now just click on Save Config from the top of the page:

 

&nbsp

Update Currency Rates and Currency Symbols

Go to STORES → Currency Rates to update the currency rate:

 
currency
 

Select the import service and then click on Import:

 
import service

After importing, click on Save Currency Rates:

 
save currency rate
 

You can also change the currency symbols. For this, go to STORES → Currency Symbols:

 
currecny symbole
 

Here, replace the currency symbol with your custom symbol and then just click on Save Currency Symbols:

 
save currency symbols
 

Launch your store and go to any product page. By default you will see the price in US Dollar:

 

demo product
&nbsp

Now change the currency by clicking on Euro from the top the page:

 
default
 

Now the currency will change to Euro:

 
euro
 

Wrapping Up

When you offer multiple currencies to your users, you can enjoy far more sales thanks to catering to an international audience! I hope that following this guide will help you setup Multiple Currencies in Magento 2. If you face any issue in its configuration, leave your query below and I will get back to you.

 
 
&nbsp

Author Bio

Syed Muneeb Ul Hasan is a Magento Developer and Blogger at Magenticians – a platform to learn Magento. He is an expert in PHP and Magento and prefers to educate users in the implementation of Magento. When not working, he loves to play games and watch cricket. You can follow him on Twitter.

Envision Ecommerce Featured on Clutch!

Here at Envision Ecommerce, we specialize in providing eCommerce Business Solutions to our clients. Our solutions include Consulting, Design, Development, Integration, Marketing and Support.

Envision Ecommerce developers create customized ecommerce websites to promote your business brand while bolstering online sales. In today’s age, good ecommerce web development has become a necessity to drive greater traffic.

We are honoured that our team received a spot as a Top 20 Most Promising Ecommerce Consultants 2017 by Silicon India. Clutch has also recently recognized us for our quality ecommerce services. In fact, on Clutch we currently rank number 13 on the Top Ecommerce Developers in India directory.

What is Clutch? Clutch is a ratings and reviews B2B firm that identifies top technology and digital marketing companies. With over 7,000 companies across 500+ industry verticals on their site, ranging from software developers to SEO consultants, the Clutch platform is a data-driven field guide to business buying decisions.

To distinguish top ecommerce companies, Clutch evaluates companies’ market presence, ability to deliver, client experience, and direct input from clients. Analysts at the firm interview real clients, collect data, and compare competitors to help buyers find a firm for their next big project.

Our inclusion on Clutch is exciting because it helps us understand what our clients have to say about our work. Their reviews help us evaluate both our strengths and areas for improvement. They help us make our best even better.

We are happy and honoured that some of our clients have taken the time to speak with Clutch analysts. The CEO of our client Canadian Classroom says, “They have a Westernized approach, magento professionals, and a good communication system in place.”

Another client of ours, the founder of Biotic Healthcare, says “the traffic and orders have increased on my website.” They told the Clutch analyst that traffic and conversions rapidly increased after the implementation of their new eCommerce platform.

Interested in reading more about what our clients have to say on Clutch? We encourage you to visit our Clutch profile to read their full reviews. We look forward to hearing more from our clients and continuing our partnership with Clutch in 2018!

envisionecommerce

How To Programmatically Empty Cache In Magento 2?

In some situations, you may feel a need to empty your Magento cache programmatically. That’s why we have come up with another “How to” blog to help you.

Read on to learn how to programmatically empty cache in Magento 2.

Step 1: First off, you need to define constructor – pass Magento\Framework\App\Cache\TypeListInterface and Magento\Framework\App\Cache\Frontend\Pool to your file’s constructor as explained below:

public function __construct(

 

Context $context,

 

\Magento\Framework\App\Cache\TypeListInterface $cacheTypeList,

 

\Magento\Framework\App\Cache\Frontend\Pool $cacheFrontendPool

 

) {

 

parent::__construct($context);

 

$this->_cacheTypeList = $cacheTypeList;

 

$this->_cacheFrontendPool = $cacheFrontendPool;

 

}


Step 2:  So the second step is to add the code mentioned below. You can add this code to the method where you need to empty the cache.

$types = array(‘config’,’layout’,’block_html’,’collections’,’reflection’,’db_ddl’,’eav’,’config_integration’,’config_integration_api’,’full_page’,’translate’,’config_webservice’);

 

foreach ($types as $type) {

 

$this->_cacheTypeList->cleanType($type);

 

}

 

foreach ($this->_cacheFrontendPool as $cacheFrontend) {

 

$cacheFrontend->getBackend()->clean();

 

}


And that’s it. Hope it helps you to effortlessly clear cache in Magento 2. In a case, if you feel this “how to” is like a heavy lifting for you, we at Envision Ecommerce have a robust team of certified Magento developers who is always ready to perform these kinds of heavy lifting for you. Contact us at https://www.envisionecommerce.com/ to perform this “How to” for you.

How to Add an Extra Column in Your Existing Magento 2 Table?

While doing Magento 2 programming, sometimes you feel a need to add an extra column to your already existing Magento 2 table. That’s why we have come up with another “How to” blog to help you. In this blog, we will use the UpgradeSchema.php file for adding extra columns in existing Magento 2 tables and this file should be under setup folder of the module. So let’s get started.

Here is an example of adding an extra column named as ‘tok_value’ under the table name ‘sales_order_payment’.

Step 1: Create a file called ‘UpgradeSchema.php’ in the setup folder of module, i.e.

(app/code/vendor/modulename/Setup/UpgradeSchema.php)

and make use of following code:

<?php

namespace Vendor\Module\Setup;

use Magento\Framework\Setup\UpgradeSchemaInterface;

use Magento\Framework\Setup\ModuleContextInterface;

use Magento\Framework\Setup\SchemaSetupInterface;

class UpgradeSchema implements  UpgradeSchemaInterface

{

public function upgrade(SchemaSetupInterface $setup,

ModuleContextInterface $context){

$setup->startSetup();

if (version_compare($context->getVersion(), '1.0.1') < 0) {

// Get module table

$tableName = $setup->getTable('sales_order_payment');

// Check if the table already exists

if ($setup->getConnection()->isTableExists($tableName) == true) {

// Declare data

$columns = [

'tok_value' => [

'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,

'nullable' => true,

'comment' => 'Token Value',

],

];

$connection = $setup->getConnection();

foreach ($columns as $name => $definition) {

$connection->addColumn($tableName, $name, $definition);

}

 
}

}

 
$setup->endSetup();

}

}

Step 2: After saving files, you need to run php bin/magento setup:upgrade. Now check your database and you will be able to find a new custom table and new column in ‘sales_order_payment’ table.

Note: If you face any issue, it may be due to the module that you have already installed. As you know, if the module is already installed then setup:upgrade command does not install schema. You will need to look into your setup_module table, delete your module from the table and re-run the php bin/magento setup:upgrade command.

Conclusion:

This How to blog on Magento 2 should get you started on adding an extra column to your already existing Magento 2 table. In a case, if you feel this “how to” is like a heavy lifting for you, then Envision Ecommerce has a team of certified Magento developers who can do this heavy lifting for you. You can contact us at sales@envisionecommerce.com to perform this “How to” for you.

Tips To Enhance Magento 2 Performance

Come on! Stop complaining about the speed of Magento on the web. You are living in the era of techie world. You need to fix it by yourself or find some informative website talking about the Magento performance.

You might be afraid of losing sales due to the high abandonment rate or something like bad user experience. But you should not forget that you have chosen this platform instead of WooCommerce which is an extension of WordPress. One of the main reason that many business people choose this platform is its robustness along with the high level of functionality, scalability as well as customizability.

If you are here for the relevant information then you are at the right place to invest your time in finding the well-proven ways to speed up the performance of Magento.

Let’s have a look at the following points:

1. Update to the Latest Magento Version

Make sure your Magento store is running at the latest updated version of Magento. Basically, a newly updated Magento version comes with lots of bug fixes and performance enhancements. Here are three main steps to upgrade a Magento installation:

#1 Step:

First off, install a very latest version of Magento file tree in Magento shop.

#2 Step:

It’s time to run the installer which is accessible through the file tree available on the top of your outdated database.

#3 Step:

Now move over custom Magento extensions and themes from the old Magento version to the latest version.

Upgrading Magento version requires little more efforts compared to other eCommerce platforms. Here you can follow another in-depth tutorial to learn how to fully upgrade Magento.

2. Implement a Perfect Content Delivery Network (CDN)

Implementing a perfect Content Delivery Network (CDN) is another easiest way of Magento speed optimization. It works by reducing your Magento store load times and helps you to serve your assets (like javascript, CSS and product images) from many different locations across the globe so that they can reach quickly to your shoppers.

3. Image optimization:

Let me give you a clear idea that on average 56 percent part of a website is consumed by images. If you optimize your product images, the speed of your pages will increase in a dramatical way. You can optimize it by compressing them with the help of a tool called Photoshop as well as you can also make use of the extensions to auto-optimize them.

As we are here talking about the Magento 2, the following extensions are available for it:

TinyPNG Extension

Compressor Extension

Magento Extension like Gtspeed can be obtained with the help of GTMetrix. It provides optimized image along with the other benefits such as CSS/JS concatenation and minification.

You can have a look on how it shows before optimization and after optimization.

Enhance Magento
 

4. Concatenate CSS and JavaScript Files:

Magento 2 comprises of a built-in feature to concatenate your CSS and Javascript files into a single file. It will reduce a total number of HTTP requests which further helps in the loading of your pages fast.

Firstly, you need to navigate to the “System”, then “Advanced”, and then, “Developer”. Now, you need to change the drop down to “Yes” under both JavaScript as well as CSS settings and then click on the “save config”.


 

5. Enable Magento Compilation:

Magento has a special compilation feature which gives 50% performance boost. What actually happens all the application files of Magento are searched in an order whenever the page loads resulting in the file system reads. Only the Magento compiler reduces these reads just by copying all of the files in a single directory and caches those which are used more frequently

You just need to keep in mind one thing that when upgrading Magento, disable this feature.

6. Flat Catalog

It is the default functionality of Magento that it uses an EAV model to save and retrieve customer details and product data. Undoubtedly, this default model is responsible to make the Magento system more flexible, however, it badly impacts its performance because of longer database queries. This is where “Enabling Flat Catalog” option shines. By enabling this option, it will merge all product data and category attributes into a single table. Hence, it will quickly respond to MySQL queries and enhance your Magento performance. If your Magento based eCommerce store contains 1000+ products, this method can be very beneficial for you.

#1 Step:

Open your Magento admin panel and navigate to “Stores” -> “Configuration” -> “Catalog.”

#2 Step:

Choose “Yes” from the drop-downs of “Use Flat Catalog Category” and “Use Flat Catalog Product” under “Storefront.”

#3 Step:

Now tap the “Save Config” option.

#4 Step:

The last step is to clear the cache. The most recommended method to do so is to clear everything under /var/cache directory. Moreover, you can also do the same by first navigating to “System” -> then “Cache Management” and selecting the “Flush Cache Storage” option which is very similar to clearing all the cache.

cache management
 

7. Choose the fast web hosting:

Last but not least, make a choice for the reliable and fast web host. This is one of the most important decisions when we are trying to improve the Magento performance. Never get with the cheap shared hosting as they overcrowd their servers by making you fool. We suggest you go with the VPS such as Digital Ocean and Linode. So, you will get complete control of your resources. Moreover, ServerPilot is a great control panel which works with Magento and the VPS providers.

You can take Magneto Experts’ help in this regard. We at Envision Ecommerce have a team of very skilled Magento Certified Developers. To avail our Magento Speed Optimization services from our certified Magento experts, you can contact us at sales@envisionecommerce.com or visit: https://www.envisionecommerce.com.