You are here

basic_cart.install in Basic cart 7

Basic cart install file

File

basic_cart.install
View source
<?php

/**
 * @file
 * Basic cart install file
 */

/**
 * Implements hook_install().
 */
function basic_cart_install() {
  $t = get_t();

  // Setting up the default messages.
  variable_set('basic_cart_admin_subject', $t('New order placed'));
  $default_admin_message = $t('Hi,
An order was placed by %CUSTOMER_NAME (%CUSTOMER_EMAIL)
Here are the order details:
%ORDER_DETAILS');
  variable_set('basic_cart_admin_message', $default_admin_message);
  variable_set('basic_cart_send_user_message', 1);
  variable_set('basic_cart_user_subject', $t('New order placed'));
  $default_user_message = $t('Hi,
You just placed an order on the website @sitename. Here are the order details:
%ORDER_DETAILS
We will contact you as soon as possible.', array(
    '@sitename' => variable_get('site_name'),
  ));
  variable_set('basic_cart_user_message', $default_user_message);
  $default_thank_you_title = $t("Thank you.");
  variable_set('basic_cart_thank_you_title', $default_thank_you_title);
  $default_thank_you_message = $t("Thank you for placing an order on our website.\nWe will contact you as soon as possible.");
  variable_set('basic_cart_thank_you_message', $default_thank_you_message);
}

/**
 * Implements hook_uninstall().
 */
function basic_cart_uninstall() {

  // Content types.
  variable_del('basic_cart_content_types');

  // Admin confirmation mail.
  variable_del('basic_cart_admin_subject');
  variable_del('basic_cart_admin_message');

  // User confirmation email.
  variable_del('basic_cart_user_subject');
  variable_del('basic_cart_user_message');
  variable_del('basic_cart_send_user_message');

  // Thank you messages.
  variable_del('basic_cart_thank_you_title');
  variable_del('basic_cart_thank_you_message');
}

Functions

Namesort descending Description
basic_cart_install Implements hook_install().
basic_cart_uninstall Implements hook_uninstall().