Magento Duplicate Orders - magento

I have a Magento site using version 1.6.2.0 with which I'm experiencing problems with duplicate orders.
Having researched the subject I have found mostly forum threads explaining that 1.4.x had problems with duplicate orders and the solutions mentioned (even those on SO which I have found) merely suggest the user updates Magento to >1.4.
I have also found a proposed solution here but am reluctant to delete observers which will prevent downloadable purchases working.
I've also spotted the Array Of Death fix mentioned a few times (e.g. here) but this problem isn't present in 1.6.x, Zend appears to have resolved it.
There are a couple of Javascript hacks suggested whereby the Confirm Order button is hidden upon submission but Magento 1.6.x already does this.
I have increased the payment gateway timeout configuration variable to 120 seconds and am as yet to see if it yields results. I can't test it as the problem is intermittent (and probably therefore caused by communication or lack thereof between the payment gateway and Magento).
I am using Sagepay as the payment gateway.
How might I further debug this?

The link you posted is correct, but I wouldn't use their fix, I would just disable the Mage_Rss module.
Mage_Rss has several observers in it that call Mage::app()->cleanCache(...) in the checkout process, which is extremely expensive if your installation is using the default filesystem cache and it's gotten large.
I found the best thing for troubleshooting Magento performance problems is to wire up Xhgui and do some profiling. Reading call stacks will help your understanding of Magento immensely also.
Oh, and I don't know if this is true for Sagepay, but I went and fixed this problem completely for PayflowPro by rewriting the method that generates transaction IDs to use the quoteID instead of generating unique IDs on every invocation. I started down the path of committing this back, but I'm on 1.4.2 still and don't have time to test in later versions and it's a pretty significant rewrite. Guess I could just put it out there for someone else to run pass Moses...

Related

Proceed to Checkout is missing with overridden Block and template file

Extended OOB Onepage Link Block and link.phtml to disable the button based on customer group id, the changes are working but the button is disabled for all the customers, not just for the customers that are in specified group. I cleared cache many times but still no luck. I have correct entries in checkout_cart_index.xml and I do see it working but not the way it's supposed to do. Is there anything else that needs to be done to fix this issue since it prevent checkout for all the customers?
Found out hard way that it was a simple typo in the Block class name, I was using wrong Session class, where required method wasn't available. Took sometime to find this out and but it's working now. Please make sure that vendor/module, and/or other names are correct with case, otherwise it's hard to debug since we don't get meaningful errors unlike Java. I couldn't enable developer mode due to other issues which also complicated the problem.

Joomla fetching feed issue after an upgrade

I have a feed problem and I hope that you can help me. A few days ago I upgraded Joomla from 2.5.28 to 3.4.4. The process was successful, and I thought everything was OK, but then noticed that my K2 feed isn't being fetched by a partner website. I have six partners whom using my RSS ( http://my.site/index.php?option=com_k2&view=itemlist&layout=category&Itemid=200&format=feed ), and five from six is still working, but one of them doesn't fetch. This is strange, because all partners are using the same feed link. I tried things, I removed old, unnecessary components, disabled unnecessary plugins, but nothing changed. This upgrade caused this, no doubt, but I don't know how. Maybe the problem is that the feed fetching stopped at my partners site, and can't start again, so I want something which can do this. Is there a method to force a feed refresh at my partner site, or do you have an other idea?
List of things that I tried:
- disabled unnecessary component
- disabled unnecessary plugins
- updated all components, modules and plugins
- removedd system cache and expired cache in administrator section
I hope you have ideas. Thanks in advance!
Since the feed is working for 5 other partners, then most likely the problem has to do with the 6th partner and not with the website (unless the sixth partner is using a different link).
It might also be that the way the partner is retrieving the feed is different than the others. I suggest you have a phone call with the partner to try to identify the problem on their end. The first question that you probably should ask the partner is if they can access the feed from their browser. The second question is to ask them which feed they are using in the code.
One more thing, if you have changed the IP of your website during the process then it might be that the partner is accessing the website using the old IP.
And, of course, it might be that the partner's server IP is blocked somewhere on your server (either by the application or by the server), so check that as well.

Magento custom fields on checkout

Is there any tutorial available for how do i add custom fields on front end check out step like PO number,Job name , customer comments etc as well as in admin->create->order.
My usual motto is to find (and buy if needed) a module that already has the functionality you seek. Especially when the life of this project involves version upgrades because then you can seek a pre-packaged solution from the provider.
I regret every bit of custom code I have added to our Magento install. Because now I've got to maintain the site to just keep working in addition to figuring out my hacks. Time to devote more time to replacing hacks with off-the-shelf extensions, which would have been much faster in the first place.
I know this attitude goes somewhat against the stack overflow thinking of I can do anything, but really, Magento's job is to enable someone to do less work.
Two years later, an update: after the gentle poke of a downvote (probably for appearing to shrug off the question), I am back to revisit and share some of what I've learned. The programming aspect of additional fields is the concept of persistence of the data.
If you're ok with the custom fields only appearing in the transactional emails following the order, then the task is as "simple" as adding the fields to the form somewhere and then updating the controller to to catch and insert the post data into the email. You can use a custom variable in the back end to readily expose this to the email templates. And a Magento SE on programatically creating a custom variable.
Getting persistence into the back end requires adding database fields via an installer in your module. The iCoreThink blog lays out the steps clearly and explains why, how to confirm your work, and then provides real-world implementation, like displaying to the customer in their account. The "other blog" mentioned below has a great example of this, though his example is specifically related to billing and shipping.
Resources from my upvotes and bookmarks:
» This iCoreThink blog post is my favorite reference so far and what I'm following now.
» I was using Templates Master's FireCheckout which includes their own checkoutfields module, but I've abandoned their single view checkout for the flow of Magento's one page checkout. I'm now trying to adapt their checkout fields (and use their controller) into my template for checkout.
» I thought for sure Alan Storm wrote an article about Checkout custom fields, but I don't see one.
» This Magento SE lists a couple blogs and a paid extension. The excellence blog is ok, but his style is too rote for me and I don't learn anything. The other blog discusses the procedure for building your module and installing the database fields.
» The unexpected-IT blog demonstrates and informal hack to add the code to core files (but sadly doesn't show how to override those files by copying them to app/code/local) and the steps to manually perform to get the column and fields added in the database. Apparently is perfect for 1.4 and below, but comments seem to explain what to do for 1.5 and up.
This last hack-ish change is my personal favorite as it seamlessly adds the extra bits into existing Magento admin pages and "feels like" less work. Caveats: I wouldn't do this without using version control and it will absolutely break if any core code changes happen between version upgrades.

cakephp website confusing load times

I have a website that uses CakePHP 1.3.10. This CakePHP app it's pretty big, not in the amount of models or controllers (like 5 of each), but in the amount of plugins. I use the plugins as places of the website where users can access (or can't access) depending on if they have logged in already or not (well there's more reasons, but it's not important now, it's how it works). I also use a global Auth component in the app_controller.php
My issue is the following: I've noticed that the website is getting really slow when trying to access any of the pages of a plugin (when accessing the "home" page - which is not in a plugin - all is good).
The thing is that I was going to run some performance tests to figure out what's going on. I decided to create another website, exactly like the one I described, with the only difference that I removed all the plugins with the exception of one.
Amazingly (for me), when I access one of the pages of this plugin that I didn't delete, it goes super fast, like it should normally go.
So my question is: does the number of plugins really have a direct impact on the loading times of a page inside those plugins? Is there any way to "fix" this? Or is it just a coincidence and something else is going on that I missed?
Thanks so much in advance for any advise!
Reducing the amount of files and folders of my application has increased significantly the load times. I don't know what is the relation between amount of files/folders and loading speed in CakePHP, but it's a fact, at least in my website.
I've changed my cake installation to an advanced installation (as it explains in the cakephp boo) to have my files more spread out in different sub-apps, instead of having one huge app, and this has helped a lot!

Google Analytics ecommerce only tracking Paypal

I'm having an issue with Google Analytics ecommerce tracking. I've found numerous posts about this, but none of the fixes seem to apply. We're on Magento 1.5.0.1, so all the GA code should be built in. We also installed the Fooman GA+ module, but that didn't help this issue. The tracking code IS showing up on the success page when viewing the page source, but it doesn't look right...no items listed. If I view the list of transactions in GA, it seems that they are all the Paypal transactions but credit card or money order transactions aren't coming through. We use Website Payments Pro for our Credit Card transactions, so ultimately it's all going through Paypal anyhow.
I did some digging around in the code and it seems that the "_getOrdersTrackingCode" function in Ga.php is where the problem lies. I added some logging...
$orderIds = $this->getOrderIds();
Mage::Log($orderIds);
...and found that the majority of the time, $orderIds is empty. Sometimes it isn't and that is when the tracking code works.
What's going on here? Anyone know?
I have fixed the problem. We use a 3rd party extension for checkout and it needed to be updated for 1.5.0.1 compatibility. The dispatcher of the *checkout_onepage_controller_success_action* event needs to send an array of the order ids as well. This wasn't necessary in 1.4.2.0. I updated the extension and it's working great now! I hope this helps anyone else with a similar issue.
Please note that this is an ORDER COMPLETE / SUCCESS event. You can't see the rendered code until you've completed a (test) transaction. On the order confirmation page, hit view source. In your <script /> tag's you'll see some new push code if all goes well.
Yes, Brian, your code definitely lead us in the right direction. We ended up turning the PayPal checkout to test mode = yes, debug mode = yes. We're on 1.4.2. and this worked fine. Respond to this if you need help. If I'm alive, I will try to get back to you.

Resources