Jump to content

Fatal Error On Saving Theme


Deluxdeal.dk

Recommended Posts

  • 2 months later...

Hi

...

public function getCMSPages($id_cms_category, $id_shop = false, $id_lang = false, $id_shop2 = false, $is_list = false)
{
$id_shop = ($id_shop !== false) ? (int)$id_shop : (int)Context::getContext()->shop->id;
$id_shop = ($id_shop2 !== false) ? (int)$id_shop2 : (int)Context::getContext()->shop->id;

...

Have a nice day!

Link to comment
Share on other sites

  • 5 months later...

Hi

...

public function getCMSPages($id_cms_category, $id_shop = false, $id_lang = false, $id_shop2 = false, $is_list = false)

{

$id_shop = ($id_shop !== false) ? (int)$id_shop : (int)Context::getContext()->shop->id;

$id_shop = ($id_shop2 !== false) ? (int)$id_shop2 : (int)Context::getContext()->shop->id;

...

Have a nice day!

I had the same problem after updating to php7.0 

I applied this fix and all worked fine. 

 

Can I ask what is happening in the above code. why is it after doing this change it all started working?

Link to comment
Share on other sites

  • 2 months later...

I'm getting the same error as the OP. How do I use that code to fix it? Where to I use the command?

I tried the code mentioned and it works.

 

You should use an ftp file manager like Filezilla and navigate to /modules/tmmegamenu/classes/MegaMenu.php . You can edit the file with a code editor. I am using Adobe Edge Code editor. If you don't know how to do these and you want more detailed description, reply and I will post some tutorials.

 

On line 126 replace:

 

public function getCMSPages($id_cms_category, $id_shop = false, $id_lang = false, $id_shop = false, $is_list = false)
{
$id_shop = ($id_shop !== false) ? (int)$id_shop : (int)Context::getContext()->shop->id;
$id_lang = $id_lang ? (int)$id_lang : (int)Context::getContext()->language->id;

 

With

 

public function getCMSPages($id_cms_category, $id_shop = false, $id_lang = false, $id_shop2 = false, $is_list = false)
{
$id_shop = ($id_shop !== false) ? (int)$id_shop : (int)Context::getContext()->shop->id;
$id_shop = ($id_shop2 !== false) ? (int)$id_shop2 : (int)Context::getContext()->shop->id;

That worked for me. I don't know if Template Monster knows about it. I will speak with them in the morning.

Edited by costispaps (see edit history)
  • Haha 1
Link to comment
Share on other sites

  • 2 years 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...