Jump to content
Sign in to follow this  
zpupster

freight shipping module

Recommended Posts

hello support,

using oscomm 2341 and on host's php 7.1

i have an old shipping module add on --that currently works like this(see pic).  it warns that this is a freight order (over 150 lbs) and has to be called in.

Capture.thumb.JPG.1baf1cc4e7e7d091fa811dd9d6d17bcc.JPG

but ideally, we would like the ups shipping quotes NOT to show, and just have the message to call in the order

i am guessing where this is return $this->quotes;

I would stop this or replace it with the text includes>languages>english>modules>shipping

define('MODULE_SHIPPING_RFQ_TEXT_DESCRIPTION', '<div class="alert-success">Call 1-800-555-5555 -- MUST CALL TO  COMPLETE FREIGHT ORDERS.</div>');

 

 

Please advise,

Z

herre is the code:

<?php
/*
  $Id: rfq.php,v 1.3 2006/02/13 14:29:56 naegle Exp $
  Based upon flat.php / spu.php by M. Halvorsen (http://www.arachnia-web.com)


  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
  
   CHANGES: NOV-20-05
   - formatted to work with latest checkout procedure
   - updated the db queries
   CHANGES: NOV-21-05
   - included icon
   - fixed table configuration
   CHANGES: FEB-13-06
    - Added Disable Zone
  
*/

  class rfq {
    var $code, $title, $description, $icon, $enabled;

// class constructor
    function rfq() {
      global $order, $total_weight;
      $this->code = 'rfq';
      $this->title = MODULE_SHIPPING_RFQ_TEXT_TITLE;
      $this->description = MODULE_SHIPPING_RFQ_TEXT_DESCRIPTION;
      $this->sort_order = MODULE_SHIPPING_RFQ_SORT_ORDER;
     // $this->icon = 'images/icons/shipping_rfq.gif';
      $this->enabled = ((MODULE_SHIPPING_RFQ_STATUS == 'True') ? true : false);
      if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_RFQ_ZONE > 0) ) {
        $check_flag = false;
        $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id <> '" . MODULE_SHIPPING_RQF_ZONE . "' and zone_country_id <> '" . $order->delivery['country']['id'] . "' order by zone_id");
        while ($check = tep_db_fetch_array($check_query)) {
          if ($check['zone_id'] < 1) {
            $check_flag = true;
            break;
          } elseif ($check['zone_id'] == $order->delivery['zone_id']) {
            $check_flag = true;
            break;
          }
        }
        
        if ($check_flag == false) {
          $this->enabled = false;
        }
      }

      if ($total_weight < 150) {
         $this->enabled = false;
       }
    }

// class methods
  
    function quote($method = '') {
      global $order;
      
      $this->quotes = array('id' => $this->code,
                            'module' => MODULE_SHIPPING_RFQ_TEXT_TITLE,
                            'methods' => array(array('id' => $this->code,
                                                     'title' => MODULE_SHIPPING_RFQ_TEXT_WAY,
                                                     'cost' =>  MODULE_SHIPPING_RFQ_COST)));

      if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);

      return $this->quotes;
    }

    function check() {
      if (!isset($this->_check)) {
        $check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_RFQ_STATUS'");
        $this->_check = tep_db_num_rows($check_query);
      }
      return $this->_check;
    }

    function install() {
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Shipping Quotes', 'MODULE_SHIPPING_RFQ_STATUS', 'True', 'Do you want to offer shipping quotes?', '6', '6', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Quote Fee', 'MODULE_SHIPPING_RFQ_COST', '0.00', 'What is the Quote Fee?', '6', '6', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_RFQ_ZONE', '0', 'If a zone is selected, DISABLE this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");
      tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_RFQ_SORT_ORDER', '6', 'Sort order of display.', '6', '6', 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 ('" . implode("', '", $this->keys()) . "')");
    }

    function keys() {
      return array('MODULE_SHIPPING_RFQ_STATUS', 'MODULE_SHIPPING_RFQ_COST', 'MODULE_SHIPPING_RFQ_SORT_ORDER', 'MODULE_SHIPPING_RFQ_ZONE');
    }
  }
?>

 

Share this post


Link to post
Share on other sites

ok,

thinking about this.

1) i need to turn off the ups module.

this piece of code might do that, any suggestions where to place in the upsxml 1.7 module?

   if ($check_flag == false) {
          $this->enabled = false;
        }
      }

      if ($total_weight < 150) {
         $this->enabled = false;
       }

i would have change direction of inequality sign.

i tried many things, replacing this

return $this->quotes;

with this

$this->description

tried commenting this out.

$this->quotes = array('id' => $this->code,
                            'module' => MODULE_SHIPPING_RFQ_TEXT_TITLE,
                            'methods' => array(array('id' => $this->code,
                                                     'title' => MODULE_SHIPPING_RFQ_TEXT_WAY,
                                                     'cost' =>  MODULE_SHIPPING_RFQ_COST)));

no errors just breaks.

any hints??

Z

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×