User Tools

Site Tools


how_to_create_an_order_total_module

How To Create an Order Total Module

~/includes/modules/order_total/ot_summary_line.inc.php
<?php
 
  class ot_summary_line {
    public $id = __CLASS__;
    public $name = 'Summary Line';
    public $description = '';
    public $author = 'LiteCart Dev Team';
    public $version = '1.0';
    public $website = 'http://www.litecart.net';
    public $priority = 0;
 
    public function process($order) {
 
      if (empty($this->settings['status'])) return;
 
      $output = array();
 
      $output[] = array(
        'title' => 'My Summary Line',
        'value' => 0.00,
        'tax' => 0.00,
        'calculate' => false, // Set to true will append the value and tax to the payment due
      );
 
      return $output;
    }
 
    function settings() {
      return array(
        array(
          'key' => 'status',
          'default_value' => '1',
          'title' => 'Status',
          'description' => 'Enables or disables the module.',
          'function' => 'toggle("e/d")',
        ),
        array(
          'key' => 'priority',
          'default_value' => '30',
          'title' => 'Priority',
          'description' => 'Process this module by the given priority value.',
          'function' => 'int()',
        ),
      );
    }
 
    public function install() {}
 
    public function uninstall() {}
  }
 
?>
how_to_create_an_order_total_module.txt · Last modified: 2016/08/11 16:46 by admin