Jump to content

Edit - no global.css applied to wishlist page - Wishlist Style/Layout lost after upgrade to 1.5.4


Recommended Posts

I may have posted this in the wrong forum previously, so here goes in this one...

 

I have updated my site from 1.4.8 to 1.5.4 using the 1-click upgrade module. It worked quite well, except for all the custom mods I had to re-do!

 

But anyway, my wishlist module does not seem to be working correctly after the upgrade. The styling doesn't seem to be getting applied to the "My Wishlists" page.

 

This is how my new wishlist page looks

post-395387-0-64992800-1365412466_thumb.jpg

 

But this is how it should look

post-395387-0-10405000-1365412477_thumb.jpg

 

Can anyone advise why this might be?

 

Thanks in advance...

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

I have just realized that my global.css is not getting applied to my Wishlist page, this is what is causing my issue! If I edit the source html and add a link to my global.css the page looks correct.

 

Can anyone tell my why my global.css might not be getting applied to this page and maybe how to resolve this?

 

Thanks...

Link to comment
Share on other sites

You are not alone. I am having the same issue with a module generated page since PS1.5.4 and another user reportet this error too

http://www.prestasho...96#entry1170296

Everything worked fine in 1.5.3.1 so it must have something to do with the upgrade.

The other user (see the link) has an error message about a deprecated header function.

I am not getting this error but the header most likely plays a role since it usually is including the css.

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

Someone please correct me if I am wrong but the wishlist is technically a cms page yes?

If so, you can call the css file in CMScontroller.php

 

The code will look something like this:

public function setMedia()
{
 parent::setMedia();

 if ($this->assignCase == 1)
  $this->addJS(_THEME_JS_DIR_.'cms.js');
  $this->addJS(_THEME_JS_DIR_.'jquery-1.3.2.js');
  $this->addCSS(_THEME_CSS_DIR_.'cms.css');
  $this->addCSS(_THEME_CSS_DIR_.'global.css');
}

 

I had to do this to call some custom css and js for an image gallery this way.

Create a backup of the file before changing - just in case you do not get the desired results.

Link to comment
Share on other sites

These steps do indeed help to call a css file for cms pages, however I don't think the "mywishlist" page is a cms page as it did not call the files still.

 

Is there another .php file that this code can be added to for calling the css sheet? I have tried to add it to ./modules/blockwishlist/mywishlist.php but the page just errors out.

 

Cheers...

Link to comment
Share on other sites

I have not tested this but the controller for mywishlist is located in modules/blockwishlist/controllers/front/mywishlist.php

 

You can try adding the lines I listed above something like:

public function setMedia()
{
 parent::setMedia();
 if ($this->assignCase == 1)
 $this->addCSS(_THEME_CSS_DIR_.'global.css');
}

 

Again, backup mywishlist.php first in case you get what you got the last time so you can replace with a fresh copy. I don't know if this is the most efficient way to call it but if it works then I guess it doesn't matter :)

Link to comment
Share on other sites

I have not tested this but the controller for mywishlist is located in modules/blockwishlist/controllers/front/mywishlist.php

 

No luck I'm afraid, I have added this control to "modules/blockwishlist/controllers/front/mywishlist.php" and reloaded the page but it is still not calling global.css

 

:( :( :(

Link to comment
Share on other sites

This resolved my issue... :D

 

Modifying my header.php so it looks like the below has added the call to the required css sheets.

 

This may add some additional load to my site as all the media will probably be loaded now for every page, but this seems to be the only fix for this for now.

 

Thank you so much for helping with this Whispar1...!

 

if (isset(Context::getContext()->controller))
$controller = Context::getContext()->controller;
else
{
$controller = new FrontController();
$controller->init();
$controller->setMedia(); 
}
Tools::displayFileAsDeprecated();
$controller->displayHeader();

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

This resolved my issue... :D

 

Modifying my header.php so it looks like the below has added the call to the required css sheets.

 

This may add some additional load to my site as all the media will probably be loaded now for every page, but this seems to be the only fix for this for now.

 

Thank you so much for helping with this Whispar1...!

 

if (isset(Context::getContext()->controller))
$controller = Context::getContext()->controller;
else
{
$controller = new FrontController();
$controller->init();
$controller->setMedia();
}
Tools::displayFileAsDeprecated();
$controller->displayHeader();

 

I hav eprestashop 1.5.4.1 and i have the same ploblem, i change that but no works :(

Link to comment
Share on other sites

I hav eprestashop 1.5.4.1 and i have the same ploblem, i change that but no works :(

 

Please try to insert the line $this->setMedia(); at the end of the init() function located in /classes/FrontController.php (exemple below)

 $this->iso = $iso;
 $this->setMedia();
 $this->context->cart = $cart;
 $this->context->currency = $currency;
}

 

and remove it from header.php, like it was in 1.5.3

Link to comment
Share on other sites

  • 4 months later...

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...