Révision b858700c
Ajouté par Assos Assos il y a environ 10 ans
drupal7/sites/all/modules/commerce/modules/product_reference/commerce_product_reference.module | ||
---|---|---|
1400 | 1400 |
return $types; |
1401 | 1401 |
} |
1402 | 1402 |
|
1403 |
/** |
|
1404 |
* Implements hook_commerce_checkout_order_can_checkout(). |
|
1405 |
*/ |
|
1406 |
function commerce_product_reference_commerce_checkout_order_can_checkout($order) { |
|
1407 |
// Allow orders with one or more product line items to proceed to checkout. |
|
1408 |
// If there are no line items on the order, redirect away. |
|
1409 |
$wrapper = entity_metadata_wrapper('commerce_order', $order); |
|
1410 |
|
|
1411 |
if (commerce_line_items_quantity($wrapper->commerce_line_items, commerce_product_line_item_types()) > 0) { |
|
1412 |
return TRUE; |
|
1413 |
} |
|
1414 |
} |
|
1415 |
|
|
1403 | 1416 |
/** |
1404 | 1417 |
* Implements hook_commerce_product_can_delete(). |
1405 | 1418 |
*/ |
... | ... | |
1437 | 1450 |
function commerce_product_reference_node_types() { |
1438 | 1451 |
$list = array(); |
1439 | 1452 |
$types = node_type_get_types(); |
1440 |
foreach (field_info_fields() as $field_name => $field) {
|
|
1441 |
if ($field['type'] == 'commerce_product_reference' && !empty($field['bundles']['node'])) {
|
|
1442 |
foreach($field['bundles']['node'] as $bundle) { |
|
1453 |
foreach (field_info_field_map() as $field_name => $field_stub) {
|
|
1454 |
if ($field_stub['type'] == 'commerce_product_reference' && !empty($field_stub['bundles']['node'])) {
|
|
1455 |
foreach($field_stub['bundles']['node'] as $bundle) {
|
|
1443 | 1456 |
$list[$bundle] = $types[$bundle]; |
1444 | 1457 |
} |
1445 | 1458 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules