Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

REQUEST FOR QUOTE module question


rjckicks1

Recommended Posts

I have this module installed on my site -

 

http://www.oscommerce.com/community/contri.../search,request

 

I want to make it so this shipping method will only be available to select when the orders weight is over a certain amount.

 

Does anyone know the code I would have to modify in the rfq.php file to do this?

 

I would really appreciate some help.

 

Thanks

Link to comment
Share on other sites

There is enable disable concept for any shipping module.

So in that part You need to get cart weight and disable if weight less then what You want.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

Hi satish,

 

I'm no programmer, do you think you could help me out with that line of code? The thing is i did this with another shipping module because I found the code in another module, and moved it to another module and it worked. The thing is I can't do that with this one because it seems to me that there are functions that are not described in this module for shipping so it dosen't know what $shipping or $shipping_weight are. Here is the php file -

 

<?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;
  $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 = DIR_WS_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;
	}
  }
}

// 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');
}
 }
?>

Edited by rjckicks1
Link to comment
Share on other sites

Hi satish,

 

I'm no programmer, do you think you could help me out with that line of code? The thing is i did this with another shipping module because I found the code in another module, and moved it to another module and it worked. The thing is I can't do that with this one because it seems to me that there are functions that are not described in this module for shipping so it dosen't know what $shipping or $shipping_weight are. Here is the php file -

 

<?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;
  $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 = DIR_WS_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;
	}
  }
}

// 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');
}
 }
?>

global $order

this has all products.

Using some logic get there wts.

 

Am suffering from some eye infection so will not be able to assist much for next two days.

 

satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

take table rate module or any module

global $shipping_weight

 

if($shipping_weight < minimum weight)

$this->enabled = false;

 

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

Hi satish,

 

Where in the php file should I add this code ?

 

Here is the code for the php file -

 

<?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;
  $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 = DIR_WS_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;
	}
  }
}

// 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');
}
 }
?>

 

Thanks for your help

Link to comment
Share on other sites

take table rate module or any module

global $shipping_weight

 

if($shipping_weight < minimum weight)

$this->enabled = false;

Satish

 

Hi Satish

 

Do you know the code that I could use to tell the module to only appear if no other modules are available?

 

For example if I have royal mail module and request for quote module, and I want the request for quote module to appear if the royal mail module is unavailable and dosent appear, so then they an request for a quote.

 

Thanks

Link to comment
Share on other sites

  • 2 months later...

Does anyone know how I would add the ordered contents back into the shopping cart so the client can change or add to the existing order? Since this RFQ no payments will have been made yet and my entire site will be for RFQ's (RFP's) ONLY.

Link to comment
Share on other sites

Update:

 

I have the carts reloading into the cart only now I have add a new function to update the existing order rather than insert it as a new order in the db. Any thoughts?

Link to comment
Share on other sites

Update:

 

I have the carts reloading into the cart only now I have add a new function to update the existing order rather than insert it as a new order in the db. Any thoughts?

NVM I have it now. Apparently this is a dead zone.

Link to comment
Share on other sites

  • 2 weeks later...
NVM I have it now. Apparently this is a dead zone.

 

Why is there no logic between the 2 contributions to be tied together in the logic? Meaning, the RFQ2 module for payment should only show up as an option if the RFQ1 shipping option has been selected.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...