문제

I want to redirect user to external link. When this statement is executed:

$observer->getRequest()->setParam('return_url','http://www.google.com/');

I always get the following error:

External urls redirect to "google.com/"; denied!

Did somebody have the same issue?

도움이 되었습니까?

해결책

Try Following in your Observer

<?php 
    Mage::app()->getResponse()->setRedirect($url)->sendResponse(); 
    // or 
    Mage::app()->getFrontController()->getResponse()->setRedirect($url)->sendResponse(); 
?>

More information you can find here and here

다른 팁

You cannot redirect from php in an ajax call.

You need to send the right information back from your php script to your java script and do the redirect from there, using the parameters you got back from php.

In your ajax response you can check status of request and then you have to check if it's success then you can redirect using javacript

        window.location.href = "http://www.google.com";

Let me know if you have any query

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top