You are here

function uc_product_kit_store_status in Ubercart 6.2

Same name and namespace in other branches
  1. 5 uc_product_kit/uc_product_kit.module \uc_product_kit_store_status()

Implements hook_store_status().

File

uc_product_kit/uc_product_kit.module, line 923
The product kit module for Ubercart.

Code

function uc_product_kit_store_status() {
  if (module_exists('filefield')) {
    module_load_include('inc', 'content', 'includes/content.crud');

    // Check for filefields on products.
    if ($field = variable_get('uc_image_product_kit', '')) {
      $instances = content_field_instance_read(array(
        'field_name' => $field,
        'type_name' => 'product_kit',
      ));
    }
    else {
      $instances = array();
    }
    if (!count($instances)) {
      return array(
        array(
          'status' => 'warning',
          'title' => t('Images'),
          'desc' => t('Product kits do not have an image field. You may add a %field_name at the <a href="!add_url">Add field page</a> and make sure it is set as the Ubercart image in the <a href="!edit_url">content type settings</a> under the Ubercart product settings fieldset.', array(
            '%field_name' => $field,
            '!add_url' => url('admin/content/node-type/product-kit/fields'),
            '!edit_url' => url('admin/content/node-type/product-kit'),
          )),
        ),
      );
    }
  }
}