Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

general do's and don'ts


panacea_supplies

Recommended Posts

Posted

I think I learned a lesson with "developing" (or modifying) osCommerce recently.

 

One thing I want to do is be able to set sort order. So I have a product which has small, medium, large and extra large, I have the option at the bottom selected for medium, with small above it and large below it.

 

I just started working on this. Anyhow, one thing I did was add columns to an existing database table. Oops! That broke stuff all over, some stuff I didn't even know about or suspect would break. Generally it broke inserts, updates and that type of thing. I have dropped those tables. I will do this thing by way of another table. I have seen osCommerce sort order contributions but none of them were what I wanted so I'm making my own.

 

If you want something done, the best thing it seems to me is to add new database tables. I added a table to tell me when anyone hits from Froogle, and it works fine. I guess this was common sense to begin with, but I have always been more of a sysadmin then a developer or DBA to begin with anyway. Or developer really, my column addition made sense from a DBA perspective, not so much a developer perspective.

 

Are there any other general do's or don'ts aside from advice to add new tables instead of adding columns to existing tables?

Posted

The adding of new tables depends entirely on what is being referenced with the data. The use of a new table does not always make sence to do as this may not be the best way to deal with it.

 

When dealing with data and the DB, my suggestion is to put it where it best fits, and if a new table is the best fit, then this is fine. For example, the multi image contribution, the best fit would be in the products table, but I think that a new table should be added to the system to manage the images, rather then adding 8 - 10 new fields to the existing table, this idea is based on the NF3 rule for DB management and refinements.

 

I am not a DBA either, but have studied this and worked with it for a long time, and most of this is something gained by experience, there are others here on the boards who do more DBA type of work, and they will be able to give additional advice on the subject, if they find the thread... :)

 

cheers,

Peter M

Peter McGrath

-----------------------------

See my Profile (click here) for more information and to contact me for professional osCommerce support that includes SEO development, custom development and security implementation

Posted
Attribute Sort Order is a much easier way to do it. It will sort Small, Medium Large. I use Must Select to make sure someone picks an attribute. It should work for you and is much easier than messing with the DB.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...