I read the Drupal 7 tutorial on creating modules. I did fine from code and the example. Got the basics.

Then I read about creating a new content type with fields. I have ubercart and it had a product type, so I am kind of lost. Other modules have their own content types with fields.

Say I wanted to track an inventory at the most basic level. I want to know the item number and description, and on hand amount. Nothing fancy.

Do I create a table to hold that data in the drupal database? somewhere else? Do I create a field with the content type additions?

Not sure what do to. Thanks for help.



After a quick google search I found this. Might be useful -http://drupal.org/project/merci- (couldn't add more links)

I'm sure there is already a module you can download that does something similar to what you'd like to do, but if not then you should probably start like this.

Install the ctools and views module

Things that can be done without code (Drupal creates the tables in the database for you)

  • Create content type
  • Add necessary fields to it (sku, description, amount remaining)
  • Create some nodes of your content type with sample data in order to build/test your module as you go
  • Create a view to display nodes of your new content type

Now for the code

You also mentioned übercart, are you currently using it? If so you can just add fields to that content type and track those with your module and not have to deal with creating content types and views, because ubercart does all of that for you.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.