File Upload in System Configuration in Magento2

Following files and steps will help you to add file upload in system configuration with custom file type validation.

<?xml version="1.0"?>
<config xmlns:xsi="" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
        <tab id="codedecorator" class="code-config-tab"  translate="label" sortOrder="300"> 
            <label><![CDATA[Decorator Extensions]]></label> 
        <section id="codedecorator_learn" translate="label" type="text" sortOrder="99" showInDefault="1" showInWebsite="1" showInStore="1">
            <label>Company Agreement</label>
            <group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="0" showInStore="0">
               <field id="custom_file_upload" translate="label" type="Magento\Config\Block\System\Config\Form\Field\File" sortOrder="6" showInDefault="1" showInWebsite="1" >
                <label>Upload custom file</label>
                <upload_dir config="system" scope_info="1">cdlearn</upload_dir>

namespace Codedecorator\LearnCompanyAccount\Model\Config\Backend;

class File extends \Magento\Config\Model\Config\Backend\File
    public function _getAllowedExtensions() {
        return ['pdf'];
       //return ['pdf','svg','jpeg'];

We have requirement of PDF file only so we have pub/media/cdlearn/defaultkept pdf only if you have other extension to be checked or validate than just remove the comment. Uploaded file will be available in the pub/media/cdlearn/default folder

How to add custom attribute to the body tag in Magento 2

You have already noticed attribute tag in layout xml and you are wondering what is doing. Let’s just see the customer_account.xml

        <title>My Account</title>
        <attribute name="class" value="account"/>
        <attribute name="cd-attribute" value="cd-account"/>

So in above example, 1st line will add attribute class with value account if class attribute already exists it will append the value to that attribute and 2nd line will add attribute called cd-attribute with value cd-account in body tag

I hope you liked the small content .

Happy coding!

How to enable error reporting in Magento 2

As developers, we always need to see the error while developing extensions or solving the bugs. Many times you just see the blank page on Magento and wonder what will be the issue.

In the default setting of Magento 2, the function which allows displaying the error on the frontend is disabled so here is the way to see the error and enable the error reporting in Magento2.

The number one thing that we always do as developers is enable the Developer mode on the following magento command

php bin/magento deploy:mode:set developer

if you are still unable to see the error then you just need to edit app/bootstrap.php(from root of your magento directory)

Find following the code in above file set as following

error_reporting(E_ALL); // Set Error Reporting as E_ALL (Report all PHP errors)

ini_set('display_errors', 1); // Uncomment this line to enable PHP error display

You will see all the errors on the browser now.

Happy Coding !

How to reload/refresh the quote using js in Magento2

We were working on custom discount module where it allows customers to use the points assigned by the admin on checkout(kind of rewards point in magento). To give discount on the applied discount, we need to reload the quote after applying discount. Following code snippets helped us to do so.

    ) {
Reload the quote using js

Let us know if you are trying achieve the same. We will guide you for the same.

Magento Extensions Are Fundamentals To A Successful E-commerce Store


It’s difficult not to notice new changes when they appear on a daily basis. The modern technologies’ time-saving and cost-effective features cause us to drool over them from time to time.

We are all aware of the importance of the internet and the function it plays in today’s technologically advanced world.

It has not only pushed people to play, date, learn, and research on the internet, but it also offers the opportunity to make a lot of money from online e-commerce companies.

People are increasingly opting for the electronic route, preferring to shop online rather than going to a physical store.

E-commerce on the internet Shoppe offers specific benefits that cannot be overstated. An internet store has an enormous customer base. It practically covers every place where a computer and mobiles are used, which includes almost the entire globe.

It eliminates the need to personally visit consumers in order to provide them with useful information.

Another advantage of using E-commerce websites is that you can take advantage of more convenient deals at ridiculously low prices.

Data on clients, sales, and other topics is automatically collected and saved in databases, saving you the time and effort of manually collecting data.

Magento is the most compatible, effective, and cost-efficient option to develop an E-commerce website today.

The fact that it is open source addresses the majority of questions. You’ll be able to control every aspect of your online store with Magento themes, Magento templates, Magento plug-ins, and Magento extensions.

All of your critical tasks, such as merchandising, promotions, fantastic control, site management, catalogue & product browsing, international support, and so on, are taken handled of by it.

Characteristics of Magento: –

  • Promotions & Tools for Marketing
  • Reporting and Analytics
  • Checkout using Mobile Commerce International
  • Payment & Shipping
  • Accounts & Customer Service
  • Management of Orders
  • SEO enabled Admin Panel

The following are some of Magento Commerce’s many advantages: –

The default template has a very appealing and professional appearance. Magento’s smoothness and clean design are unquestionably beneficial.

With new layouts and Magento Extensions, Magento commerce is simple to set up. Magento does not require e-store owners to have prior programming skills, unlike other open source shopping carts.

It is unquestionably both simple and effective.

Magento gives you the unrivalled option of integrating many payment gateways. Owners of many online stores will be able to manage them all from a single administrative panel and product catalogue.

This feature gives you the most versatility because you can manage multiple e-stores at the same time, with single Admin Panel saving you time and money.

Providing numerous discounts and promotional packages at the point of sale can also significantly boost your sales.

You may slice and merge many designs with current technology, and you can also convert various designs from PSD to Magento.

PSD to Magento templates are also frequently converted. Magento’s SEO friendliness is also a factor in why many business owners favour it.

Customers are attracted to Magento extensions and Magento plugins because they offer a sparkle of elegance to the entire feel and style of the online retail store.

Codedecorator Team is an Magento Expert [] who specialists in Magento Development and Magento Extensions, which are the greatest options for creating an excellent E-commerce Website for your online business.

Reasons Why You Should Choose Magento ECommerce Development

At some point, any initiative, no matter how big or small, will run into roadblocks. It may be a mental block for an author or a temporary pause in the progress of a project.

For example, eCommerce owners face challenges when creating their e-store, or, more precisely, when selecting an eCommerce Development platform, at the start of their online journey.

According to G2, there are 370 eCommerce sites to choose from. This can be a daunting number, and comparing and choosing from hundreds of choices is certainly a challenging job. Since your eCommerce site will be the cornerstone of every online company, you can’t afford to make mistakes.

Furthermore, there is no such thing as “the best” platform since each platform has its own set of benefits and disadvantages. It is entirely based on your criteria and additional goals that you wish to accomplish, and then you must select a platform that best suits your needs.

Do you believe this is a re-enactment of your conflict? If that’s the case, this article is for you!

So, let’s get started!

Is Magento eCommerce Production a common choice for most companies?

Every day, Magento receives 5000 downloads. According to reports, nearly 7,500 retailers moved to Magento from other eCommerce platforms last year. As a result, Magento is unquestionably the first choice of company owners dealing with a large number of consumers and profits, as well as those pursuing a long-term holistic solution. Because of its advanced features, inexpensive plugins, and rich functionality, it is a trusted forum for small business owners.

Are you aware that Magento powers famous eCommerce websites such as Nike’s and Samsung’s?

Overall, business owners prefer Magento, which explains why, by 2020, Magento is predicted to power more than 250,000 active eCommerce sites.

Is Magento eCommerce Production something you’d be involved in?

Let’s explore the advantages of Magento 2 Development Services to find an answer to this issue.

Scalability and increased efficiency

Any e-key store’s features are performance and scalability. Magento provides an interactive interface to ensure that everybody is on the same page. It includes an improved indexer that improves the web store’s query speed and efficiency.

What exactly does “high efficiency” imply?

1.End-users will note a decrease in the time it takes for a website to load.
2.Caching of the entire page
3. Indexing that is more effective

All of these factors contribute to your online store’s overall pace.

What does “improved scalability” imply?

Users now have the option of using several databases. You can also keep your checkout, order management, and product catalogue databases separate.

Advanced SEO Features

Online stores receive a lot of traffic from search engines. As a consequence, SEO is important for rising the site’s popularity and rating.

Magento 2 comes with an advanced SEO suite extension that will up the SEO game.

Take a look at the benefits of using an SEO suite:

  1. Create models for SEO.
  2. Configure your store’s rich snippets
  3. Manage tab, category, and layered navigation SEO settings.
  4. Automate the store’s Meta Tag management.
  5. With the aid of SEO toolbar, we can examine SEP sites.
  6. Set up canonical URLs
  7. XML sitemaps should be set up and configured.

Since SEO has the potential to increase traffic to your eCommerce store without costing a lot of money, you can draw high-quality traffic without spending a lot of money. As a result, you can select a forum that is SEO friendly. Wouldn’t you agree?

Mobile Friendly

The data on mobile shopping appears to be encouraging. For example, 79 percent of users have made an online purchase using their mobile devices in the last six months. This number is only going to grow as smartphones become more widely available. As a consequence, the eCommerce website must be compatible with mobile devices.

Magento 2 is a website that caters to smartphone users. It includes features that make it easy for customers to browse your store’s catalogue, as well as a mobile-friendly checkout process.

You can adapt new themes to physical and software device capabilities since Magento 2 is mobile sensitive.

The most important advantage is a higher rating for your website. Since Google indexes mobile-first by default, this is the case. In other words, Google indexes and ranks every page based on its mobile edition.

As a consequence, creating a mobile-friendly website would give you an edge in search engines.

Reduced Security Vulnerabilities

One of the most serious issues confronting the eCommerce industry today is cyber crime. According to data, online payment fraud would cost the eCommerce industry at least $25 billion by 2024. To keep hackers at bay, you must be careful as an eCommerce owner. And Magento 2 has you covered in this regard.

It provides password management tools that assist businesses in safeguarding customer information.

The escaping of data is controlled by certain conventions in Magento 2’s system.

The system’s read-only’ option prevents unauthorized users from accessing those files. In summary, the Magento 2 platform offers a wide variety of tools and features that help to reduce security risks.

Remarks at the End

Magento eCommerce production is used by 12% of all online businesses. The possibilities offered by this platform are infinite.

As a result of your decision to use this famous platform, your store can soon reach new heights. Will you want to know how to do it?