Révision 9d13637e
Ajouté par Assos Assos il y a plus de 9 ans
drupal7/sites/all/modules/commerce/modules/product/commerce_product.info.inc | ||
---|---|---|
102 | 102 |
'clear' => array('uid'), |
103 | 103 |
); |
104 | 104 |
|
105 |
$info['commerce_product']['bundles'] = array(); |
|
106 |
foreach (commerce_product_type_get_name() as $type => $name) { |
|
107 |
$info['commerce_product']['bundles'][$type] = array( |
|
108 |
'label' => $name, |
|
109 |
); |
|
110 |
} |
|
111 |
|
|
105 | 112 |
return $info; |
106 | 113 |
} |
107 | 114 |
|
... | ... | |
109 | 116 |
* Implements hook_entity_property_info_alter() on top of the Product module. |
110 | 117 |
*/ |
111 | 118 |
function commerce_product_entity_property_info_alter(&$info) { |
112 |
if (!empty($info['commerce_product']['bundles'])) { |
|
113 |
// Move the default price property to the product by default; as it is a |
|
114 |
// required default field, this makes dealing with it more convenient. |
|
115 |
$properties = array(); |
|
119 |
// Move the default price property to the product by default; as it is a |
|
120 |
// required default field, this makes dealing with it more convenient. |
|
121 |
$properties = array(); |
|
116 | 122 |
|
117 |
foreach ($info['commerce_product']['bundles'] as $bundle => $bundle_info) {
|
|
118 |
$bundle_info += array('properties' => array());
|
|
119 |
$properties += $bundle_info['properties'];
|
|
120 |
}
|
|
123 |
foreach ($info['commerce_product']['bundles'] as $bundle => $bundle_info) { |
|
124 |
$bundle_info += array('properties' => array()); |
|
125 |
$properties += $bundle_info['properties']; |
|
126 |
} |
|
121 | 127 |
|
122 |
if (!empty($properties['commerce_price'])) { |
|
123 |
$info['commerce_product']['properties']['commerce_price'] = $properties['commerce_price']; |
|
124 |
} |
|
128 |
if (!empty($properties['commerce_price'])) { |
|
129 |
$info['commerce_product']['properties']['commerce_price'] = $properties['commerce_price']; |
|
125 | 130 |
} |
126 | 131 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules