Jump to content

Fatal Error On Saving Theme


Recommended Posts

When i press "USE THEME" i get this following error code:

 

Fatal error: Redefinition of parameter $id_shop in /var/www/deluxdeal.dk/public_html/modules/tmmegamenu/classes/MegaMenu.php on line 124

 

What is the problem?

 

Best regards

Junez

Share this post


Link to post
Share on other sites
  • 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!

Share this post


Link to post
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?

Share this post


Link to post
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

Share this post


Link to post
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...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More