不用飞了,大家可以到这里看看www.verygoodbuy.com
我想在shipping mothed 里面加一个下拉框,里面列举送货的地址和费用,
因为代码是下载过来改的,我看了好久,在这个问题上没有进展.
源代码可以到这里下载www.oscommerce.com下载,我整理一下,然后再发点代码上来.请大家执教!
zairwolf(君子兰) ,你说的QQ是多少呢。。谢谢各位!

解决方案 »

  1.   

    <?php
    /*  Released under the GNU General Public License*/  class tollzipzones {
        var $code, $title, $description, $enabled, $num_zones, $surcharge_factor;// class constructor:w    function tollzipzones() {
          $this->code = 'tollzipzones';
          $this->title = MODULE_SHIPPING_TOLLZIPZONES_TEXT_TITLE;
          $this->description = MODULE_SHIPPING_TOLLZIPZONES_TEXT_DESCRIPTION;
          $this->icon = DIR_WS_ICONS . 'toll_sml.gif';
          $this->enabled = MODULE_SHIPPING_TOLLZIPZONES_STATUS;      // Customize this setting for the number of zones needed (no change required by default)
          $this->num_zones = 1; //More options can be added later for Express, Overnight etc when someone codes it.
          $this->types = array('Toll Off-Peak' => 'std');      // Change this surcharge factor to increase your profit margin on freight
        
        }// class methods    function quote($method = '') {      global $order, $shipping_weight, $shipping_num_boxes;
          $shzones_array = array();
          $shzones = tep_db_query("select * from " . TABLE_SHZONES ."");
           while ($shzones_values = tep_db_fetch_array($shzones)){        $shzones_array[] = array('zone_id' => $shzones_values['zone_id'],
                             'zone_name' => $shzones_values['zone_name'],
                                     'fee' => $shzones_values['fee']);
     }
          $shzones_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
          $shzones = $shzones_array;
          for ($i=0, $n=sizeof($shzones); $i<$n; $i++) {
           $shzones_array[] = array('id' => $shzones[$i]['zone_id'], 'text' => $shzones[$i]['zone_name'] , 'fee' => $shzones[$i]['fee']);
       }    $field = '<select name="zones"';
        $values=$shzones_array;
        for ($i=0, $n=sizeof($values); $i<$n; $i++) {
          $field .= '<option value="' . tep_output_string($values[$i]['id']) . '"';
          if ($default == $values[$i]['id']) {
            $field .= ' SELECTED';
          }      $field .= '>'.tep_output_string($values[$i]['text'], array('"' => '&quot;', '\'' => '&#039;', '<' => '&lt;', '>' => '&gt;')) . tep_output_string($values[$i]['fee'], array('"' => '&quot;', '\'' => '&#039;', '<' => '&lt;', '>' => '&gt;')) . '</option>';
      
        }
        $field .= '</select>';

    $this->quotes = array('id' => $this->code,
                     'module' => MODULE_SHIPPING_TOLLZIPZONES_TEXT_TITLE,
        'methods' => array(array('id' => $this_code,
         'title' => MODULE_SHIPPING_TOLLZIPZONES_TEXT_DESCRIPTION,
                                           'cost' => $cost+ MODULE_SHIPPING_TOLLZIPZONES_HANDLING)));
    //1.10 added to calculate 10% GST on freight in Australia
          if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);
          if ($error == true) $this->quotes['error'] = MODULE_SHIPPING_TOLLZIPZONES_INVALID_ZONE;
          return $this->quotes;
        }
     
          function install() {
          tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Enable Toll Postcode Zones Method', 'MODULE_SHIPPING_TOLLZIPZONES_STATUS', '1', 'Do you want to offer Toll postcode/zone rate shipping?', '6', '0', now())");
          tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_TOLLZIPZONES_HANDLING', '0', 'Handling Fee for this shipping method', '6', '0', now())");
      
        }    function remove() {
          $keys = '';
          $keys_array = $this->keys();
          for ($i=0; $i<sizeof($keys_array); $i++) {
            $keys .= "'" . $keys_array[$i] . "',";
          }
          $keys = substr($keys, 0, -1);      tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in (" . $keys . ")");
        }    function keys() {
          $keys = array(
           'MODULE_SHIPPING_TOLLZIPZONES_STATUS',
          'MODULE_SHIPPING_TOLLZIPZONES_HANDLING',
    );      return $keys;
    }
      
      }
    ?>
    怎么样把下拉框中被选中的项得值传到$this->quotes里面来!