Magento newsletter subscribe does not display success or error messages - magento

I'm trying to put a newsletter subscription in the footer of a new site, I have it displaying and posting but:
it does not redirect to a success page
it does send the confirmation notice
unverified subscribers do show up in the admin
clicking on the verification link in the email just goes to the magento home page but does confirm the subscription.
switching the theme back to default works [notices and success url work]
I'm placing the form in the footer using local.xml:
<reference name="footer">
<block
type="newsletter/subscribe"
name="newsletter"
template="newsletter/subscribe.phtml"/>
</reference>
The actual form is the default magento newsletter form with no changes.
How do I get it to show success & error messages on both subscription attempts AND on mail confirmation?
How do I get the confirmation link [in the email] to go to another page in magento other than the home page i.e. a success page or error page?

As I can see in this method \Mage_Newsletter_SubscriberController::newAction (which is called on this action)
You should check where actually in this method you end up. The best way would be to use debugger and set a breakpoint at the beginning of this method. Alternative way would be to use Mage::log as logging mechanism, so you can see where do you end up and why messages doesn't show. As I can see there are multiple outputs for session messages, like here $session->addSuccess($this->__('Confirmation request has been sent.'));
This function is used to redirect to the page that the request came from:$this->_redirectReferer();
You can replace that method call with $this->_redirectUrl($some_url);
Also, if you are overwriting some of the core files, it is always advisable to copy that file (with module structure) to app/code/local/, in order to keep Magento version maintainable.

Related

Wicket Submit BehaviorListener after RestartResponseExeption and Session replacement

I have a AjaxFallbackLink to add a product into the wishlist of a customer. When a guest clicks the Link he is redirected to the login page with a RestartResponseAtInterceptPage. After successful login he returned to the first Page. But the URL contains the IBehaviorListener of my "add to wishlist" Link and every Ajax Link does nothing except to reload the page with no changes. I think the problem is the incorrect match of Page instance and BehaviorListener instance because my Page started with instance 1 and returned with instance 4 from Login Page. Everything works when the guest is already logged in.
How can i remove the illegal URL parameter or call the right Link callback to add the product to wishlist after successful login?
I think you need to do the following, in YourApplication#init() add:
getPageSettings().setCallListenerInterfaceAfterExpiry(true)
You can override it per Page if you don't want to enable it globally, see org.apache.wicket.Component#canCallListenerInterfaceAfterExpiry()

Magento checkout cart success page on customer suggestion form

On Checkout cart success page on message after i want display
suggestion or feedback form with multiple option.
After fill information send mail.
Comment and feedback option validation without page refresh.
You need to develop your own module with ajax capabilities, sending information to the controller of your module.
The module should also include a block which should be added in the checkout_onepage_success layout.
More on module creation here : Magento wiki custom module with database
To create the form and have the mail notifications you can check it out at inchoo here: Custom email contact form with notification system
Good luck.

Load magento view via ajax?

I have the folliwng file:
app/design/frontend/default/site/template/checkout/cart/cartheader.phtml
I want to load this in via ajax, so that when the cart is updated, we can trigger an ajax call to get the contents of this file and update the page on the fly.
Does anybody know how I can access this file via ajax or even just from my browser so I can see the contents?
Thank you
You need to create a new controller with methods from CartController.php this controller can be found in app/code/core/Mage/Checkout/controllers . The methods to add and remove items from cart should be changed to use ajax and return json. The json returned can have the session messages - global messages block and cart header block, maybe other blocks depending on all info you want to update.
app/design/frontend/default/site/template/checkout/cart/cartheader.phtml is from the enterprise theme and is the template for the block Mage_Checkout_Block_Cart_Sidebar. This template is set inside layout/checkout.xml
<block type="checkout/cart_sidebar" name="cart_sidebar" as="topCart" template="checkout/cart/cartheader.phtml">...</block>
To get it from a controller you can add it to the layout xml of that controller, or use:
$this->loadLayout()->getLayout()->createBlock('checkout/cart_sidebar')->toHtml();
But inside Enterprise, this block already loads using ajax.

How to Load custom page between place-order-click and thank-you-page in magento

hi,
Can any one tell me,how to load custom page between checkout onepage & Checkout success page in magento? Reply as soon as possible.
Thanx.
Krupa Parikh
It could be hard as after clicking 'place order' form is send to checkout controller and if no redirect to payment gate is required magento redirects to checkout success page. If you need some custom redirect you need to hook into controller_front_send_response_before event and change the response (but first check the action as this is general event fired by every action and every controller).

Error Messages are not displayed on my custom registration form phtml page in magento

I am currently working on managing three types(normal user, Author, Editor) of users in magento.
I need to create a separate registration forms for Author and editor. But all the users are saved using the single createpost action in Accountcontroller.php .
The registration form for author is in authorregister.phtml every thing is working fine except the error messages.
Form error messages are not diplayed on the authorregister.phtml file.
Then i plced the block $this->getMessagesBlock()->getGroupedHtml(); even after that also the error messages are not displyed.
To My Surprise these error messages are going and displaying on persistent/customer/form/register.phtml page.
i am unable to find the issue why this form error messages are getting displayed on that page load.
can any one help me out.
Hello following tips may be help you.....
In authorregister.phtml add first line
< div id="messages_product_view"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?>< /div>
In Accountcontroller.php before redirect
Mage::getSingleton('core/session')->addSuccess(Mage::helper('modulename')->__('Thank you .'));

Resources