You are here

function dc_ajax_add_cart_views_views_data_alter in Commerce Ajax Add to Cart 8

Implements hook_views_data_alter().

File

modules/dc_ajax_add_cart_views/dc_ajax_add_cart_views.module, line 11
Ajaxifies some cart operations those are related to Views.

Code

function dc_ajax_add_cart_views_views_data_alter(array &$data) {
  $data['commerce_order_item']['dc_ajax_add_cart_views_remove_button']['field'] = [
    'title' => t('Remove button (Ajax)'),
    'help' => t('Adds a button for removing (ajax) the order item.'),
    'id' => 'dc_ajax_add_cart_views_item_remove_button',
  ];
  $data['commerce_order_item']['dc_ajax_add_cart_views_edit_quantity']['field'] = [
    'title' => t('Quantity text field (Ajax)'),
    'help' => t('Adds a text field for editing the quantity.'),
    'id' => 'dc_ajax_add_cart_views_item_edit_quantity',
  ];
}