You are here

function commerce_wishlist_views_data_alter in Commerce Wishlist 7.3

Same name and namespace in other branches
  1. 8.3 commerce_wishlist.module \commerce_wishlist_views_data_alter()

Implements hook_views_data_alter().

File

includes/views/commerce_wishlist.views.inc, line 11
Wish list views.

Code

function commerce_wishlist_views_data_alter(&$data) {

  // Expose links to operate on the product.
  $data['commerce_line_item']['wishlist_remove'] = array(
    'field' => array(
      'title' => t('Remove'),
      'help' => t('Provide a simple link to remove a product from the wishlist.'),
      'real field' => 'line_item_id',
      'handler' => 'commerce_wishlist_handler_field_remove',
    ),
  );
  $data['commerce_line_item']['wishlist_add_to_cart'] = array(
    'field' => array(
      'title' => t('Add to Cart'),
      'help' => t('Provide a button to a product to the cart from the wishlist.'),
      'real field' => 'line_item_id',
      'handler' => 'commerce_wishlist_handler_field_add_to_cart_form',
    ),
  );
}