User Tools

Site Tools


how_to_create_an_order_success_module

How to Create an Order Success Module

Important Information: Order Success modules are part of the Order Modules in LiteCart 2.0+. See How To Convert An Order Success Module To Order Module.

Order success modules was created to report sales e.g. Google Analytics E-commerce Tracking or affiliate programs. Basically it outputs html on the order success page. You decide the conditions and the data that should be output.

~/includes/modules/order_success/os_sales_pixel.inc.php
<?php
 
  class os_sales_pixel {
    public $id = __CLASS__;
    public $name = 'Sales Pixel';
    public $description = '';
    public $author = 'ACME Corp.';
    public $version = '1.0';
    public $website = 'http://www.acme.com';
    public $priority = 0;
 
    public function process($order) {
 
      if (empty($this->settings['status'])) return;
 
      $html = 'some html code here';
 
      return $html;
    }
 
    function settings() {
 
      return array(
        array(
          'key' => 'status',
          'default_value' => '1',
          'title' => language::translate(__CLASS__.':title_status', 'Status'),
          'description' => language::translate(__CLASS__.':description_status', 'Enables or disables the module.'),
          'function' => 'toggle("e/d")',
        ),
        array(
          'key' => 'priority',
          'default_value' => '0',
          'title' => language::translate(__CLASS__.':title_priority', 'Priority'),
          'description' => language::translate(__CLASS__.':description_priority', 'Process this module in the given priority order.'),
          'function' => 'int()',
        ),
      );
    }
 
    public function install() {}
 
    public function uninstall() {}
  }
 
?>
how_to_create_an_order_success_module.txt · Last modified: 2017/04/27 00:24 by admin