Révision 9d13637e
Ajouté par Assos Assos il y a plus de 9 ans
drupal7/sites/all/modules/commerce/modules/product/commerce_product.module | ||
---|---|---|
150 | 150 |
), |
151 | 151 |
); |
152 | 152 |
|
153 |
$return['commerce_product']['bundles'] = array(); |
|
153 | 154 |
foreach (commerce_product_type_get_name() as $type => $name) { |
154 | 155 |
$return['commerce_product']['bundles'][$type] = array( |
155 | 156 |
'label' => $name, |
... | ... | |
206 | 207 |
* Implements hook_field_extra_fields(). |
207 | 208 |
*/ |
208 | 209 |
function commerce_product_field_extra_fields() { |
209 |
$extra = array(); |
|
210 |
|
|
211 |
foreach (commerce_product_types() as $type => $product_type) { |
|
212 |
$extra['commerce_product'][$type] = array( |
|
213 |
'form' => array( |
|
214 |
'sku' => array( |
|
215 |
'label' => t('Product SKU'), |
|
216 |
'description' => t('Product module SKU form element'), |
|
217 |
'weight' => -10, |
|
218 |
), |
|
219 |
'title' => array( |
|
220 |
'label' => t('Title'), |
|
221 |
'description' => t('Product module title form element'), |
|
222 |
'weight' => -5, |
|
223 |
), |
|
224 |
'status' => array( |
|
225 |
'label' => t('Status'), |
|
226 |
'description' => t('Product module status form element'), |
|
227 |
'weight' => 35, |
|
228 |
), |
|
229 |
), |
|
230 |
'display' => array( |
|
231 |
'sku' => array( |
|
232 |
'label' => t('SKU'), |
|
233 |
'description' => t('The human readable identifier of the product'), |
|
234 |
'theme' => 'commerce_product_sku', |
|
235 |
'weight' => -10, |
|
236 |
), |
|
237 |
'title' => array( |
|
238 |
'label' => t('Title'), |
|
239 |
'description' => t('Full product title'), |
|
240 |
'theme' => 'commerce_product_title', |
|
241 |
'weight' => -5, |
|
210 |
$extra = &drupal_static(__FUNCTION__); |
|
211 |
|
|
212 |
if (!isset($extra)) { |
|
213 |
foreach (commerce_product_types() as $type => $product_type) { |
|
214 |
$extra['commerce_product'][$type] = array( |
|
215 |
'form' => array( |
|
216 |
'sku' => array( |
|
217 |
'label' => t('Product SKU'), |
|
218 |
'description' => t('Product module SKU form element'), |
|
219 |
'weight' => -10, |
|
220 |
), |
|
221 |
'title' => array( |
|
222 |
'label' => t('Title'), |
|
223 |
'description' => t('Product module title form element'), |
|
224 |
'weight' => -5, |
|
225 |
), |
|
226 |
'status' => array( |
|
227 |
'label' => t('Status'), |
|
228 |
'description' => t('Product module status form element'), |
|
229 |
'weight' => 35, |
|
230 |
), |
|
242 | 231 |
), |
243 |
'status' => array( |
|
244 |
'label' => t('Status'), |
|
245 |
'description' => t('Whether the product is active or disabled'), |
|
246 |
'theme' => 'commerce_product_status', |
|
247 |
'weight' => 5, |
|
232 |
'display' => array( |
|
233 |
'sku' => array( |
|
234 |
'label' => t('SKU'), |
|
235 |
'description' => t('The human readable identifier of the product'), |
|
236 |
'theme' => 'commerce_product_sku', |
|
237 |
'weight' => -10, |
|
238 |
), |
|
239 |
'title' => array( |
|
240 |
'label' => t('Title'), |
|
241 |
'description' => t('Full product title'), |
|
242 |
'theme' => 'commerce_product_title', |
|
243 |
'weight' => -5, |
|
244 |
), |
|
245 |
'status' => array( |
|
246 |
'label' => t('Status'), |
|
247 |
'description' => t('Whether the product is active or disabled'), |
|
248 |
'theme' => 'commerce_product_status', |
|
249 |
'weight' => 5, |
|
250 |
), |
|
248 | 251 |
), |
249 |
),
|
|
250 |
);
|
|
252 |
);
|
|
253 |
}
|
|
251 | 254 |
} |
252 | 255 |
|
253 | 256 |
return $extra; |
... | ... | |
444 | 447 |
} |
445 | 448 |
|
446 | 449 |
// Otherwise turn the array values into the type name only. |
450 |
$product_type_names = array(); |
|
451 |
|
|
447 | 452 |
foreach ($product_types as $key => $value) { |
448 |
$product_types[$key] = $value['name']; |
|
453 |
$product_type_names[$key] = $value['name'];
|
|
449 | 454 |
} |
450 | 455 |
|
451 |
return $product_types; |
|
456 |
return $product_type_names;
|
|
452 | 457 |
} |
453 | 458 |
|
454 | 459 |
/** |
Formats disponibles : Unified diff
Weekly update of contrib modules