Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Enabling, disabling a payment module vs total price


bigberge

Recommended Posts

Is there a way to enable a payment mode for lets say all transactions of 12$ and less ?

 

Ans is there a way to disable a payment mode for transactions of 12$ and less ... or enable it only for transactions over 12,00$ ?

Link to comment
Share on other sites

You need to modify the paymenr module's update_status function

 

look for something like:

	function update_status() {
  global $order;

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

// disable the module if the order only contains virtual products
  if ($this->enabled == true) {
	if ($order->content_type == 'virtual') {
	  $this->enabled = false;
	}
  }
}

 

and before the final } add:

// Disable order module if order total if $12 or less
 if (true == $this->enabled && 12 > $order->info['total']) {
$this->enabled = false;
 }

Link to comment
Share on other sites

if i am correct, to disable a payment module for 12$ or more i juste switch the >

 

like this ?

 

// Disable order module if order total if $12 or less
 if (true == $this->enabled && 12 < $order->info['total']) {
$this->enabled = false;
 }

 

Thanks alot !

Link to comment
Share on other sites

The way I had written it was correct to disable it if the order is less than $12

 

12 < $order->info['total'] means "12 is more than the order total" (just another way of saying "the order total is less than 12")

Link to comment
Share on other sites

Great, that what i understood.

 

Also, i have a little problem. I want paypal to do both transactions, but with a different payment email.

 

So i need to get 2 paypal transaction modules, i tried to modify the Paypal standard so it would be another module with a different name... but it doesnt work.

 

Any clues ?

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...