Book Image

Building Online Stores with osCommerce: Beginner Edition

By : David Mercer
Book Image

Building Online Stores with osCommerce: Beginner Edition

By: David Mercer

Overview of this book

Using an easy-to-read and engaging style, this book introduces the fundamentals of osCommerce, and helps you build your first online store. It covers the out-of-the-box features of osCommerce, but it also shows you how to customize the application to your own needs. The book starts with the basics of downloading and installing osCommerce, or simply how to enable it on your Internet domain using the tools provided by your host. All of the most important configuration issues are explained, with clear instructions and advice to help you make the right choices. Once osCommerce is installed and configured, you will take a good look at how to work with your store's data including product information as well as other data which is responsible for keeping your site healthy. The all important topic of customization is also dealt with comprehensively. You will see how to develop attractive sites that will make your store a pleasure to browse and your products a pleasure to buy! Of course, no discussion on osCommerce would be complete without a look at how to obtain and treat payments. Using the modules provided with osCommerce you will be collecting money from your happy customers in no time! Once the reader has a fully fledged, and operational site it is time to look at deployment? an important topic for discussion if development has taken place on a development machine. The appendix will add a few tools to your armory and shed some light as to what is going on behind the scenes in case things go awry.
Table of Contents (13 chapters)

Appendix A. Troubleshooting

At some point in your career, you might experience problems with your code; no matter how diligently you try to work, errors do creep in. So common are errors (most often called bugs), in fact, that any big corporation nowadays has to implement comprehensive testing and debugging plans for months on end before it can consider new software to be fairly stable. Even then, as you have probably experienced, there are problems that slip under the radar and require patches or updates.

Since bugs are a part of life, it is better to learn how to deal with them properly than to hope to avoid them completely. This appendix will provide a few neat methods, as well as reiterate the best process for dealing with bugs. Remember, though, that if worst comes to absolute worst, and your site is beyond repair for one reason or another, then simply erase and fall back to your latest backup.

Types of Errors

Ensuring that your application is ‘bug’ or error free is a critical part of developing and building any software—and e-commerce websites are no different. There are different ways and means of isolating faults and correcting them, but before we look at those it is important to quickly acknowledge the different types of error that can make their unwelcome presence felt. Different types of errors also show in different ways and some are quite subtle and not easy to spot:

  • Syntax error: These will prevent PHP from actually running your code, but on the plus side should be relatively easy to locate because of this. Of course, once your site is being used by the general public, you don’t really want the internal errors in your system being reported to the screen, because this can often allow malicious users to glean information about your system.

  • Run-time error: These are slightly worse than syntax errors because they are not quite as obvious, or easy to pin down. There are different ways in which a run-time error can occur, and many of these can only be caught by thorough testing on your site. For example, if you change file paths without the corresponding configuration changes, you end up with broken links, lost files, or disrupted database connections. While these errors won’t show up when the PHP script is parsed, they will show up when it is executed.

  • Logic error: These are quite sneaky in that they won’t really show up at all. It is incumbent on you to decide whether your site is performing as it should. For example, accidentally typing a plus (+) sign instead of a minus (-) won’t show up as either a run‑time error or a syntax error, but will obviously affect the result of a calculation, which could have disastrous effects if it is part of your invoice calculator.

It is important that you are able to decide for yourself what type of error has occurred. Often, it takes a bit of experience to realize what an error message usually means because PHP can’t always isolate the exact place an error has occurred. If you have already found yourself suffering from seemingly cryptic error messages, then read on to the Debugging Code Yourself section for help on a variety of issues.