---
title: "How to Fix Theme Switching Error in Magento 2.2.x"
url: "https://magecomp.com/blog/fix-theme-switching-error-magento-2-2-x/"
date: "2018-07-23T15:14:39+00:00"
modified: "2025-06-02T13:04:28+00:00"
author:
  name: "Dhiren Vasoya"
  url: "https://magecomp.com/"
categories:
  - "How To"
  - "Magento 2"
word_count: 290
reading_time: "2 min read"
summary: "Theming is something that changes the whole shopping experience of your store with a topping of some stylish design elements and features that your default Magento store never had. But every time w..."
description: "Willing to style your store theme again? but after upgrading your store to latest Magento version facing an issue like "Something went wrong while saving thi..."
keywords: "How To, Magento 2"
language: "en"
schema_type: "Article"
related_posts:
  - title: "How to Create Custom Table via XML In Magento 2.3"
    url: "https://magecomp.com/blog/how-to-create-custom-table-via-xml-in-magento-2/"
  - title: "Magento 2: How to Display Swatches instead of Swatch Label in Checkout Order Summary"
    url: "https://magecomp.com/blog/magento-2-display-swatches-instead-of-swatch-label-in-checkout-order-summary/"
  - title: "How to Add a custom comment in Magento 2 checkout shipping address fields?"
    url: "https://magecomp.com/blog/add-custom-comment-magento-2-checkout-shipping-address-fields/"
---

# How to Fix Theme Switching Error in Magento 2.2.x

_Published: July 23, 2018_  
_Author: Dhiren Vasoya_  

![How to Fix Theme Switching Error in Magento 2.2.x](https://magecomp.com/blog/wp-content/uploads/2018/07/How-to-Fix-Theme-Switching-Error-in-Magento-2.2.x-1024x332.webp)

Theming is something that changes the whole shopping experience of your store with a topping of some stylish design elements and features that your default Magento store never had. But every time when you upgrade to latest Magento 2.x version, you will face some issue or difficulties while using your Magento store functionality. But due to its wide developer community issue will no longer remain unsolved.

[![Hire Magento Programmer](https://magecomp.com/blog/wp-content/uploads/2025/02/Hire-Magento-Programmer-CTA-4.webp)](https://magecomp.com/services/hire-magento-programmer/)

Recently, after upgrading to latest Magento 2.2.x lots of store owner are facing a theme switching issue with an error like “something went wrong while saving this configuration. The area is already set.” Basically, this issue comes from the default Magento core to fix it quickly, we can create an extension that will allow us to switch theme and apply our favorite theme on store frontend. The first file we need to create is **di.xml** inside out extension folder at below path.

[![Magento version upgrade](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-2-Version-Upgrade-CTA-2.webp)](https://magecomp.com/services/magento-upgrade-services/)

**Step 1:** First, we need to create **“di.xml”** file inside extension the below directory

**app\code\Vendor\Extension\etc**

```
<?xml version="1.0"?><br></br><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br></br>xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"><br></br><br></br>    <type name="MagentoEmailModelAbstractTemplate"><br></br>        <plugin name="vendor_extension_email_template_plugin"<br></br>type="VendorExtensionModelMagentoEmailAbstractTemplate" /><br></br>    </type><br></br><br></br></config>
```


**Step 2:** lastly, you need to create **“AbstractTemplate.php”** file inside extension the below directory

**app\code\Vendor\Extension\Model\Magento\Email**

```
<?php <br></br>namespace VendorExtensionModelMagentoEmail;<br></br><br></br>class AbstractTemplate extends AbstractModel implements TemplateTypesInterface <br></br>{ <br></br>    public function beforeSetForcedArea(MagentoEmailModelAbstractTemplate $subject){ <br></br>        if (!isset($this->area)){<br></br>            $this->area = $this->emailConfig->getTemplateArea($templateId);<br></br>        }<br></br>        return $this;<br></br>    }<br></br>}
```

[![Magento Malware Removal](https://magecomp.com/blog/wp-content/uploads/2025/02/Magento-Malware-Removal-CTA-5.webp)](https://magecomp.com/magento-malware-removal.html)

 Feel free to ask questions regarding this code. Happy Coding!


---

_View the original post at: [https://magecomp.com/blog/fix-theme-switching-error-magento-2-2-x/](https://magecomp.com/blog/fix-theme-switching-error-magento-2-2-x/)_  
_Served as markdown by [Third Audience](https://github.com/third-audience) v3.5.3_  
_Generated: 2026-08-08 01:29:32 UTC_  
