A solution for setting a minimum and maximum perimeter (posted a few posts down)
Difficulty: Easy
Time: 5 Minutes
Version used when writing this tutorial: 1.5.1.3
Presently, the installed payment modules have an option to set a 'minimum' amount required before a payment option becomes available. However, another very useful option is the ability to change this so that a payment option is disabled in the event that an order reaches a certain amount.
This change can easily be made on a per-payment option basis...
To make the change simply decide which payment option(s) you want to set limits for..
We will be making 2 file edits for each payment option; 1 configuration edit and 1 language file edit.
-----
Please note: Although these are simple edits, it's always best to create back-up copies of a file before you edit it in case you make an error editing the file, or if some other issue arises. It's as simple as dropping the original files into a separate temporary folder on your desktop. Be sure to note the directories of those files, since many file names are the same and can be accidentally used to overwrite a completely different file.
-----
Edit #1 - Find the model file which determines the limitation rules..
Open the model file for your payment option under the folder:
catalog/model/payment/
The file name will look something like: my_payment_option_name.php
Search for the line of code that looks like this:
Code: Select all
if ($this->config->get('my_payment_option_name') > $total) {
Your update will now look like:
Code: Select all
if ($this->config->get(my_payment_option_name') < $total) {
Edit #2 - Change the language in your admin panel so you know what the setting does..
Open the language file for your payment option under:
admin/language/english/payment/
Again the file name will look something like: my_payment_option_name.php
Search for:
Code: Select all
$_['entry_total']
The default will read:
Code: Select all
Total:<br /><span class="help">The checkout total the order must reach before this payment method becomes active.</span>
Code: Select all
Maximum Total:<br /><span class="help">Amounts GREATER than this will DISABLE this payment option.</span>
Almost done... Now we just need to apply the setting to the payment option in your admin area.. Simply add the maximum amount you want to set for the payment option.
-----
Now you're all done.
Happy selling