You are here

function uc_ajax_cart_init in Ubercart AJAX Cart 6.2

Same name and namespace in other branches
  1. 7.2 uc_ajax_cart.module \uc_ajax_cart_init()

Implements hook_init().

File

./uc_ajax_cart.module, line 275

Code

function uc_ajax_cart_init() {
  $item = menu_get_item();
  if ($item['page_callback'] == 'block_admin_display') {

    // Do not initialize on block admin page; see https://drupal.org/node/219910
    return;
  }

  // Add standard JS if we are to always enable ajax functionality
  // Otherwise, _uc_ajax_cart_init() gets called from hook_block().
  if (!variable_get('uc_ajax_cart_enably_only_when_visible', FALSE)) {
    _uc_ajax_cart_init();
  }
}