diff --git a/Block/Adminhtml/Config/Form/Field/FixAll.php b/Block/Adminhtml/Config/Form/Field/FixAll.php
index 85310ad..e015242 100644
--- a/Block/Adminhtml/Config/Form/Field/FixAll.php
+++ b/Block/Adminhtml/Config/Form/Field/FixAll.php
@@ -8,16 +8,34 @@ class FixAll extends \Magento\Config\Block\System\Config\Form\Field
public function render(AbstractElement $element)
{
+ $url = $this->_urlBuilder->getUrl('swissup/theme/fixAll');
+ $cacheUrl = $this->getUrl('adminhtml/cache/index');;
$buttonText = __("Fix All");
return <<
-
-
-
+ },
+ error: function() {
+ alert('An error occurred while updating theme types.');
+ }
+ })">$buttonText
+
|
HTML;
diff --git a/Controller/Adminhtml/Theme/FixAll.php b/Controller/Adminhtml/Theme/FixAll.php
new file mode 100644
index 0000000..a216a5c
--- /dev/null
+++ b/Controller/Adminhtml/Theme/FixAll.php
@@ -0,0 +1,24 @@
+resultFactory->create(ResultFactory::TYPE_JSON);
+ $resultJson->setData(['message' => 'Virtual themes fixed. Please, clear the cache!']);
+
+ $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
+
+ $connection = $objectManager->create('\Magento\Framework\App\ResourceConnection')->getConnection();
+ $tableName = $connection->getTableName('theme');
+ $connection->update($tableName, ['type' => 0]);
+
+ return $resultJson;
+ }
+}