Jump to content

[resolved] - My alerts in my account block problems


Recommended Posts

I really need and advice on my problems i.e My alerts in my account block directs me to the error 500 page just when I click on it. I dont know what is wrong and desperately looking for the solution here.
The problem is with the link : http://www.beli-online.net/modules/mailalerts/myalerts.php
Will somebody please give me the solution since that I desperately looking for the solution to overcome this problem by myself.
Thanks in advance.

Link to comment
Share on other sites

Hello,

I had a similar problem and by searching the forum, I have found the solution below :

In "myalerts.ph"p :

AFTER : include(dirname(__FILE__).’/../../header.php’);

INSERT : include(dirname(__FILE__).'/../../modules/mailalerts/mailalerts.php');

Hope it will work for you.
Regards

Link to comment
Share on other sites

Nothing changed here. I saw that when I try to uninstall this module it give me an error too:

1 - first I click to uninstall and everythings looks fine BUT the option to uninstall still there!
2 - when I try to uninstall again I got the follow message:

The following module(s) were not installed successfully:

   * mailalerts



But the plugin still have the option to uninstall it on.

I already copied again the pack from installation files and got the same problem.

Link to comment
Share on other sites

  • 2 weeks later...

I have the same problem and my bug report was cancelled saying it was a server configuration which I cannot find.

There are no listings like posted in myalerts.php file.

There is a file called mailalerts-ajax_check.php that has the following:

include(dirname(FILE).’/../../config/config.inc.php’); include(dirname(FILE).’/../../init.php’); include(dirname(FILE).’/../../modules/mailalerts/mailalerts.php’);

Did anyone else put in a bug report about this?

Link to comment
Share on other sites

Melinda, if I've understood you right, you said that there's no

include(dirname(__FILE__).'/../../modules/mailalerts/mailalerts.php'); 


line in the myalerts.php. Yes, it's true. The pokemon3d's solution was to add one. I tried to do the same: it works for me. And I didn't even looked into mailalerts-ajax_check.php.

Link to comment
Share on other sites

Ok I added it under the header listing at the top and now I don't get an error but where are the alerts to signup for?

I checked both the boxes in the personal information link but all I get on the my alerts page is:
You are not subscribed to any alerts.

Is this correct or am I missing something?

Link to comment
Share on other sites

Hi,

If I had the line you said, I get this error :

Fatal error: Cannot redeclare class MailAlerts in D:\BU Open-Source\version_1\trunk\modules\mailalerts\mailalerts.php on line 458



The class is previously defined, that's why it's work fine here.

But why you need to declare it ? It's means it's never declared before on your webserver.

Link to comment
Share on other sites

I am lost on this one Phillippe.

I am on centos, php 5.2.10 and mysql 5 and this is all I know with the original file.

If I set the modules folder to chmod -R 777 then I get the server error when a customer clicks on my alerts in their account which apparently is the wrong permissions.

If I set the modules folder to chmod -R 755 I get this error:

Fatal error: require_once() [function.require]: Failed opening required ‘/home/stitched/public_html/config/../classes/MailAlerts.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home/stitched/public_html/config/config.inc.php on line 15



If I add the line to myalerts.php like this:

include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/../../header.php');
include(dirname(__FILE__).'/../../modules/mailalerts/mailalerts.php');



Then I get no errors when a customer clicks on "my alerts" in their account.

Other than adding this line which is also in mailalerts-ajax_check.php:

include(dirname(__FILE__).'/../../modules/mailalerts/mailalerts.php');



the only other option I have is to comment out the mail alerts in mailalerts -> my-account.tpl to keep from getting the "Fatal error one above.

I just commented out the

//include(dirname(__FILE__).'/../../modules/mailalerts/mailalerts.php');

in mailalerts-ajax_check.php and left it in myalerts.php with no adverse effects so maybe that would be an option.

Link to comment
Share on other sites

I know why.

MailAlerts is on the hook myAccountBlock (the block menu with links like My orders, personnal infos, addresses, etc). This is were the file mailalerts.php (with class declaration of MailAlerts) is called first.

Then, myalerts.php call MailAlerts a second time. As the file has already been included, no problem.

But, if you don't have the call in the hook myAccountBlock, then, error, because the file was never included.

I had an include_once() on the page, it should work for the two cases.

Link to comment
Share on other sites

Phillippe,

The scenario I posted has the my account block already installed along with the my alerts. It is still the same problem whether I click the my alerts in the my account block or click "Your Account" in the header and then click my alerts.

The include_once() only works for me if the
include(dirname(__FILE__).'/../../modules/mailalerts/mailalerts.php');

is in the myalerts.php file and not in the mailalerts-ajax_check.php file.

Link to comment
Share on other sites

I have the include file in myalerts.php so am I suppose to move it to mailalerts.php instead right under the <?php ?

I just tried that and moving it to the mailalerts.php file completely removes the white background I had on the page style.

I moved it back to myalerts.php and now the background is white again and it works.

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...

Can u please help me !
I have insert the following line in myalerts.php:

include(dirname(__FILE__).’/../../modules/mailalerts/mailalerts.php’);

BUT NO NEW ALERTS ARE SHOWN WHEN I CLICK ON ‘MY ALERTS’ LINK IN FRONT OFFICE

WHAT DO I NEED TO DO ???

Link to comment
Share on other sites

  • 2 weeks later...

Hello

use new code from version 13 and work :)

edit myalerts.php.

Using this code .
--------------------------------------------------------------------------

<?php

/* SSL Management */
$useSSL = true;

include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/../../header.php');
include_once(dirname(__FILE__).'/mailalerts.php');

$errors = array();

if ($cookie->isLogged())
{
if (Tools::getValue('action') == 'delete')
{
$id_customer = intval($cookie->id_customer);
if (!$id_product = intval(Tools::getValue('id_product')))
$errors[] = Tools::displayError('You need a product to delete an alert');
$id_product_attribute = intval(Tools::getValue('id_product_attribute'));
$customer = new Customer($id_customer);
MailAlerts::deleteAlert($id_customer, 0, $id_product, $id_product_attribute);
}
$smarty->assign('alerts', MailAlerts::getProductsAlerts(intval($cookie->id_customer), intval($cookie->id_lang)));
}
else
$errors[] = Tools::displayError('You need to be logged to manage your alerts');

$smarty->assign('id_customer', intval($cookie->id_customer));
$smarty->assign('errors', $errors);
$smarty->display(dirname(__FILE__).'/myalerts.tpl');

include(dirname(__FILE__).'/../../footer.php');


:)

Link to comment
Share on other sites


If I add the line to myalerts.php like this:
include(dirname(__FILE__).'/../../config/config.inc.php');
include(dirname(__FILE__).'/../../header.php');
include(dirname(__FILE__).'/../../modules/mailalerts/mailalerts.php');



Then I get no errors when a customer clicks on "my alerts" in their account.

Other than adding this line which is also in mailalerts-ajax_check.php:

include(dirname(__FILE__).'/../../modules/mailalerts/mailalerts.php');



Melinda, I had the same error and adding the line that you describe here has also fixed the problem for me.

Thanks

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