Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Minimum amount order per zone


hema77
 Share

Recommended Posts

Hi,

 

I am trying to change the module ot_minimum_order v 1.0 so I that this applies to only one zone but its still not working, could anybody help me out pls? I am really desperate to get this working. Thanks!

 

class ot_minimum_order {
var $title, $output,$description,$enabled,$sort_order;

function ot_minimum_order() {
 $this->code = 'ot_minimum_order';
 $this->title = MODULE_ORDER_TOTAL_MINORDER_TITLE . ' (' . MODULE_ORDER_TOTAL_MINORDER_TITLE_INSERT . MODULE_ORDER_TOTAL_MINORDER_ORDER_UNDER . ')';
 $this->description = MODULE_ORDER_TOTAL_MINORDER_DESCRIPTION;
 $this->enabled = ((MODULE_ORDER_TOTAL_MINORDER_STATUS == 'true') ? true : false);
 $this->sort_order = MODULE_ORDER_TOTAL_MINORDER_SORT_ORDER;

if ( ($this->enabled == true) && ((int)ORDER_TOTAL_MINORDER_ZONE > 0) ) {
 $check_flag = false;
 $check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . ORDER_TOTAL_MINORDER_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;
 }
 }



 $this->output = array();
}

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.

 Share

×
×
  • Create New...