Commit c1410762 authored by rfay's avatar rfay

Issue #1325746 and Issue #1343050 by rfay: Move hook_enable() to .install and...

Issue #1325746 and Issue #1343050 by rfay: Move hook_enable() to .install and replace bad API calls there.
parent cd81537c
<?php
/**
* @file line_item_example.install
*/
/**
* Implements hook_enable().
*
* Here we count on Commerce Line Items module to configure our type based on
* the information we provide in
* line_item_example_commerce_line_item_type_info().
*/
function line_item_example_enable() {
// This function configures all existing line item types, including ours.
commerce_line_item_configure_line_item_types();
}
\ No newline at end of file
......@@ -29,22 +29,11 @@ function line_item_example_info_page() {
);
}
/**
* Implements hook_enable() to provide a new line item type.
*/
function line_item_example_enable() {
// Here we'll use the standard configuration functions, which add the necessary
// fields to the line item. If we didn't need those fields,
// we could do less.
commerce_line_item_configure_line_item_type('example_line_item');
commerce_product_line_item_configuration('example_line_item');
}
/**
* Implements hook_commerce_line_item_type_info().
*
* @see hook_commerce_line_item_type_info().
* @see http://www.drupalcommerce.org/specification/info-hooks/checkout
*
*/
function line_item_example_commerce_line_item_type_info() {
......@@ -62,10 +51,12 @@ function line_item_example_commerce_line_item_type_info() {
}
/**
* Implements hook_commerce_line_item_type_info_alter() to change the standard
* 'product' line item type's 'add_form_submit_value'.
* Implements hook_commerce_line_item_type_info_alter().
*
* Note that this only runs when the cache is cleared.
*
* Here we change the friendly name of the "product" line item type to "Widgets"
*
* @see hook_commerce_line_item_type_info_alter().
*
* @param $line_item_types
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment