You are here

function commerce_line_item_summary_links in Commerce Core 7

Returns a sorted array of line item summary links.

See also

hook_commerce_line_item_summary_link_info()

7 calls to commerce_line_item_summary_links()
CommerceBaseTestCase::getCommerceUrl in tests/commerce_base.test
Return one of the Commerce configured urls.
CommerceTaxUIAdminTest::commerceTaxHelperCompleteCheckout in modules/tax/tests/commerce_tax_ui.test
Go through the checkout process.
CommerceTaxUIAdminTest::testCommerceTaxUIApplySalesTax in modules/tax/tests/commerce_tax_ui.test
Check if a 'Salex tax' rate is correctly applied in a given order.
CommerceTaxUIAdminTest::testCommerceTaxUITaxNoMatchingCondition in modules/tax/tests/commerce_tax_ui.test
A tax rate with no matching condition doesn't get applied.
commerce_line_item_handler_area_line_item_summary::options_form in modules/line_item/includes/views/handlers/commerce_line_item_handler_area_line_item_summary.inc
Default options form that provides the label widget that all fields should have.

... See full list

File

modules/line_item/commerce_line_item.module, line 1575
Defines the core Commerce line item entity and API functions interact with line items on orders.

Code

function commerce_line_item_summary_links() {
  $links =& drupal_static(__FUNCTION__, array());
  if (empty($links)) {

    // Retrieve links defined by the hook and allow other modules to alter them.
    $links = module_invoke_all('commerce_line_item_summary_link_info');

    // Merge in default values for our custom properties.
    foreach ($links as $key => &$link) {
      $link += array(
        'weight' => 0,
        'access' => TRUE,
      );
    }
    drupal_alter('commerce_line_item_summary_link_info', $links);

    // Sort the links by weight and return the array.
    uasort($links, 'drupal_sort_weight');
  }
  return $links;
}