uc_product.info.inc 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. /**
  3. * @file
  4. * Entity metadata hooks for uc_product.module.
  5. */
  6. /**
  7. * Implements hook_entity_property_info_alter().
  8. */
  9. function uc_product_entity_property_info_alter(&$info) {
  10. foreach (uc_product_types() as $type) {
  11. $properties = &$info['node']['bundles'][$type]['properties'];
  12. $properties['model'] = array(
  13. 'label' => t('SKU'),
  14. 'description' => t('The SKU or model number of the product.'),
  15. 'type' => 'text',
  16. 'setter callback' => 'entity_property_verbatim_set',
  17. );
  18. $properties['list_price'] = array(
  19. 'label' => t('List price'),
  20. 'description' => t('The suggested retail price of the product.'),
  21. 'type' => 'decimal',
  22. 'setter callback' => 'entity_property_verbatim_set',
  23. );
  24. $properties['cost'] = array(
  25. 'label' => t('Cost'),
  26. 'description' => t('The amount the store pays to sell the product.'),
  27. 'type' => 'decimal',
  28. 'setter callback' => 'entity_property_verbatim_set',
  29. );
  30. $properties['sell_price'] = array(
  31. 'label' => t('Sell price'),
  32. 'description' => t('The base amount the customer pays for the product.'),
  33. 'type' => 'decimal',
  34. 'setter callback' => 'entity_property_verbatim_set',
  35. );
  36. $properties['price'] = array(
  37. 'label' => t('Price'),
  38. 'description' => t('The amount the customer pays for this specific product.'),
  39. 'type' => 'decimal',
  40. 'setter callback' => 'entity_property_verbatim_set',
  41. );
  42. $properties['weight'] = array(
  43. 'label' => t('Weight'),
  44. 'description' => t('The physical weight of the product.'),
  45. 'type' => 'decimal',
  46. 'setter callback' => 'entity_property_verbatim_set',
  47. );
  48. $properties['weight_units'] = array(
  49. 'label' => t('Weight units'),
  50. 'description' => t('The unit of measure for the weight field.'),
  51. 'type' => 'token',
  52. 'setter callback' => 'entity_property_verbatim_set',
  53. );
  54. $properties['length'] = array(
  55. 'label' => t('Length'),
  56. 'description' => t('The physical length of the product or its packaging.'),
  57. 'type' => 'decimal',
  58. 'setter callback' => 'entity_property_verbatim_set',
  59. );
  60. $properties['width'] = array(
  61. 'label' => t('Width'),
  62. 'description' => t('The physical width of the product or its packaging.'),
  63. 'type' => 'decimal',
  64. 'setter callback' => 'entity_property_verbatim_set',
  65. );
  66. $properties['height'] = array(
  67. 'label' => t('Height'),
  68. 'description' => t('The physical height of the product or its packaging.'),
  69. 'type' => 'decimal',
  70. 'setter callback' => 'entity_property_verbatim_set',
  71. );
  72. $properties['length_units'] = array(
  73. 'label' => t('Weight units'),
  74. 'description' => t('The unit of measure for the length, width and height.'),
  75. 'type' => 'token',
  76. 'setter callback' => 'entity_property_verbatim_set',
  77. );
  78. $properties['pkg_qty'] = array(
  79. 'label' => t('Package quantity'),
  80. 'description' => t('The number of products that fit in one package.'),
  81. 'type' => 'integer',
  82. 'setter callback' => 'entity_property_verbatim_set',
  83. );
  84. $properties['ordering'] = array(
  85. 'label' => t('Ordering'),
  86. 'description' => t('The position of the product in product listings.'),
  87. 'type' => 'integer',
  88. 'setter callback' => 'entity_property_verbatim_set',
  89. );
  90. $properties['shippable'] = array(
  91. 'label' => t('Shippable'),
  92. 'description' => t('Whether the product can be shipped or not.'),
  93. 'type' => 'boolean',
  94. 'setter callback' => 'entity_property_verbatim_set',
  95. );
  96. }
  97. }