Jump to content



Latest News: (loading..)

lyonsperf

Member Since 27 Mar 2008
OFFLINE Last Active May 19 2013 02:57 PM
-----

Posts I've Made

In Topic: [Contribution] iOSC - mobile version of OSC on your iPhone

18 May 2013 - 05:08 PM

Has anyone ported Additional Images Mod and/or MVS for this contribution?

In Topic: Article Manager v1.0

06 February 2013 - 07:25 PM

HI Jack,
I have been using this mod sucessfully for a while. I just added a new article that is several pages long but when viewed through my site it is truncated to the first page of the article. Is there a field I need to change to extend the viewable length?

In Topic: Multi_Vendor_Shipping new thread

13 January 2013 - 03:39 PM

OK, after many winmerge compares of different free shipping mods and not finding a single difference, I finally found the answer.

If you enable free shipping in your admin panel/vendor section you must also go into admin panel-Modules-Order Total-Shipping, then click edit for the shipping line and change allow free shipping from true to false. This then allows the new MVS free shipping mod to enable!
Three days of work for one simple change!
Hope this helps someone else!

In Topic: Multi_Vendor_Shipping new thread

11 January 2013 - 09:23 PM

I need it to offer free shipping after a minimum is reached.

In Topic: Multi_Vendor_Shipping new thread

11 January 2013 - 09:22 PM

Here's the code I have
<?php
/*
  $Id$ freeamount.php 2
  Modified for MVS_1.2.3 2010/03/03 Motorcity
  Modified for MVS V1.0 2006/03/25 JCK/CWG
  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com
  Copyright (c) 2006 osCommerce
  Released under the GNU General Public License
  ----------------------------------------------
  ane - 06/02/02 - modified freecount.php to
  allow for freeshipping on minimum order amount
  originally written by dwatkins 1/24/02
  Modified BearHappy 09/04/04
  ----------------------------------------------
*/

  class freeamount {
	var $code, $title, $description, $icon, $enabled;
// class constructor
	function freeamount() {
	  global $order, $vendors_id;

	  $this->code = 'freeamount';
	  $this->title = MODULE_SHIPPING_FREEAMOUNT_TEXT_TITLE;
	  $this->description = MODULE_SHIPPING_FREEAMOUNT_TEXT_DESCRIPTION;
	  $this->icon ='';
	  $this->delivery_country_id = $order->delivery['country']['id'];
	  $this->delivery_zone_id = $order->delivery['zone_id'];
	}
   
	//MVS start
	function sort_order($vendors_id = '1') {
	  if (defined(@ constant('MODULE_SHIPPING_FREEAMOUNT_SORT_ORDER_' . $vendors_id))) {
		$this->sort_order = @ constant('MODULE_SHIPPING_FREEAMOUNT_SORT_ORDER_' . $vendors_id);
	  } else {
		$this->sort_order = '-';
	  }
	  return $this->sort_order;
   }
	function tax_class($vendors_id='1') {
	  $this->tax_class = constant('MODULE_SHIPPING_FREEAMOUNT_TAX_CLASS_' . $vendors_id);
	  return $this->tax_class;
	}
	function enabled($vendors_id='1') {
	  $this->enabled = false;
	  $status = @ constant('MODULE_SHIPPING_FREEAMOUNT_STATUS_' . $vendors_id);
	  if (isset ($status) && $status != '') {
		$this->enabled = (($status == 'True') ? true : false);
	  }
	  if (($this->enabled == true) && ((int) constant('MODULE_SHIPPING_FREEAMOUNT_ZONE_' . $vendors_id) > 0)) {
		$check_flag = false;
		$check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . (int) constant('MODULE_SHIPPING_FREEAMOUNT_ZONE_' . $vendors_id) . "' and zone_country_id = '" . $this->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'] == $this->delivery_zone_id) {
			$check_flag = true;
			break;
		  }
		}
		if ($check_flag == false) {
		  $this->enabled = false;
		} //if
	  } //if
	  return $this->enabled;
	}
	function zones($vendors_id = '1') {
	  if (($this->enabled == true) && ((int) constant('MODULE_SHIPPING_FREEAMOUNT_ZONE_' . $vendors_id) > 0)) {
		$check_flag = false;
		$check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . (int) constant('MODULE_SHIPPING_FREEAMOUNT_ZONE_' . $vendors_id) . "' 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
		} //while
		if ($check_flag == false) {
		  $this->enabled = false;
		} //if
	  } //if
	  return $this->enabled;
	} //function
	//MVS End
// class methods
	function quote($method = '', $module = '', $vendors_id = '1') {
	  global $_POST, $order, $cart, $total_count, $shipping_weight, $shipping_num_boxes;
	  //MVS Start
	  $vendors_data_query = tep_db_query("select handling_charge,
												 handling_per_box,
												 vendor_country,
												 vendors_zipcode
										  from " . TABLE_VENDORS . "
										  where vendors_id = '" . (int) $vendors_id . "'");
	  $vendors_data = tep_db_fetch_array($vendors_data_query);
	  $country_name = tep_get_countries($vendors_data['vendor_country'], true);
   $get_total = false;
   $get_weight = false;
	  $handling_charge = $vendors_data['handling_charge'];
	  $handling_per_box = $vendors_data['handling_per_box'];
	  if ($handling_charge > $handling_per_box * $shipping_num_boxes) {
		$handling = $handling_charge;
	  } else {
		$handling = $handling_per_box * $shipping_num_boxes;
	  }
	  $shipping = @[member='constant']('MODULE_SHIPPING_FREEAMOUNT_COST_' . $vendors_id) + $handling;
	  //MVS End

	  if ($shipping_weight > @[member='constant']('MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX_' . $vendors_id)) {
		if (@[member='constant']('MODULE_SHIPPING_FREEAMOUNT_DISPLAY_' . $vendors_id) == 'False') return;
// This next line might be used by some sites, but most wouldn't want it by default. 
//	$this->quotes['error'] = MODULE_SHIPPING_FREEAMOUNT_TEXT_TOO_HEAVY . ' (' . $shipping_weight . ') ' . MODULE_SHIPPING_FREEAMOUNT_TEXT_UNIT;
  $get_weight = false;
	  } else {
	$get_weight = true;
   }
	  if ($cart->show_total() < @[member='constant']('MODULE_SHIPPING_FREEAMOUNT_AMOUNT_' . $vendors_id)) {
		if (@[member='constant']('MODULE_SHIPPING_FREEAMOUNT_DISPLAY_' . $vendors_id) == 'False') return;
	   $this->quotes['error'] = MODULE_SHIPPING_FREEAMOUNT_TEXT_ERROR . ' (' . @[member='constant']('MODULE_SHIPPING_FREEAMOUNT_AMOUNT_' . $vendors_id) . ') ';
  $get_total = false;
	  } else {
	 $get_total = true;
		
if (($get_total == true && $get_weight == true))
   {
	   $this->quotes = array('id' => $this->code,
							 'module' => MODULE_SHIPPING_FREEAMOUNT_TEXT_TITLE,
							 'methods' => array(array('id' => $this->code,
							 'title' => MODULE_SHIPPING_FREEAMOUNT_TEXT_WAY,
							 'cost' => $shipping)));
  }
		}
	  if ($this->tax_class($vendors_id) > 0) {
		$this->quotes['tax'] = tep_get_tax_rate($this->tax_class($vendors_id), $order->delivery['country']['id'], $order->delivery['zone_id']);
	  }
	  if (tep_not_null($this->icon))
		$this->quotes['icon'] = tep_image($this->icon, $this->title);
	  return $this->quotes;
	}
	function check($vendors_id = '1') {
	  if (!isset ($this->_check)) {
		$check_query = tep_db_query("select configuration_value from " . TABLE_VENDOR_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_FREEAMOUNT_STATUS_" . $vendors_id . "'");
		$this->_check = tep_db_num_rows($check_query);
	  }
	  return $this->_check;
	}
	function install($vendors_id = '1') {
	  tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, vendors_id) values ('Enable Free Shipping with Minimum Purchase', 'MODULE_SHIPPING_FREEAMOUNT_STATUS_" . $vendors_id . "', 'True', 'Do you want to offer minimum order free shipping?', '6', '7', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now(), '" . $vendors_id . "')");
	  tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id,  sort_order, date_added, vendors_id) values ('Maximum Weight', 'MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX_" . $vendors_id . "', '10', 'What is the maximum weight you will ship?', '6', '8', now(), '" . $vendors_id . "')");
	  tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, vendors_id) values ('Enable Display', 'MODULE_SHIPPING_FREEAMOUNT_DISPLAY_" . $vendors_id . "', 'True', 'Do you want to display text way if the minimum amount is not reached?', '6', '7', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now(), '" . $vendors_id . "')");
	  tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id,  sort_order, date_added, vendors_id) values ('Minimum Cost', 'MODULE_SHIPPING_FREEAMOUNT_AMOUNT_" . $vendors_id . "', '50.00', 'Minimum order amount purchased before shipping is free?', '6', '8', now(), '" . $vendors_id . "')");
	  tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added, vendors_id) values ('Sort Order', 'MODULE_SHIPPING_FREEAMOUNT_SORT_ORDER_" . $vendors_id . "', '0', 'Sort order of display.', '6', '0', now(), '" . $vendors_id . "')");
	  tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added, vendors_id) values ('Tax Class', 'MODULE_SHIPPING_FREEAMOUNT_TAX_CLASS_" . $vendors_id . "', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now(), '" . $vendors_id . "')");
	  tep_db_query("insert into " . TABLE_VENDOR_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added, vendors_id) values ('Shipping Zone', 'MODULE_SHIPPING_FREEAMOUNT_ZONE_" . $vendors_id . "', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now(), '" . $vendors_id . "')");
   }
	function remove($vendors_id) {
	  tep_db_query("delete from " . TABLE_VENDOR_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys($vendors_id)) . "')");
	}
	function keys($vendors_id) {
	  return array (
'MODULE_SHIPPING_FREEAMOUNT_STATUS_' . $vendors_id,
'MODULE_SHIPPING_FREEAMOUNT_WEIGHT_MAX_' . $vendors_id,
'MODULE_SHIPPING_FREEAMOUNT_SORT_ORDER_' . $vendors_id,
'MODULE_SHIPPING_FREEAMOUNT_DISPLAY_' . $vendors_id,
'MODULE_SHIPPING_FREEAMOUNT_TAX_CLASS_' . $vendors_id,
'MODULE_SHIPPING_FREEAMOUNT_AMOUNT_' . $vendors_id,
'MODULE_SHIPPING_FREEAMOUNT_ZONE_' . $vendors_id
);
	}
  }
  ?>