You are here

basic_cart_order.install in Basic cart 7.3

Same filename and directory in other branches
  1. 7.2 basic_cart_order/basic_cart_order.install

Basic Cart Order install file

File

basic_cart_order/basic_cart_order.install
View source
<?php

/**
 * @file
 * Basic Cart Order install file
 */

/**
 * Implements hook_schema().
 */
function basic_cart_order_schema() {
  $schema['basic_cart_order_node'] = array(
    'description' => 'Basic cart order registration table.',
    'fields' => array(
      'oid' => array(
        'description' => 'The primary identifier for an order.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'nid' => array(
        'description' => 'Order node.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'quantity' => array(
        'description' => 'Order node quantity.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'oid',
      'nid',
    ),
  );
  return $schema;
}

/**
 * Removing the required property from total price.
 */
function basic_cart_order_update_7200() {
  $instance_info = field_info_instance('node', 'field_total_price', 'order');
  $instance_info['required'] = FALSE;
  field_update_instance($instance_info);
}

Functions

Namesort descending Description
basic_cart_order_schema Implements hook_schema().
basic_cart_order_update_7200 Removing the required property from total price.