
Zen Cart Optional Payment Method
A Zen Cart™ mod which copies sidebox settings from one template to another.Donate: This is free software. Show your appreciation by supporting my efforts.

Relevance: Zen Cart™ 1.5.1 and above
Current Version: 1.2 (version history)
Support Thread: Optional Payment Method Support Thread
Cost: Free, but donation appreciated
Installed Cost: $60.00 Buy Professional Installation by That Software Guy
Installation Difficulty: Moderate
Installation Instructions: click here
Location: Zen Cart Plugins, under Admin Tools
Download: Optional Payment Method in Zen Cart Plugins
Overview:
If you have a payment method that you want only certain customers to have access to, this module will help you do that.It adds a checkbox (defaulted to unchecked) permitting the use of another payment module to the Admin > Customers > Customers screen.

Installation Instructions:
- Back up everything! Try this in a test environment prior to installing it on a live shop.
- Unzip the file you have received.
- In Admin > Tools > Install SQL Patches, run optional_payment.sql.
- In your copy of
includes/classes/payment.php
, in the first instance of the line$class = substr($value, 0, strrpos($value, '.'));
For Zen Cart 1.3.9 through 1.5.3, this is line 50
Add the following logic below that line:// bof optional payment method logic if ($class == 'braintree_api') { global $db; $cid = $_SESSION['customer_id']; $class_ok = $db->Execute("SELECT optional_payment_1 FROM " . TABLE_CUSTOMERS . " WHERE customers_id = " . (int)$cid); if ($class_ok->fields['optional_payment_1'] != 1) { continue; } } // eof optional payment method logic
Changebraintree_api
to the name of the payment module you want to be optional. - Install
admin/customers.php
. Change the string "Allow use of BrainTree CC Module?" to one of your own choosing. - If you want to allow customers to decide whether or not to show this payment module, just add the ability to get/set optional_payment_1 to the account_edit page and template.
- Donate! Show your appreciation by supporting my efforts.
Major Versions
- 1.2 01/02/2015 - Updates for Zen Cart 1.5.5a
- 1.1 01/02/2015 - Updates for Zen Cart 1.5.4.
- 1.0 12/01/2014 - First Release
FAQ
Q: What are some ways I could further customize this mod?A: This post provides some ideas.
Q: Could I use this in the Invoice Payment Method mod to determine eligibility, rather than using the customer's group id?
A: Yes! That's exactly the idea.