metatag_opengraph_products.metatag.inc 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <?php
  2. /**
  3. * @file
  4. * Metatag integration for the metatag_opengraph_product module.
  5. */
  6. /**
  7. * Implements hook_metatag_info().
  8. */
  9. function metatag_opengraph_products_metatag_info() {
  10. // Open Graph products.
  11. $info['groups']['open-graph-products'] = array(
  12. 'label' => t('Open Graph - Products'),
  13. 'description' => t("These Open Graph meta tags for describing products."),
  14. 'form' => array(
  15. '#weight' => 51,
  16. ),
  17. );
  18. // Default values for each meta tag.
  19. $defaults = array(
  20. 'description' => '',
  21. 'class' => 'DrupalTextMetaTag',
  22. 'group' => 'open-graph-products',
  23. 'element' => array(
  24. '#theme' => 'metatag_property',
  25. ),
  26. );
  27. $weight = 50;
  28. $info['tags']['product:price:amount'] = array(
  29. 'label' => t('Price'),
  30. 'description' => t("The numeric price with decimal point, without currency indicator. Values below 0.01 may not be supported by clients."),
  31. 'weight' => ++$weight,
  32. ) + $defaults;
  33. $info['tags']['product:price:currency'] = array(
  34. 'label' => t('Currency'),
  35. 'description' => t("The currency for the price (if any)."),
  36. 'weight' => ++$weight,
  37. ) + $defaults;
  38. $info['tags']['product:availability'] = array(
  39. 'label' => t('Availability'),
  40. 'description' => t('Case-insensitive string, possible values: "instock", "pending", "oos"; per <a href="@url">Facebook\' documentation</a>.', array('@url' => 'https://developers.facebook.com/docs/reference/opengraph/object-type/product')),
  41. 'weight' => ++$weight,
  42. ) + $defaults;
  43. $info['tags']['product:brand'] = array(
  44. 'label' => t('Brand'),
  45. 'description' => '',
  46. 'weight' => ++$weight,
  47. ) + $defaults;
  48. $info['tags']['product:upc'] = array(
  49. 'label' => t('UPC'),
  50. 'description' => '',
  51. 'weight' => ++$weight,
  52. ) + $defaults;
  53. $info['tags']['product:ean'] = array(
  54. 'label' => t('EAN'),
  55. 'description' => '',
  56. 'weight' => ++$weight,
  57. ) + $defaults;
  58. $info['tags']['product:isbn'] = array(
  59. 'label' => t('ISBN'),
  60. 'description' => '',
  61. 'weight' => ++$weight,
  62. ) + $defaults;
  63. $info['tags']['product:plural_title'] = array(
  64. 'label' => t('Plural Title'),
  65. 'description' => 'A title to be used to describe multiple items of this product',
  66. 'weight' => ++$weight,
  67. ) + $defaults;
  68. $info['tags']['product:retailer'] = array(
  69. 'label' => t('Retailer ID'),
  70. 'description' => 'A Facebook ID (or reference to the profile) of the retailer.',
  71. 'weight' => ++$weight,
  72. ) + $defaults;
  73. $info['tags']['product:retailer_title'] = array(
  74. 'label' => t('Retailer Name'),
  75. 'description' => 'The name of the retailer.',
  76. 'weight' => ++$weight,
  77. ) + $defaults;
  78. $info['tags']['product:retailer_part_no'] = array(
  79. 'label' => t('Retailer SKU/Product Number'),
  80. 'description' => 'A retailer part number.',
  81. 'weight' => ++$weight,
  82. ) + $defaults;
  83. $info['tags']['product:mfr_part_no'] = array(
  84. 'label' => t('Manufacturer SKU/Part Number'),
  85. 'description' => 'A manufacturer part number.',
  86. 'weight' => ++$weight,
  87. ) + $defaults;
  88. $info['tags']['product:size'] = array(
  89. 'label' => t('Size'),
  90. 'description' => 'A size describing the product, such as S, M, L.',
  91. 'weight' => ++$weight,
  92. ) + $defaults;
  93. $info['tags']['product:product_link'] = array(
  94. 'label' => t('Product Link'),
  95. 'description' => 'A link to find out more about the product',
  96. 'weight' => ++$weight,
  97. ) + $defaults;
  98. $info['tags']['product:category'] = array(
  99. 'label' => t('Category'),
  100. // 'description' => 'A category',
  101. 'weight' => ++$weight,
  102. ) + $defaults;
  103. $info['tags']['product:color'] = array(
  104. 'label' => t('Color'),
  105. // 'description' => 'The product\'s color.',
  106. 'weight' => ++$weight,
  107. ) + $defaults;
  108. $info['tags']['product:material'] = array(
  109. 'label' => t('Material'),
  110. 'description' => 'A description of the material used to make the product.',
  111. 'weight' => ++$weight,
  112. ) + $defaults;
  113. $info['tags']['product:pattern'] = array(
  114. 'label' => t('Pattern'),
  115. 'description' => 'A description of the pattern used.',
  116. 'weight' => ++$weight,
  117. ) + $defaults;
  118. $info['tags']['product:shipping_cost:amount'] = array(
  119. 'label' => t('Shipping Cost Amount'),
  120. 'description' => 'The shipping costs.',
  121. 'weight' => ++$weight,
  122. ) + $defaults;
  123. $info['tags']['product:shipping_cost:currency'] = array(
  124. 'label' => t('Shipping Cost Currency'),
  125. 'description' => 'The shipping cost currency.',
  126. 'weight' => ++$weight,
  127. ) + $defaults;
  128. $info['tags']['product:weight:value'] = array(
  129. 'label' => t('Product Weight'),
  130. 'description' => 'The weight, without shipping materials.',
  131. 'weight' => ++$weight,
  132. ) + $defaults;
  133. $info['tags']['product:weight:units'] = array(
  134. 'label' => t('Product Weight Units'),
  135. 'description' => 'The unit of weight.',
  136. 'weight' => ++$weight,
  137. ) + $defaults;
  138. $info['tags']['product:shipping_weight:value'] = array(
  139. 'label' => t('Shipping Weight'),
  140. 'description' => 'The shipping weight.',
  141. 'weight' => ++$weight,
  142. ) + $defaults;
  143. $info['tags']['product:shipping_weight:units'] = array(
  144. 'label' => t('Shipping Weight Units'),
  145. 'description' => 'The unit of shipping weight.',
  146. 'weight' => ++$weight,
  147. ) + $defaults;
  148. $info['tags']['product:expiration_time'] = array(
  149. 'label' => t('Expiration'),
  150. 'description' => 'A time representing when the product expired, or will expire.',
  151. 'weight' => ++$weight,
  152. ) + $defaults;
  153. $info['tags']['product:condition'] = array(
  154. 'label' => t('Condition'),
  155. 'description' => 'The condition of the product.',
  156. 'weight' => ++$weight,
  157. ) + $defaults;
  158. return $info;
  159. }