Magento - Checkout not redirecting to success page - magento

I'm working on a store deployed using Magento. It has one module which I wrote, which has event observers for checkout_type_onepage_save_order_after, checkout_type_multishipping_create_orders_saved_after, and admin_created_order_after.
When a customer places his/her order, Magento does not redirect to a success page when my module is enabled. When I disable my module, it redirects just fine. With or without my module, the order still goes through but it's not very user-friendly if there's no thank you message of some kind.
Anyone have any ideas what the problem is? There's no entry in any error log (Apache, PHP, Magento, or database).
Using magento 1.6.2.0 on PHP 5.

In case anyone else is having the same or similar problem, I just solved a very similar issue thanks to TonyTheJet's comment here. I am using onepagecheckout in Magento CE 1.7.02
If you have a stray echo command in your code, which will send raw text to the browser, this will cause a problem on the browser side in onepagecheckout.js . It does not correctly un-encode a subsequent JSON string sent by the server to say that the order was processed successfully. Because of that, the browser fails to send a GET to trigger the onepagecheckout controller successAction().
If you are using a protocol analyser or a tool like Firefox Firebug, the crucial JSON string should look like this. The order_creates=true is what should trigger a browser request for the success page:
{"success":true,"error":false,"order_created":true}

Related

What is the correct magento CE 1.9 paypal success url?

We have magento CE 1.9 which we are trying to get some analytics on and I have seen many posts on the internet about setting up paypal with magento. I believe we have everything setup correctly for paypal standard checkout except for the return URL.
Some of the sources I found on the internet say to use
http://www.storename.com/checkout/onepage/success/
Where others say to use
http://www.storename.com/paypal/standard/success/
which one is actually correct?
An order finally reached analytics via:
http://www.storename.com/paypal/standard/success/
Other orders were completed but did not reach alalytics, I can only speculate on the reason for this. One possible cause I have read about, is premature closing of the browser window. This could prevent our sites success page from loading the analytics javascript.

Magento cart SSL issue submitting data to an insecure locations

i am using magento EE. in this when user submit couponcode then system redirect to non-secure.
full story:
i am using amazon payments so we need SSL on cart page.
i am posting couponPost on SSL but some how system redirect to non-SSL
when i submit any couponcode:
system post coupon code to SSL
automatically system redirect to NON-SSL
again system redirect to SSL
so on the way global notifications lost. any one has any idea what's going on.
same issue: http://www.tagwith.com/question_342501_magento-cart-ssl-issue-submitting-data-to-an-insecure-location
I submitted an issue on this a while back when I was working with a merchant having a similar issue. The GitHub issue can be found here along with a temporary fix.
Check this controller file : CartController.php
Location: app/code/core/Mage/Checkout/controllers/
Replace this line under _goBack() function :
$this->_redirect('checkout/cart');
to
$this->_redirect('checkout/cart',array('_secure'=>true));
Hope this helps. I suggest you to don't modify the core file. Simply override it check this method.

strange issue in category edit/update Magento

Hi i am going through very strange issue in magento , i have several categories i magento with child categories , i need to update a category information ,i am able to update the many categories but when i try to update the first category under the default category , it didn't work and the browser keeps on loading .I have tried to found the issue on google but nothing was there , in some places it was suggested that it happens due to upgrade but i haven't upgrade the magento or any other module .Please suggest me what can be the issue .
Thanks
This happens in some cases where the category name contains special characters.
This is for sure a javascript error, otherwise you would have got a response from the server, in this case the you are not getting a response and hence the loading continues. What you could do is check the server response and monitor the firebug / inspect element to get some ideas.
You can check for these javascript elements in the
/app/design/adminhtml/default/default/template/catalog/category/tree.phtml file.
You should add some more info to the question starting with the Magento version, but follow these steps:
Enable error printing in general by adding these lines to your .htaccess
SetEnv MAGE_IS_DEVELOPER_MODE 1
php_value display_errors 1
Enable logging in Magento in System->Confihuration->Developer->Log Settings
Do as Keyut suggested and try to update the erroneous category with the console open, monitoring the XHR calls. Check the response of the call invoked after you clicked "Save" for errors.
Do as Tobias suggested and check the logs found under var/log in your Magento folder.
By now you should have at least found the error, so you can solve it or ask for further help.

Magento - routing to paypal IPN script

I have a multi language site and am having Magento (1.7.0.2) "Add Store Code to Urls" (config/system/web).
I have overridden the app/code/core/Mage/Paypal with my own app/code/local/Mage/Paypal as I have added extra backend functionality.
I can hit the IPN scripts manually (as expected) through the URL by going to:
mysite.com/uk/paypal/ipn/ in the browser (which shows as a GET request in my apache access log, with a 200 status). However when paypal posts to the same URL (which shows as a POST request in the log) it results in a 404.
I don't understand why there is a difference in GET and POST to this URL but maybe it is something to do with Magento's routing?
Anyway, what can I do so that the IPN script can be hit by paypal, and I can still use store codes in the URLs?
After logging each class method I found that Magneto was trying to load a website with $scopeCode = 'us' in run() method in /var/www/simplesteps/site/src/app/code/core/Mage/Core/Model/App.php.
This is a throw-back to the time when we have a USA website, but this website had been removed, yet a reference to it was being used.
I am not sure where this reference was being set, after looking through CMS settings I could not find it. If anyone could tell me I'd appreciate that.
I fixed the issue by reinstating the USA website, which, it turns out should not have been removed.
The reason the IPN script was being correctly hit through the browser URL (GET 200) but not paypal (POST 404) is probably to do with it being called within the scope of the active website via the URL, and not a default or legacy reference to US site.
Hope this helps someone who may find a similar frustrating situation.

Magento - returns blank / empty success page

I have a problem with the succes page from Magento. Hope somebody can help me with.
What is the problem; The whole site works completely, no errors at all. But when a customer fills in the comple onepage checkout, the customer goes to the payment service provider (PSP) to do their payment. The PSP sends the customer back to {domein}/checkout/onepage/success, which should be right. But... this page is completly empty. I already changed the memory_limit, enabled the developers log, enabled the display_errors in index.php and viewed the log files in Apache. But nothing is shown as error on the page and now errors are shown in the log files.
The orders are processed successfully, so only the displaying is wrong.
Please help with this problem or with a workaround. I need this page to track the affiliates, these need the transactionID and transactionamount.
PS: we use Magento 1.7.0.2, theme ma_housestore and the PSP Buckaroo
In this case, you should Mage log at the start and every few lines after of successAction method, which ensures it's properly called and where it got stuck.
In your case, successAction is not been properly called. Check in Mage/Checkout/controllers/OnepageController.php file you will find success action there.

Resources