Studios Web C.A
Member
Posted 5 months ago #
I´ve got this error:
Fatal error: Cannot redeclare __() (previously declared in /home/credimal/public_html/wp-includes/l10n.php:96) in /home/credimal/public_html/magento/app/code/core/Mage/Core/functions.php on line 97
I´ve install and uninstal the pluggin and nothing, the error stills.... (sorry for my english I speak spanish).
I don´t know what to do....
http://wordpress.org/extend/plugins/magento-wordpress-integration/
viccie85
Member
Posted 5 months ago #
Same here, followed instructions, entered the url to the Mage.php file, broke the entire website. Managed to get it working by changing the line of code in functions.php to
if(!function_exists('__')) { function __() { return Mage::app()->getTranslator()->translate(func_get_args()); } }
Steps 1 - 6 of the instructions outline the steps to do exactly that...
viccie85
Member
Posted 5 months ago #
Look again, code is a bit different. :)
Can't see a difference! What is it?
viccie85
Member
Posted 5 months ago #
if(!function_exists('__'))
{
function __()
{
return Mage::app()->getTranslator()->translate(func_get_args()); }
}
if(!function_exists('__'))
{
function __()
{
function __() { return Mage::app()->getTranslator()->translate(func_get_args()); }
}
}
Where are you seeing this? That's not what it says on the instructions: http://magentowp.com/documentation/installation/
viccie85
Member
Posted 5 months ago #
I know I had to change it
You changed it to the second block of code you pasted? Because that code is invalid.
viccie85
Member
Posted 5 months ago #
Yes I did, I dunno what else to do because it broke the entire site and the plugin page. Right now the plugin works, I get a green Mage.php found message and I just purchased the Shortcodes & Widgets and activated it.
The line of code on the instructions didn't work, maybe you have a solution for me?
Can you email me your functions.php file?
viccie85
Member
Posted 5 months ago #
Of course, what's your e-mail address?
Send it to sales@magentowp.com - Cheers.
viccie85
Member
Posted 5 months ago #
ontherocks
Member
Posted 4 months ago #
I am having the same problem, and I would be interested to know if this change is okay to use.
I fixed Viccie's issue by following the steps outlined in the instructions. I'm not sure where he was going wrong. Perhaps you could outline the steps you've taken so far.
If the instructions aren't clear enough I'll be happy to update them, I just need to find out where people are going wrong!
ontherocks
Member
Posted 4 months ago #
Being the holidays, I went ahead and tried viccie's version of the php code and everthing has been working perfectly ever since. Killer plug-in, btw.
Don't know why putting a function in a function would make any difference, but it did. I'll email you the steps I took to install, I believe I followed everything verbatim (many times), maybe you can shed some light.
Thanks -
crodesign
Member
Posted 2 months ago #
I have followed your installation directions exactly (for a local install) and am still having the same issue. I thought I had already done it so made the change to the file after the initial install.
When that didn't work, I removed the plugin and tried again. And still get the following response:
Fatal error: Cannot redeclare __() (previously declared in C:\server\htdocs\wordpress\default\wp-includes\l10n.php:96) in C:\server\htdocs\magento\default\app\code\local\Mage\Core\functions.php on line 96
As you can see it is pulling from the correct file location.
Thank you in advance.
crodesign
Member
Posted 2 months ago #
I have purchased the shortcodes & widgets add-on, does it need to be deactivated?
Could you screen shot the code you added to the functions.php file?
crodesign
Member
Posted 2 months ago #
Silly me, I responded to the system email from your response... Here's a link to the screenshot:
Link to image
Also, I have tried this a fresh install of both Magento and WordPress. Getting the very same error.
Thank you.
You should be replacing the whole function with the code provided here, not the contents within the function: http://magentowp.com/documentation/installation/
if(!function_exists('__')) {
function __() { return Mage::app()->getTranslator()->translate(func_get_args()); }
}
Not:
function __() {
if(!function_exists('__')) {
function __() { return Mage::app()->getTranslator()->translate(func_get_args()); }
}
}
Can you confirm whether this was the solution?
crodesign
Member
Posted 2 months ago #
This was indeed the proper solution. Turns out the issue was not with the Magento or WordPress. But rather with my template file for Magento. It was loading an independent functions.php. Once I added your script mod to it, everything worked out just fine.
Thank you