[ Index ]
 

Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/includes/modules/order_total/ -> ot_tax.php (source)

   1  <?php
   2  //

   3  // +----------------------------------------------------------------------+

   4  // |zen-cart Open Source E-commerce                                       |

   5  // +----------------------------------------------------------------------+

   6  // | Copyright (c) 2003 The zen-cart developers                           |

   7  // |                                                                      |

   8  // | http://www.zen-cart.com/index.php                                    |

   9  // |                                                                      |

  10  // | Portions Copyright (c) 2003 osCommerce                               |

  11  // +----------------------------------------------------------------------+

  12  // | This source file is subject to version 2.0 of the GPL license,       |

  13  // | that is bundled with this package in the file LICENSE, and is        |

  14  // | available through the world-wide-web at the following url:           |

  15  // | http://www.zen-cart.com/license/2_0.txt.                             |

  16  // | If you did not receive a copy of the zen-cart license and are unable |

  17  // | to obtain it through the world-wide-web, please send a note to       |

  18  // | license@zen-cart.com so we can mail you a copy immediately.          |

  19  // +----------------------------------------------------------------------+

  20  // $Id: ot_tax.php 1969 2005-09-13 06:57:21Z drbyte $

  21  //

  22  
  23    class ot_tax {
  24      var $title, $output;
  25  
  26      function ot_tax() {
  27        $this->code = 'ot_tax';
  28        $this->title = MODULE_ORDER_TOTAL_TAX_TITLE;
  29        $this->description = MODULE_ORDER_TOTAL_TAX_DESCRIPTION;
  30        $this->sort_order = MODULE_ORDER_TOTAL_TAX_SORT_ORDER;
  31  
  32        $this->output = array();
  33      }
  34  
  35      function process() {
  36        global $order, $currencies;
  37  
  38        reset($order->info['tax_groups']);
  39        while (list($key, $value) = each($order->info['tax_groups'])) {
  40          if ($value > 0 or STORE_TAX_DISPLAY_STATUS == 1) {
  41            $this->output[] = array('title' => $key . ':',
  42                                    'text' => $currencies->format($value, true, $order->info['currency'], $order->info['currency_value']),
  43                                    'value' => $value);
  44          }
  45        }
  46      }
  47  
  48      function check() {
  49        global $db;
  50        if (!isset($this->_check)) {
  51          $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_ORDER_TOTAL_TAX_STATUS'");
  52          $this->_check = $check_query->RecordCount();
  53        }
  54  
  55        return $this->_check;
  56      }
  57  
  58      function keys() {
  59        return array('MODULE_ORDER_TOTAL_TAX_STATUS', 'MODULE_ORDER_TOTAL_TAX_SORT_ORDER');
  60      }
  61  
  62      function install() {
  63        global $db;
  64        $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('This module is installed', 'MODULE_ORDER_TOTAL_TAX_STATUS', 'true', '', '6', '1','zen_cfg_select_option(array(\'true\'), ', now())");
  65        $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_TAX_SORT_ORDER', '300', 'Sort order of display.', '6', '2', now())");
  66      }
  67  
  68      function remove() {
  69        global $db;
  70        $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
  71      }
  72    }
  73  ?>


Généré le : Mon Nov 26 16:45:43 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics