0

I wish to show newsletter subscription global messages(like Thank you for your subscription.etc.) in popup.When a user click on newsletter subscription the default global message should come in popup. Followed this approach both at app/design/frontend/theme/template/page/1column.phtml and app/design/frontend/theme/template/newsletter/subscribe.phtml

<script type=“text/javascript”>
var message = '<?php echo strip_tags($this->getChildHtml('global_messages')) ?>';
if (message == $this->__('Thank you for your subscription')) alert("What  ever you want to display!");

Thanks in advance:)

  • It will not work like this. You need to create your own fancy-box or popup and notification. And you placed $this in if condition in JS code , that will also not work – BornCoder Jan 16 '17 at 11:07
  • How can I do this? – user00247 Jan 16 '17 at 11:10
  • use sweet alert to display your message in popup t4t5.github.io/sweetalert – BornCoder Jan 16 '17 at 11:11
  • Thanks for your valuable suggestion, but I am unable to get global massges in alert, tried with session variable also – user00247 Jan 16 '17 at 11:13
  • try like this: alert('<?php $yourmessage; ?>'); and remove $this from your if condition – BornCoder Jan 16 '17 at 11:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.