public function on_admin_page()
    {
        $current_tab = isset($_GET['tab']) ? $_GET['tab'] : 'order totals';
        $current_view = isset($_GET['view']) ? $_GET['view'] : 0;
        ?>
		<div class="wrap woocommerce">
			<div class="icon32 woocommerce-dynamic-pricing" id="icon-woocommerce"><br></div><h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
				<?php 
        $tabs = apply_filters('woocommerce_dynamic_pricing_tabs', array('order totals' => array(array('title' => __('Order Totals Pricing', 'wc_pricing'), 'description' => 'Order Totals pricing allows you to configure price adjustments for the entire store based on the total order amount.  This is the last discount rule that will be applied.  If other discounts have been applied to cart items, these rules will not be applied to the cart.', 'function' => 'totals_tab')), 'roles' => array(array('title' => __('Role Pricing', 'wc_pricing'), 'description' => 'Role pricing allows you to configure price adjustments for the entire store based on a users role.', 'function' => 'membership_tab')), 'category' => array(array('title' => __('Category Pricing', 'wc_pricing'), 'description' => 'Use bulk category pricing to configure bulk price adjustments based on a product\'s category. Category pricing rules will apply before Membership (role-based pricing discounts), and will be cumulative with any Membership rules by default.   The cumulative filter can be used to change this behavior.', 'function' => 'basic_category_tab'), array('title' => __('Advanced Category Pricing', 'wc_pricing'), 'description' => 'Use advanced category pricing to configure price adjustments on items in a customers cart based on quantities.  Adjustments are calculated when the rule matches the configured quantities and will be applied to all items in the cart matching the selected category / categories.   
					     Advanced category adjustments take precedence over bulk category adjustments.', 'function' => 'advanced_category_tab'))));
        if (wc_dynamic_pricing_is_groups_active()) {
            $tabs['groups'] = array(array('title' => __('Group Pricing', 'wc_pricing'), 'description' => 'Group pricing allows you to configure price adjustments for the entire store based on a users groups.', 'function' => 'group_tab'));
        }
        foreach ($tabs as $name => $value) {
            echo '<a href="' . admin_url('admin.php?page=wc_dynamic_pricing&tab=' . $name) . '" class="nav-tab ';
            if ($current_tab == $name) {
                echo 'nav-tab-active';
            }
            echo '">' . ucfirst($name) . '</a>';
        }
        ?>
			</h2>

			<?php 
        if (sizeof($tabs[$current_tab]) > 0) {
            ?>
<ul class="subsubsub"><li><?php 
            $links = array();
            foreach ($tabs[$current_tab] as $key => $tab) {
                $link = '<a href="admin.php?page=wc_dynamic_pricing&tab=' . $current_tab . '&amp;view=' . $key . '" class="';
                if ($key == $current_view) {
                    $link .= 'current';
                }
                $link .= '">' . $tab['title'] . '</a>';
                $links[] = $link;
            }
            echo implode(' | </li><li>', $links);
            ?>
</li></ul><br class="clear" /><?php 
        }
        ?>

			<?php 
        if (isset($tabs[$current_tab][$current_view])) {
            ?>
 
				<?php 
            if (!isset($tabs[$current_tab][$current_view]['hide_title']) || $tabs[$current_tab][$current_view]['hide_title'] != true) {
                ?>
					<div class="tab_top"><h3 class="has-help"><?php 
                echo $tabs[$current_tab][$current_view]['title'];
                ?>
</h3>
						<?php 
                if ($tabs[$current_tab][$current_view]['description']) {
                    ?>
							<p class="help"><?php 
                    echo $tabs[$current_tab][$current_view]['description'];
                    ?>
</p>
						<?php 
                }
                ?>
					</div>
				<?php 
            }
            ?>
				<?php 
            $func = $tabs[$current_tab][$current_view]['function'];
            if ($func && method_exists($this, $func)) {
                $this->{$func}();
            }
            ?>
			<?php 
        }
        ?>
		</div>
		<?php 
    }
 public function __construct()
 {
     add_action('woocommerce_cart_loaded_from_session', array(&$this, 'on_cart_loaded_from_session'), 99, 1);
     //Add the actions dynamic pricing uses to trigger price adjustments
     add_action('woocommerce_before_calculate_totals', array(&$this, 'on_calculate_totals'), 99, 1);
     if (is_admin()) {
         require 'admin/admin-init.php';
     }
     //Include additional integrations
     if (wc_dynamic_pricing_is_groups_active()) {
         include 'integrations/groups/groups.php';
     }
     //Paypal express
     include 'integrations/paypal-express.php';
     include 'classes/class-wc-dynamic-pricing-compatibility.php';
     if (!is_admin() || defined('DOING_AJAX')) {
         //Include helper classes
         include 'classes/class-wc-dynamic-pricing-counter.php';
         include 'classes/class-wc-dynamic-pricing-tracker.php';
         include 'classes/class-wc-dynamic-pricing-cart-query.php';
         include 'classes/class-wc-dynamic-pricing-adjustment-set.php';
         include 'classes/class-wc-dynamic-pricing-adjustment-set-category.php';
         include 'classes/class-wc-dynamic-pricing-adjustment-set-product.php';
         include 'classes/class-wc-dynamic-pricing-adjustment-set-totals.php';
         //The base pricing module.
         include 'classes/modules/class-wc-dynamic-pricing-module-base.php';
         //Include the advanced pricing modules.
         include 'classes/modules/class-wc-dynamic-pricing-advanced-base.php';
         include 'classes/modules/class-wc-dynamic-pricing-advanced-product.php';
         include 'classes/modules/class-wc-dynamic-pricing-advanced-category.php';
         include 'classes/modules/class-wc-dynamic-pricing-advanced-totals.php';
         //Include the simple pricing modules.
         include 'classes/modules/class-wc-dynamic-pricing-simple-base.php';
         include 'classes/modules/class-wc-dynamic-pricing-simple-product.php';
         include 'classes/modules/class-wc-dynamic-pricing-simple-category.php';
         include 'classes/modules/class-wc-dynamic-pricing-simple-membership.php';
         //Include the UX module - This controls the display of discounts on cart items and products.
         include 'classes/class-wc-dynamic-pricing-frontend-ux.php';
         //Boot up the instances of the pricing modules
         $modules['advanced_product'] = WC_Dynamic_Pricing_Advanced_Product::instance();
         $modules['advanced_category'] = WC_Dynamic_Pricing_Advanced_Category::instance();
         $modules['simple_product'] = WC_Dynamic_Pricing_Simple_Product::instance();
         $modules['simple_category'] = WC_Dynamic_Pricing_Simple_Category::instance();
         $modules['simple_membership'] = WC_Dynamic_Pricing_Simple_Membership::instance();
         if (wc_dynamic_pricing_is_groups_active()) {
             include 'integrations/groups/class-wc-dynamic-pricing-simple-group.php';
             $modules['simple_group'] = WC_Dynamic_Pricing_Simple_Group::instance();
         }
         $modules['advanced_totals'] = WC_Dynamic_Pricing_Advanced_Totals::instance();
         $this->modules = apply_filters('wc_dynamic_pricing_load_modules', $modules);
         /* Boot up required classes */
         //Initialize the dynamic pricing counter.  Records various counts when items are restored from session.
         WC_Dynamic_Pricing_Counter::register();
         //Initialize the FrontEnd UX modifications
         WC_Dynamic_Pricing_FrontEnd_UX::init();
         //Filters for simple adjustment types
         //add_filter( 'woocommerce_grouped_price_html', array(&$this, 'on_price_html'), 10, 2 );
         //add_filter( 'woocommerce_sale_price_html', array(&$this, 'on_price_html'), 10, 2 );
         //add_filter( 'woocommerce_price_html', array(&$this, 'on_price_html'), 10, 2 );
         //add_filter( 'woocommerce_empty_price_html', array(&$this, 'on_price_html'), 10, 2 );
         //Dont think the following filter is required, because regular get price filter is also called.
         //add_filter( 'woocommerce_variable_price_html', array($this, 'on_price_html'), 10, 2 );
         //add_filter( 'woocommerce_variable_sale_price_html', array($this, 'on_price_html'), 10, 2 );
         //Filters the variation price displayed when a variation is selected.
         add_filter('woocommerce_variation_price_html', array(&$this, 'on_price_html'), 10, 2);
         //add_filter( 'woocommerce_variation_sale_price_html', array(&$this, 'on_price_html'), 10, 2 );
         add_filter('woocommerce_get_variation_price', array($this, 'on_get_variation_price'), 10, 4);
         add_filter('woocommerce_get_price_html', array(&$this, 'on_price_html'), 10, 2);
         add_filter('woocommerce_get_price', array($this, 'on_get_price'), 10, 2);
     }
     add_filter('woocommerce_dynamic_pricing_get_rule_amount', array($this, 'convert_decimals'), 99, 4);
 }