You are here

function uc_attribute_help in Ubercart 8.4

Same name and namespace in other branches
  1. 5 uc_attribute/uc_attribute.module \uc_attribute_help()
  2. 6.2 uc_attribute/uc_attribute.module \uc_attribute_help()
  3. 7.3 uc_attribute/uc_attribute.module \uc_attribute_help()

Implements hook_help().

File

uc_attribute/uc_attribute.module, line 35
Ubercart Attribute module.

Code

function uc_attribute_help($route_name, RouteMatchInterface $route_match) {
  switch ($route_name) {

    // Help messages for the attributes overview on products and classes.
    case 'uc_attribute.product_attributes':
      return '<p>' . t('Add attributes to this product using the <a href=":url">add attributes form</a>. You may then adjust the settings for these attributes on this page and go on to configure their options in the <em>Options</em> tab.', [
        ':url' => Url::fromRoute('uc_attribute.product_attributes_add', [
          'node' => $route_match
            ->getRawParameter('node'),
        ])
          ->toString(),
      ]) . '</p>';
    case 'uc_attribute.product_class_attributes':
      return '<p>' . t('Add attributes to the product class using the <a href=":url">add attributes form</a>. You may then adjust the settings for these attributes on this page and go on to configure their options in the <em>Options</em> tab.', [
        ':url' => Url::fromRoute('uc_attribute.product_class_attributes_add', [
          'node_type' => $route_match
            ->getRawParameter('node_type'),
        ])
          ->toString(),
      ]) . '</p>';

    // Help message for adding an attribute to a product or class.
    case 'uc_attribute.product_attributes_add':
    case 'uc_attribute.product_class_attributes_add':
      return '<p>' . t('Select the attributes you want to add and submit the form.') . '</p>';

    // Help message for adjusting the options on a product or class.
    case 'uc_attribute.product_options':
    case 'uc_attribute.product_class_options':
      return '<p>' . t('Use the checkboxes to enable options for attributes and the radio buttons to specify the default option. Attributes with no enabled options will be displayed as text fields. Drag and drop the options to reorder them.') . '</p><p>' . t('The cost, price and weight fields will make adjustments against the original product, so you may enter positive or negative amounts here, or enter 0 if the option should make no adjustment.') . '</p>';

    // Help message for the product Adjustments tab.
    case 'uc_attribute.product_adjustments':
      return '<p>' . t('Enter an alternate SKU to be used when the specified set of options are chosen and the product is added to the cart.') . '</p><p>' . t('<b>Warning:</b> Adding or removing attributes from this product will reset all the SKUs on this page to the default product SKU.') . '</p>';
  }
}