Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Posts
    5
    Plugin Contributions
    0

    Default Re: Seriously Weird Configuration Setting In Zen Cart?

    Thanks Doc, gjh42, Kim... but I changed those values before posting, and that's why this is puzzling the h*** out of me.

    The code below is from the main moneyorder.php, - the one that is being referenced in the Dev. searches:

    Code:
    <?php
    /**
     * @package money order payment module
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: moneyorder.php 4960 2006-11-20 01:46:46Z drbyte $
     */
    
      class moneyorder {
        var $code, $title, $description, $enabled;
    
    // class constructor
        function moneyorder() {
          global $order;
    
          $this->code = 'cheque or postal order(s)';
          $this->title = MODULE_PAYMENT_MONEYORDER_TEXT_TITLE;
          if (IS_ADMIN_FLAG === true && (MODULE_PAYMENT_MONEYORDER_PAYTO == 'the Store Owner/Website Name' || MODULE_PAYMENT_MONEYORDER_PAYTO == '')) $this->title .= '<span class="alert"> (not configured - needs pay-to)</span>';
          $this->description = MODULE_PAYMENT_MONEYORDER_TEXT_DESCRIPTION;
          $this->sort_order = MODULE_PAYMENT_MONEYORDER_SORT_ORDER;
          $this->enabled = ((MODULE_PAYMENT_MONEYORDER_STATUS == 'True') ? true : false);
    
          if ((int)MODULE_PAYMENT_MONEYORDER_ORDER_STATUS_ID > 0) {
            $this->order_status = MODULE_PAYMENT_MONEYORDER_ORDER_STATUS_ID;
          }
    
          if (is_object($order)) $this->update_status();
        
          $this->email_footer = MODULE_PAYMENT_MONEYORDER_TEXT_EMAIL_FOOTER;
        }
    
    // class methods
        function update_status() {
          global $order, $db;
    
          if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_MONEYORDER_ZONE > 0) ) {
            $check_flag = false;
            $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_PAYMENT_MONEYORDER_ZONE . "' and zone_country_id = '" . $order->billing['country']['id'] . "' order by zone_id");
            while (!$check->EOF) {
              if ($check->fields['zone_id'] < 1) {
                $check_flag = true;
                break;
              } elseif ($check->fields['zone_id'] == $order->billing['zone_id']) {
                $check_flag = true;
                break;
              }
              $check->MoveNext();
            }
    
            if ($check_flag == false) {
              $this->enabled = false;
            }
          }
        }
    
        function javascript_validation() {
          return false;
        }
    
        function selection() {
          return array('id' => $this->code,
                       'module' => $this->title);
        }
    
        function pre_confirmation_check() {
          return false;
        }
    
        function confirmation() {
          return array('title' => MODULE_PAYMENT_MONEYORDER_TEXT_DESCRIPTION);
        }
    
        function process_button() {
          return false;
        }
    
        function before_process() {
          return false;
        }
    
        function after_process() {
          return false;
        }
    
        function get_error() {
          return false;
        }
    
        function check() {
          global $db;
          if (!isset($this->_check)) {
            $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_MONEYORDER_STATUS'");
            $this->_check = $check_query->RecordCount();
          }
          return $this->_check;
        }
    
        function install() {
          global $db;
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Cheque or UK Postal Order Module', 'MODULE_PAYMENT_MONEYORDER_STATUS', 'True', 'Do you want to accept Cheques or UK Postal Orders?', '6', '1', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now());");
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Make Payable to:', 'MODULE_PAYMENT_MONEYORDER_PAYTO', 'the Store Owner/Website Name', 'Who should payments be made payable to?', '6', '1', now());");
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_MONEYORDER_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '0', now())");
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Payment Zone', 'MODULE_PAYMENT_MONEYORDER_ZONE', '0', 'If a zone is selected, only enable this payment method for that zone.', '6', '2', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())");
          $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, use_function, date_added) values ('Set Order Status', 'MODULE_PAYMENT_MONEYORDER_ORDER_STATUS_ID', '0', 'Set the status of orders made with this payment module to this value', '6', '0', 'zen_cfg_pull_down_order_statuses(', 'zen_get_order_status_name', now())");
        }
    
        function remove() {
          global $db;
          $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
        }
    
        function keys() {
          return array('MODULE_PAYMENT_MONEYORDER_STATUS', 'MODULE_PAYMENT_MONEYORDER_ZONE', 'MODULE_PAYMENT_MONEYORDER_ORDER_STATUS_ID', 'MODULE_PAYMENT_MONEYORDER_SORT_ORDER', 'MODULE_PAYMENT_MONEYORDER_PAYTO');
        }
      }
    ?>
    You can clearly see that the wording has been changed and their is no reference to money order, except where needed by the PHP variables.

    I am going to recheck the database and see if that value has got stuck in there, or something...
    Last edited by GE3K; 23 Mar 2008 at 11:02 PM.

  2. #2
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Seriously Weird Configuration Setting In Zen Cart?

    Quote Originally Posted by GE3K View Post
    Code:
    // class constructor
        function moneyorder() {
          global $order;
    
          $this->code = 'cheque or postal order(s)';
    You should put this line back to what it was before, as changing it will mess up other things.

    I gather all you're looking for at this point is a minor cosmetic change for you as the administrator?
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Mar 2008
    Posts
    5
    Plugin Contributions
    0

    Default Re: Seriously Weird Configuration Setting In Zen Cart?

    Yes, that's all it was.

    Thank-you again, Doc (and everyone else who tried to help)!

    It doesn't matter how careful you are, there's always some small thing that bites you on the ...

 

 

Similar Threads

  1. Weird Error on zen cart--when logging back in
    By timhersh in forum General Questions
    Replies: 0
    Last Post: 28 Jun 2009, 05:06 AM
  2. Zen Cart Template Configuration.
    By Siena in forum General Questions
    Replies: 4
    Last Post: 2 Nov 2008, 05:08 PM
  3. Zen Cart configuration inquiries
    By karazy in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 30 May 2008, 04:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg