Unintended Consequences with Magento Observers on Sales Orders

Anyone that uses Magento to place orders will be hard-pressed to consider this process a speedy one. While it takes a while to process the order under the best of circumstances, there are a few things that you can do that actually make it worse.

One of those things that can make it worse is creating an observer that runs in the middle of the saving of the order processes that is always slow-running, or continues to get slower over time as the data that the Magento site grows. While the observer may run well at first, over time as the data grows, some random symptoms may show up, including database deadlocks and even some missing sales orders.

Always move any intensive processing tasks outside of the sales order saving process and into a separate process that does not directly interact with the saving of sales orders so that no data is lost.

comments powered by Disqus

Related Posts

Saving Products in Magento Deletes Tier Pricing

Magento’s framework makes many things simple to accomplish when working with the products and categories of your eCommerce website. However, I have found one scenario that doesn’t exactly work as expected. Tier Pricing in Magento Magento allows you to setup custom pricing levels based upon the quantity purchased. You set the minimum quantity purchased to enable the lower price when the part is added to the customer’s cart. You could see where losing the tiered pricing for an entire catalog of products would be a big deal for a site.

Read More

Launching a Redesign of a Website

Over the last few months, I have been working on a major redesign of an existing Magento website. One of the major goals of the redesign was to take a legacy desktop-only website and upgrade it to take full advantage of Responsive Web Design so that customers could equally utilize mobile and desktop devices to browse and purchase products. For a site that had seen only minor updates over the last 5 years, this redesign represented a major change visually and navigationally from the previous site.

Read More

Optimize Magento Time To First Byte

When looking at the performance of your site, waterfall charts are one of the first places you should investigate. The first thing that is represented on these charts is that the HTML for the website is the first resource that is downloaded every time. As a result of being the first resource downloaded every time, this is the logical first place to look to improve the performance of your Magento website.

Read More