Jump to content

block top cart and advanced top menu BUG with IE(any version)


Recommended Posts

I have a big problem with two modules (block top cart,advanced top menu) on the pages of category in IE(any version).

When I load my site,my home page looks great,but when I click to any category page, I see broken header, my menu doesn't have style at all and block top cart too! But when I go to the HTML, it's miracle - css's file is in own place!

 

http://screencast.com/t/NVPdfBGo - in IE(any version) on page of category

 

http://screencast.com/t/lotGvSbjY - in IE on the home page

 

url site: elcharm.ru

 

Please anybody help with my problem. I have no any idea at all!

Link to comment
Share on other sites

Hi,

Are you referring to the blocktopmenu and blockcart2 modules that come with presta's new template for 1.4?

If so, it's a known bug of the blocktopmenu module, since the css file is loaded after the block itself, and IE doesn't like it. Try loading it in the header, or modify the module and use the addCSS function to load it along with the others (of course, I'm assuming you know how to code a module)

  • Like 1
Link to comment
Share on other sites

If so, it's a known bug of the blocktopmenu module, since the css file is loaded after the block itself, and IE doesn't like it.

 

Is this bug in prestashop only?

Becouse, I try to implement this situation in other CMS(opencart), and I get nothing like with prestashop.

Link to comment
Share on other sites

this statement doesn't work right

 if (sizeof($css))
  file_put_contents(dirname(__FILE__) . '/' . self::DYN_CSS_FILE, implode(" ", $css));
 else
  file_put_contents(dirname(__FILE__) . '/' . self::DYN_CSS_FILE, '');
}

 

 

Array $css isn't filled!I have no idea,why is this so!

 

function generateCss() {
 global $cookie;
 $menus = AdvancedTopMenuClass::getMenus($cookie->id_lang);
 $columnsWrap = AdvancedTopMenuColumnWrapClass::getColumnsWrap();
 $css = array ();
 foreach ( $menus as $menu ) {
  if ($menu ['txt_color_menu_tab'])
$css [] = '.advtm_menu_' . $menu ['id_menu'] . ' .advtm_menu_span_' . $menu ['id_menu'] . ', .advtm_menu_' . $menu ['id_menu'] . ' a .advtm_menu_span_' . $menu ['id_menu'] . ' {color:' . htmlentities($menu ['txt_color_menu_tab'], ENT_COMPAT, 'UTF-8') . '!important;}';
  if ($menu ['txt_color_menu_tab_hover']) {
$css [] = '.advtm_menu_' . $menu ['id_menu'] . ' a:hover .advtm_menu_span_' . $menu ['id_menu'] . ', .advtm_menu_' . $menu ['id_menu'] . ' a.advtm_menu_actif .advtm_menu_span_' . $menu ['id_menu'] . ', .advtm_menu_' . $menu ['id_menu'] . ':hover > a.a-niveau1 .advtm_menu_span_' . $menu ['id_menu'] . ' {color:' . htmlentities($menu ['txt_color_menu_tab_hover'], ENT_COMPAT, 'UTF-8') . '!important;}';
//ie6
$css [] = '* html .advtm_menu_' . $menu ['id_menu'] . ' a:hover .advtm_menu_span_' . $menu ['id_menu'] . ', * html .advtm_menu_' . $menu ['id_menu'] . ' a.advtm_menu_actif .advtm_menu_span_' . $menu ['id_menu'] . ' {color:' . htmlentities($menu ['txt_color_menu_tab_hover'], ENT_COMPAT, 'UTF-8') . '!important;}';
  }
  if ($menu ['fnd_color_menu_tab']) {
$menu ['fnd_color_menu_tab'] = explode($this->gradient_separator, $menu ['fnd_color_menu_tab']);
if (isset($menu ['fnd_color_menu_tab'] [1])) {
 $color1 = htmlentities($menu ['fnd_color_menu_tab'] [0], ENT_COMPAT, 'UTF-8');
 $color2 = htmlentities($menu ['fnd_color_menu_tab'] [1], ENT_COMPAT, 'UTF-8');
 $css [] = '.advtm_menu_' . $menu ['id_menu'] . ' a .advtm_menu_span_' . $menu ['id_menu'] . ' {background-color: ' . $color1 . ';filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=\'' . $color1 . '\', endColorstr=\'' . $color2 . '\')!important; background: -webkit-gradient(linear, left top, left bottom, from(' . $color1 . '), to(' . $color2 . '))!important;background: -moz-linear-gradient(top,  ' . $color1 . ',  ' . $color2 . ')!important;}';
}
else
 $css [] = '.advtm_menu_' . $menu ['id_menu'] . ' a .advtm_menu_span_' . $menu ['id_menu'] . ' {background-color:' . htmlentities($menu ['fnd_color_menu_tab'] [0], ENT_COMPAT, 'UTF-8') . '!important;filter: none!important; background: ' . htmlentities($menu ['fnd_color_menu_tab'] [0], ENT_COMPAT, 'UTF-8') . '!important;background: ' . htmlentities($menu ['fnd_color_menu_tab'] [0], ENT_COMPAT, 'UTF-8') . '!important;}';
  }
  if ($menu ['fnd_color_menu_tab_over']) {
$menu ['fnd_color_menu_tab_over'] = explode($this->gradient_separator, $menu ['fnd_color_menu_tab_over']);
if (isset($menu ['fnd_color_menu_tab_over'] [1])) {
 $color1 = htmlentities($menu ['fnd_color_menu_tab_over'] [0], ENT_COMPAT, 'UTF-8');
 $color2 = htmlentities($menu ['fnd_color_menu_tab_over'] [1], ENT_COMPAT, 'UTF-8');
 $css [] = '.advtm_menu_' . $menu ['id_menu'] . ' a:hover .advtm_menu_span_' . $menu ['id_menu'] . ', .advtm_menu_' . $menu ['id_menu'] . ' a.advtm_menu_actif .advtm_menu_span_' . $menu ['id_menu'] . ', .advtm_menu_' . $menu ['id_menu'] . ':hover > a.a-niveau1 .advtm_menu_span_' . $menu ['id_menu'] . ' {background-color: ' . $color1 . '!important;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=\'' . $color1 . '\', endColorstr=\'' . $color2 . '\')!important; background: -webkit-gradient(linear, left top, left bottom, from(' . $color1 . '), to(' . $color2 . '))!important;background: -moz-linear-gradient(top,  ' . $color1 . ',  ' . $color2 . ')!important;}';
 $css [] = '* html .advtm_menu_' . $menu ['id_menu'] . ' a:hover .advtm_menu_span_' . $menu ['id_menu'] . ', * html .advtm_menu_' . $menu ['id_menu'] . ' a.advtm_menu_actif .advtm_menu_span_' . $menu ['id_menu'] . ' {background-color:transparent!important;background:transparent!important;filter:none!important;filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=\'' . $color1 . '\', endColorstr=\'' . $color2 . '\')!important;}';
}
else {
 $css [] = '.advtm_menu_' . $menu ['id_menu'] . ' a:hover .advtm_menu_span_' . $menu ['id_menu'] . ', .advtm_menu_' . $menu ['id_menu'] . ' a.advtm_menu_actif .advtm_menu_span_' . $menu ['id_menu'] . ', .advtm_menu_' . $menu ['id_menu'] . ':hover > a.a-niveau1 .advtm_menu_span_' . $menu ['id_menu'] . ' {background-color:' . htmlentities($menu ['fnd_color_menu_tab_over'] [0], ENT_COMPAT, 'UTF-8') . '!important;filter: none!important; background: ' . htmlentities($menu ['fnd_color_menu_tab_over'] [0], ENT_COMPAT, 'UTF-8') . '!important;background: ' . htmlentities($menu ['fnd_color_menu_tab_over'] [0], ENT_COMPAT, 'UTF-8') . '!important;}';
 //ie6
 $css [] = '* html .advtm_menu_' . $menu ['id_menu'] . ' a:hover .advtm_menu_span_' . $menu ['id_menu'] . ', .advtm_menu_' . $menu ['id_menu'] . ' a.advtm_menu_actif .advtm_menu_span_' . $menu ['id_menu'] . ' {background-color:' . htmlentities($menu ['fnd_color_menu_tab_over'] [0], ENT_COMPAT, 'UTF-8') . '!important;filter:none!important;}';
 $css [] = '* html .advtm_menu_' . $menu ['id_menu'] . ' a:hover, .advtm_menu_' . $menu ['id_menu'] . ' a.advtm_menu_actif {filter:none!important;}';
}
  }
  if ($menu ['border_size_tab']) {
$css [] = 'li.advtm_menu_' . $menu ['id_menu'] . ' a.a-niveau1 {border-width:' . htmlentities($menu ['border_size_tab'], ENT_COMPAT, 'UTF-8') . '!important;}';
  }
  if ($menu ['border_color_tab']) {
$css [] = 'li.advtm_menu_' . $menu ['id_menu'] . ' a.a-niveau1 {border-color:' . htmlentities($menu ['border_color_tab'], ENT_COMPAT, 'UTF-8') . '!important;}';
  }
  if ($menu ['width_submenu']) {
$css [] = '.advtm_menu_' . $menu ['id_menu'] . ' .adtm_sub {width:' . htmlentities($menu ['width_submenu'], ENT_COMPAT, 'UTF-8') . 'px!important;}';
  }
  elseif ($menu ['width_submenu'] === '0')
$css [] = '.advtm_menu_' . $menu ['id_menu'] . ' .adtm_sub {width:auto!important;}';
  if ($menu ['minheight_submenu']) {
$css [] = '.advtm_menu_' . $menu ['id_menu'] . ' .adtm_sub {min-height:' . htmlentities($menu ['minheight_submenu'], ENT_COMPAT, 'UTF-8') . 'px!important;}';
$css [] = '* html .advtm_menu_' . $menu ['id_menu'] . ' .adtm_sub {height:' . htmlentities($menu ['minheight_submenu'], ENT_COMPAT, 'UTF-8') . 'px!important;}';
$css [] = '#adtm_menu .advtm_menu_' . $menu ['id_menu'] . ' div.adtm_column_wrap {min-height:' . htmlentities($menu ['minheight_submenu'], ENT_COMPAT, 'UTF-8') . 'px!important;}';
$css [] = '* html #adtm_menu .advtm_menu_' . $menu ['id_menu'] . ' div.adtm_column_wrap {height:' . htmlentities($menu ['minheight_submenu'], ENT_COMPAT, 'UTF-8') . 'px!important;}';
  }
  elseif ($menu ['minheight_submenu'] === '0') {
$css [] = '.advtm_menu_' . $menu ['id_menu'] . ' .adtm_sub {height:auto!important;min-height:0!important;}';
$css [] = '#adtm_menu .advtm_menu_' . $menu ['id_menu'] . ' div.adtm_column_wrap {height:auto!important;min-height:0!important;}';
  }
  if ($menu ['position_submenu']) {
if (intval($menu ['position_submenu']) == 1 || intval($menu ['position_submenu']) == 3)
 $css [] = '#adtm_menu ul#menu li.advtm_menu_' . $menu ['id_menu'] . ':hover, #adtm_menu ul#menu li.advtm_menu_' . $menu ['id_menu'] . ' a.a-niveau1:hover  {position:relative!important;}';
elseif (intval($menu ['position_submenu']) == 2)
 $css [] = '#adtm_menu ul#menu li.advtm_menu_' . $menu ['id_menu'] . ':hover, #adtm_menu ul#menu li.advtm_menu_' . $menu ['id_menu'] . ' a.a-niveau1:hover  {position:static!important;}';
if (intval($menu ['position_submenu']) == 3) {
 $css [] = '#adtm_menu ul#menu li.advtm_menu_' . $menu ['id_menu'] . ':hover div.adtm_sub  {left:auto!important;right:0!important;}';
 $css [] = '#adtm_menu ul#menu li.advtm_menu_' . $menu ['id_menu'] . ' a:hover div.adtm_sub  {left:auto!important;right:1px!important;}';
}
  }
  if ($menu ['fnd_color_submenu']) {
$menu ['fnd_color_submenu'] = explode($this->gradient_separator, $menu ['fnd_color_submenu']);
if (isset($menu ['fnd_color_submenu'] [1])) {
 $color1 = htmlentities($menu ['fnd_color_submenu'] [0], ENT_COMPAT, 'UTF-8');
 $color2 = htmlentities($menu ['fnd_color_submenu'] [1], ENT_COMPAT, 'UTF-8');
 $css [] = '.advtm_menu_' . $menu ['id_menu'] . ' .adtm_sub {background-color: ' . $color1 . ';filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=\'' . $color1 . '\', endColorstr=\'' . $color2 . '\')!important; background: -webkit-gradient(linear, left top, left bottom, from(' . $color1 . '), to(' . $color2 . '))!important;background: -moz-linear-gradient(top,  ' . $color1 . ',  ' . $color2 . ')!important;}';
}
else
 $css [] = '.advtm_menu_' . $menu ['id_menu'] . ' .adtm_sub {background-color:' . htmlentities($menu ['fnd_color_submenu'] [0], ENT_COMPAT, 'UTF-8') . '!important;filter: none!important; background: ' . htmlentities($menu ['fnd_color_submenu'] [0], ENT_COMPAT, 'UTF-8') . '!important;background: ' . htmlentities($menu ['fnd_color_submenu'] [0], ENT_COMPAT, 'UTF-8') . '!important;}';
  }
  if ($menu ['border_color_submenu'])
$css [] = '.advtm_menu_' . $menu ['id_menu'] . '  div.adtm_sub {border-color:' . htmlentities($menu ['border_color_submenu'], ENT_COMPAT, 'UTF-8') . '!important;}';
  if ($menu ['border_size_submenu']) {
$css [] = '.advtm_menu_' . $menu ['id_menu'] . '  div.adtm_sub {border-width:' . htmlentities($menu ['border_size_submenu'], ENT_COMPAT, 'UTF-8') . '!important;}';
  }
 }
 foreach ( $columnsWrap as $columnWrap ) {
  if ($columnWrap ['bg_color']) {
$columnWrap ['bg_color'] = explode($this->gradient_separator, $columnWrap ['bg_color']);
if (isset($columnWrap ['bg_color'] [1])) {
 $color1 = htmlentities($columnWrap ['bg_color'] [0], ENT_COMPAT, 'UTF-8');
 $color2 = htmlentities($columnWrap ['bg_color'] [1], ENT_COMPAT, 'UTF-8');
 $css [] = '.advtm_column_wrap_td_' . $columnWrap ['id_wrap'] . ' {background-color: ' . $color1 . ';filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=\'' . $color1 . '\', endColorstr=\'' . $color2 . '\')!important; background: -webkit-gradient(linear, left top, left bottom, from(' . $color1 . '), to(' . $color2 . '))!important;background: -moz-linear-gradient(top,  ' . $color1 . ',  ' . $color2 . ')!important;}';
}
else
 $css [] = '.advtm_column_wrap_td_' . $columnWrap ['id_wrap'] . ' {background-color:' . htmlentities($columnWrap ['bg_color'] [0], ENT_COMPAT, 'UTF-8') . '!important;filter: none!important; background: ' . htmlentities($columnWrap ['bg_color'] [0], ENT_COMPAT, 'UTF-8') . '!important;background: ' . htmlentities($columnWrap ['bg_color'] [0], ENT_COMPAT, 'UTF-8') . '!important;}';
  }
  if ($columnWrap ['txt_color_column'])
$css [] = '.advtm_column_wrap_' . $columnWrap ['id_wrap'] . ' h5, .advtm_column_wrap_' . $columnWrap ['id_wrap'] . ' h5 a  {color:' . htmlentities($columnWrap ['txt_color_column'], ENT_COMPAT, 'UTF-8') . '!important;}';
  if ($columnWrap ['txt_color_column_over'])
$css [] = '.advtm_column_wrap_' . $columnWrap ['id_wrap'] . ' h5 a:hover  {color:' . htmlentities($columnWrap ['txt_color_column_over'], ENT_COMPAT, 'UTF-8') . '!important;}';
  if ($columnWrap ['txt_color_element'])
$css [] = '.advtm_column_wrap_' . $columnWrap ['id_wrap'] . ', .advtm_column_wrap_' . $columnWrap ['id_wrap'] . ' a  {color:' . htmlentities($columnWrap ['txt_color_element'], ENT_COMPAT, 'UTF-8') . '!important;}';
  if ($columnWrap ['txt_color_element_over'])
$css [] = '.advtm_column_wrap_' . $columnWrap ['id_wrap'] . ' a:hover  {color:' . htmlentities($columnWrap ['txt_color_element_over'], ENT_COMPAT, 'UTF-8') . '!important;}';
  if ($columnWrap ['width'])
$css [] = '.advtm_column_wrap_' . $columnWrap ['id_wrap'] . ' {width:' . htmlentities($columnWrap ['width'], ENT_COMPAT, 'UTF-8') . 'px!important;}';
 }
 if (sizeof($css))
  file_put_contents(dirname(__FILE__) . '/' . self::DYN_CSS_FILE, implode(" ", $css));
 else
  file_put_contents(dirname(__FILE__) . '/' . self::DYN_CSS_FILE, '');
}

Edited by Oskar87 (see edit history)
Link to comment
Share on other sites

  • 4 weeks later...

I have the same issue with a new site.

I already have 2 other sites working with the same templates and system which are working perfectly.

 

As far as I can see now it's true that the advanced top menu css files are not loading in IE 9 while they are included in the head section.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...