Skip to content

Instantly share code, notes, and snippets.

@cafuego
Last active August 29, 2015 13:57
Show Gist options
  • Save cafuego/9677096 to your computer and use it in GitHub Desktop.
Save cafuego/9677096 to your computer and use it in GitHub Desktop.
uc_gst module
; @file uc_gst.info
name = UC GST
description = Add GST information to the checkout process.
core = 7.x
dependencies[] = uc_cart
<?php
/**
* @file uc_gst.module
* GST module for Ubercart
*/
/**
* Implements hook_uc_checkout_pane().
*
* Add GST infomation to the checkout pane.
*/
function uc_gst_uc_checkout_pane() {
$panes['gst'] = array(
'callback' => 'uc_gst_checkout_pane_callback',
'title' => t('GST'),
'desc' => t("Display the GST applicable to the order."),
'weight' => 1,
'process' => FALSE,
'collapsible' => FALSE,
);
return $panes;
}
/**
* Callback for the gst checkout pane.
*/
function uc_gst_checkout_pane_callback($op, $order, $form = NULL, &$form_state = NULL) {
switch ($op) {
case 'review':
$gst = 12.00; // You should do a calculation based on the contens of the $order object.
$message = t('This order includes $@gst goods and services tax.', array('@gst' => $gst));
$review[] = array('title' => t('Goods and services tax'), 'data' => check_plain($message));
return $review;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment