Download & Extend

Provide a better example for hook_commerce_product_type_info()

Project:Drupal Commerce
Version:7.x-1.x-dev
Component:Documentation
Category:task
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

function hook_commerce_product_type_info() {
  // Return the product types defined in the database by the Product UI module.
  return db_query('SELECT * FROM {commerce_product_type}')->fetchAllAssoc('type', PDO::FETCH_ASSOC);
}

No module is going to want to do that. This should show the actual array you should return.

Comments

#1

Status:active» needs review
AttachmentSizeStatusTest resultOperations
1801964.commerce.hook_commerce_product_type_info-sample.patch790 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 3,587 pass(es).View details

#2

Title:sample code for hook_commerce_product_type_info() isn't a good example» Provide a better example for hook_commerce_product_type_info()
Category:bug report» task
Status:needs review» fixed

Yeah, that example sucked. Committed.

#3

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

nobody click here