diff --git a/modules/themeconfigurator/css/live_configurator.css b/modules/themeconfigurator/css/live_configurator.css index f7cd40dc2..dea2d743f 100644 --- a/modules/themeconfigurator/css/live_configurator.css +++ b/modules/themeconfigurator/css/live_configurator.css @@ -29,7 +29,7 @@ height: 50px; left: 215px; position: fixed; - top: 90px; + top: 150px; width: 50px; z-index: 20; } @@ -43,7 +43,7 @@ #tool_customization{ position: fixed; left: 0; - top: 90px; + top: 150px; z-index: 20; height: auto; width: 215px; diff --git a/modules/themeconfigurator/js/live_configurator.js b/modules/themeconfigurator/js/live_configurator.js index e44a7502c..9ce1bc92c 100644 --- a/modules/themeconfigurator/js/live_configurator.js +++ b/modules/themeconfigurator/js/live_configurator.js @@ -30,6 +30,7 @@ $(document).ready( function() { $('#theme').val($(this).attr('class')); + $(this).closest('form').submit(); } ); @@ -80,5 +81,20 @@ $(document).ready( } } ); + + $('#font').change( + function() + { + $(document.body).css('font-family', $('#font option:selected').text()); + } + ); + + $('#reset').click( + function() + { + $('#theme').val(''); + $(this).closest('form').submit(); + } + ); } ); \ No newline at end of file diff --git a/modules/themeconfigurator/themeconfigurator.php b/modules/themeconfigurator/themeconfigurator.php index c559074ef..868fea40a 100644 --- a/modules/themeconfigurator/themeconfigurator.php +++ b/modules/themeconfigurator/themeconfigurator.php @@ -189,7 +189,18 @@ class ThemeConfigurator extends Module public function hookdisplayHeader($params) { - $this->context->controller->addCss($this->_path.'views/css/hooks.css', 'all'); + $this->context->controller->addCss($this->_path.'views/css/hooks.css', 'all'); + + if ((int)Tools::getValue('live_configurator', 0) == 1) + { + if (Tools::getValue('theme')) + $this->context->controller->addCss($this->smarty->smarty->tpl_vars['css_dir']->value.Tools::getValue('theme').'.css', 'all'); + } + else + { + if (Configuration::get('PS_TC_THEME') != '') + $this->context->controller->addCss($this->smarty->smarty->tpl_vars['css_dir']->value.Tools::getValue('theme').'.css', 'all'); + } } public function hookDisplayTop() @@ -208,6 +219,7 @@ class ThemeConfigurator extends Module $this->smarty->assign(array( 'themes' => unserialize(Configuration::get('PS_TC_THEMES')), 'fonts' => unserialize(Configuration::get('PS_TC_FONTS')), + 'theme' => Tools::getValue('theme', ''), 'advertisement_image' => $this->_path.'/img/'.$this->context->language->iso_code.'/advertisement.png', 'advertisement_text' => $this->l('Over 500+ PrestaShop Premium Templates! Browse Now!') )); @@ -532,6 +544,12 @@ class ThemeConfigurator extends Module ), ); } + + $inputs[] = array( + 'type' => 'free', + 'label' => $this->l('Live configurator'), + 'name' => 'live-conf' + ); $fields_form = array( 'form' => array( @@ -559,7 +577,8 @@ class ThemeConfigurator extends Module $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false).'&configure='.$this->name.'&tab_module='.$this->tab.'&module_name='.$this->name; $helper->token = Tools::getAdminTokenLite('AdminModules'); $helper->tpl_vars = array( - 'fields_value' => $this->getConfigFieldsValues(), + 'fields_value' => array_merge($this->getConfigFieldsValues(), + array('live-conf' => ' Live configurator')), 'languages' => $this->context->controller->getLanguages(), 'id_language' => $this->context->language->id ); diff --git a/modules/themeconfigurator/views/templates/hook/live_configurator.tpl b/modules/themeconfigurator/views/templates/hook/live_configurator.tpl index 19e2e6e29..2b6449c52 100644 --- a/modules/themeconfigurator/views/templates/hook/live_configurator.tpl +++ b/modules/themeconfigurator/views/templates/hook/live_configurator.tpl @@ -26,8 +26,8 @@
-
- + +

{l s='The customization tool allows you to make color and font changes in your theme.' mod='themeconfigurator'}

@@ -61,14 +61,15 @@

{l s='Global' mod='themeconfigurator'}

- + {foreach $fonts as $key => $font} {/foreach}
- +
diff --git a/modules/themeconfigurator/css/theme-style1.css b/themes/default-bootstrap/css/theme1.css similarity index 100% rename from modules/themeconfigurator/css/theme-style1.css rename to themes/default-bootstrap/css/theme1.css diff --git a/modules/themeconfigurator/css/theme-style2.css b/themes/default-bootstrap/css/theme2.css similarity index 100% rename from modules/themeconfigurator/css/theme-style2.css rename to themes/default-bootstrap/css/theme2.css diff --git a/modules/themeconfigurator/css/theme-style3.css b/themes/default-bootstrap/css/theme3.css similarity index 100% rename from modules/themeconfigurator/css/theme-style3.css rename to themes/default-bootstrap/css/theme3.css diff --git a/modules/themeconfigurator/css/theme-style8.css b/themes/default-bootstrap/css/theme8.css similarity index 100% rename from modules/themeconfigurator/css/theme-style8.css rename to themes/default-bootstrap/css/theme8.css