Hi @bhagyashree11
If you wants to change message in popup only for newsletter follow the steps:
- open the block file located in /var/www/html/magento/app/code/core/Mage/Core/Block/Messages.php
- Find the function getGroupedHtml()
- Find the code in function:
foreach ( $messages as $message ) {
$html.= '<' . $this->_messagesSecondLevelTagName . '>';
$html.= '<' . $this->_messagesContentWrapperTagName . '>';
$html.= ($this->_escapeMessageFlag) ? $this->escapeHtml($message->getText()) : $message->getText();
$html.= '</' . $this->_messagesContentWrapperTagName . '>';
$html.= '</' . $this->_messagesSecondLevelTagName . '>';
}
Replace with :
foreach ( $messages as $message ) {
if($message->getText() == "Thank you for your subscription."){
$html.= "<script>";
$message = $message->getText();
$html.= "alert('$message')";
$html.= "</script>";
}else{
$html.= '<' . $this->_messagesSecondLevelTagName . '>';
$html.= '<' . $this->_messagesContentWrapperTagName . '>';
$html.= ($this->_escapeMessageFlag) ? $this->escapeHtml($message->getText()) : $message->getText();
$html.= '</' . $this->_messagesContentWrapperTagName . '>';
$html.= '</' . $this->_messagesSecondLevelTagName . '>';
}
}
this will print the newsletter message into alert.
Note: For standard development create module and override this function into your block.
Let me know if it helps
Let me know if it helps. You can raise a KUDOS if its really worth for you. Also if it solves your problem then please mark as SOLUTION.