Jump to content
Sign in to follow this  
hema77

Minimum amount order per zone

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();
}

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  

×