Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Enable payment modules dynamically


storyleader

Recommended Posts

Normally, I take credit card payments through the Authorize.net payment module.

 

For certain products with recurring charges, however, I want to enable the Credit Card module and disable Authorize.net. Ideally, this would work with all products in a given category. But, if necessary, I could use a range of IDs or include some text in the product titles or elsewhere (e.g., "monthly").

 

In the wiki at Change Payment Option Over Certain Amount, there is this helpful bit of code:

 

"Find this line:

this->enabled = ((MODULE_PAYMENT_COD_STATUS == 'True') ? true : false);

and change to this:"

if ($order->info['total'] < 100) {

$this->enabled = ((MODULE_PAYMENT_COD_STATUS == 'True') ? true : false);

}

This shows how to enable a module based on the order total, and sounds like it should be adaptable for my purpose.

 

My question is this: what is the array (or whatever) that contains the names of the products in the cart? How would I reference it to create an "if" statement for each of the two payment modules?

 

For my ideal solution, is there an array that contains the category names of the products in the cart? How would I reference it?

 

Thanks for any help you can give.

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