CSS Editor doesn't save changes)

From AVACTIS : Ecommerce Shopping Cart Software Wiki
Jump to: navigation, search

This article is for Avactis version 2.1.1 build 10874, build 10999 and Free version 2.1.1 build 11999

Problem 1: I made changes using CSS Editor and I couldn't save them

Problem 2:. I created new theme using CSS Editor but the styles are reverted back to default

Solution:

Download two files from the Downloads section at your Help Desk account:

10874_css_patch.php theme_css.patch

NOTE: This patch is created for Avactis version 2.1.1 build 10874 or build 10999. Please, check your version before applying the patch.

1. Upload the attached files to the Avactis root directory on your server.

2. Launch the patch in your browser:

http://www.your_store.com/10874_css_patch.php

The script will check if it is possible to patch files. If everything is OK, you will see the list of files to be patched and no errors.

Apply the patch.

3. Go to the avactis-system/cache directory and delete all files in the directory.

4. Check the store.


NOTE: If after running the patch you see the "patch: command not found" error, it means that your server software does not include the patch utility and you will not be able to apply the patch automatically. Use the instruction below to apply the changes manually:

1.avactis-system/core/application.php

- Replace the following line:

$combined_file_abs_path = getTemplateFileAbsolutePath($combined_file_rel_path);

with this one:

$combined_file_abs_path = getTemplateFileExactAbsolutePath($combined_file_rel_path);

- Replace the following line:

elseif (is_writable(getTemplateFileAbsolutePath($combined_file_dir)))

with this one:

elseif (is_writable(getTemplateFileExactAbsolutePath($combined_file_dir)))

2.avactis-system/core/functions.php

Replace the following line:

function getTemplateFileByPattern($pattern)

with the following part of code:


function getTemplateFileExactAbsolutePath($relative_path)
{
   global $__TPL_DIR__;
   return $__TPL_DIR__ . $relative_path;
}
function getTemplateFileExactURL($relative_path)
{
   global $__TPL_URL__;
   return $__TPL_URL__ . $relative_path;
}
function getTemplateFileByPattern($pattern)

3. avactis-themes/system/pages/templates/part.header.tpl.html

Replace the following lines:

$active_theme = modApiStaticFunc('Look_Feel', 'getActiveTheme');
$url = $active_theme ? getTemplateFileURL('themes/'.THEME_FILENAME_HEAD.$active_theme.THEME_FILENAME_TAIL) : ;

With this one:

$url = modApiStaticFunc('Look_Feel', 'getActiveThemeURL');

4. avactis-system/modules/look_feel/look_feel_api.php

- Replace the following line:

if ($this -> changeSkin($current_skin))
  

with this one:

if ($this -> checkSkin($current_skin))

-Replace the following line:

if (!empty($skins) && $this -> changeSkin($skins[0]))

with this one:

if (!empty($skins) && $this -> checkSkin($skins[0]))


- Replace the following line:

static public function getEditedTheme($skin = null)

with the following part of code:

static public function getActiveThemeURL($skin = null)
   {
       $active_theme = modApiStaticFunc('Look_Feel', 'getActiveTheme');
       $theme_subpath = 'themes/'.THEME_FILENAME_HEAD.$active_theme.THEME_FILENAME_TAIL;
       $time = @filemtime(getTemplateFileExactAbsolutePath($theme_subpath));
       return $time ? getTemplateFileExactURL($theme_subpath).'?v='.$time : ;
   }
static public function getEditedTheme($skin = null)
   
   

5.avactis-system/admin/js/css_editor.js

-Replace the following line:

this.$(this.win).resize(function (event) { editor.onResizeStorefront(event); });

with these ones:

this.$(this.win).resize(function (event) { editor.onResizeStorefront(event); });
this.reloadEditedTheme();

- Replace this line:

FrameCSSEditor.prototype.changeEditedTheme = function()

with the following part of code:

FrameCSSEditor.prototype.reloadEditedTheme = function()
{
   var $css_link = this.$('#CurrentThemeStylesheet');
   var css_url = $css_link.size() ? $css_link.attr('href') : ;
   if (css_url) {
       var now = new Date();
       css_url = css_url.replace(/\?.*$/, ) + '?v=' + now.getTime();
       $css_link.attr('href', css_url);
   }
};
FrameCSSEditor.prototype.changeEditedTheme = function()