You are here

product_price_alterer_field.views.inc in Ubercart Discounts (Alternative) 7.2

Same filename and directory in other branches
  1. 6.2 product_price_alterer_field/product_price_alterer_field.views.inc

Integrates product_price_alterer module with views module.

File

product_price_alterer_field/product_price_alterer_field.views.inc
View source
<?php

/**
 * @file
 * Integrates product_price_alterer module with views module.
 */

/**
 * Implementation of hook_views_handlers()
 * Register all of the basic handlers views uses.
 */
function product_price_alterer_field_views_handlers() {
  return array(
    'info' => array(
      'path' => drupal_get_path('module', 'product_price_alterer_field') . '/includes',
    ),
    'handlers' => array(
      'discounted_price_handler' => array(
        'parent' => 'views_handler_field',
      ),
    ),
  );
}

/**
 * Implementation of hook_views_data()
 * Register all of the basic handlers views uses.
 */
function product_price_alterer_field_views_data() {
  $data['uc_products']['discounted_price'] = array(
    'title' => t('Discounted price'),
    'help' => t('Price after discounts (if any exist).'),
    'field' => array(
      'handler' => 'discounted_price_handler',
      'click sortable' => FALSE,
      'table' => 'node',
      'additional fields' => array(
        'nid' => array(
          'table' => 'node',
          'field' => 'nid',
        ),
      ),
    ),
  );
  return $data;
}

Functions

Namesort descending Description
product_price_alterer_field_views_data Implementation of hook_views_data() Register all of the basic handlers views uses.
product_price_alterer_field_views_handlers Implementation of hook_views_handlers() Register all of the basic handlers views uses.