Home | Store | osCommerce Tutorials

osCommerce Database Catalog - Add a New Category

Catalog - Add a New Category

Let's take the default osCommerce website as an example. We will examine the tables of MySQL Database after a new Parent Category was created.

Click on the picture above to see the details.

By default there are three Parent Categories (Hardware, Software and DVD Movies) when a new osCommerce shop is installed. To create a new category, click on the new category button.

Add a New Category

Now, let's add a new Category and see how the database changes.

Enter the information of the new category (Puzzle) as shown in the diagram below.
Note: In a real shop you should enter the Category Name in all available languages.

Add a New Category

New Parent Category Created

A new Parent Category has been created. Please click on the diagram below to see the details.

New Parent Category Created

Check MySQL categories_description Table

It's time to examine the tables of MySQL Database to see where the data of the new category are inserted.

Check MySQL Database categories_description Table

Click on the above image to see the categories_description table for details.

categories_description table

Summary:
  • The Category Name was inserted into the categories_name field.
  • Since there are 20 categories in default shop, the categories_id of the new category is 21
  • Since there are three languages in default shop, three records were inserted (language_id 1 is English, 2 for Deutsch and 3 for Espanol). Because we did not enter the names for Deutsch and Espanol, therefore the two fields are empty.

Check MySQL Database categories table

Let's examine the MySQL Database categories table.

Check MySQL Database categories Table

Click on the above image to see the categories table for details.

Summary:
  • The filename and path of categories images was saved in categories_image field.
  • The parent_id is zero since this is a Parent Category
  • The sort_order is 4 so that it will be listed after the default three categories.

oscommerce mySQL database tutorial, oscommerce database structure