Default the "Pay the Payment Gateway Fee" option to NO

  • James Riley
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
4 years 9 months ago - 4 years 9 months ago #126946 by James Riley
I want the Pay Gateway Fee option that the user sees on the donation form to default to NO, instead of YES.

I found that I can force it by editing JoomDonation's view\donation\html.php file and changing the "1" at the end of this line to "0":
Code:
$lists['pay_payment_gateway_fee'] = JHtml::_('select.booleanlist', 'pay_payment_gateway_fee', ' class="inputbox" ', $input->getInt('pay_payment_gateway_fee', 1)) ; // CHANGE "1" (YES) to "0" (NO) to change the default selection
but this is not an update-safe edit and will get overwritten every time the extension is updated.

Please add a configuration toggle to change the default behavior!
Also, it would be great if the user was shown the actual additional amount that they will be changed. I have set my description text to include mention of the percentage that they will be charged if they select "yes", but that means they have to do the math and think about what it will cost them.

Thanks!

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Last edit: 4 years 9 months ago by James Riley.

Please Log in or Create an account to join the conversation.

More
4 years 9 months ago #126963 by Dave B
I have been asking for this for two years. Thanks for agreeing with me that it's a needed setting if you are going to have this at all.

Please Log in or Create an account to join the conversation.

  • James Riley
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
4 years 9 months ago - 4 years 9 months ago #126980 by James Riley
Here's an upgrade-safe hack for this issue. Even though this works, this really should be a configuration option.

Assuming you don't already have a template override in place, navigate to /components/com_jdonation/view/donation/tmpl/ and grab either simpleflow_layout.php or default.php (depending on which layout you use). Save a copy of this file into /templates/YOUR-TEMPLATE/html/com_jdonation/donation/.
Open this copied file, and search for:
Code:
<div class="<?php echo $controlGroupClass;?>" id="pay_payment_gateway_fee_div">

Above that line of code, paste the following:
Code:
<?php // CHANGE THE DEFAULT VALUE OF THE "PAY DONATION FEE" OPTION TO "NO" $this->lists['pay_payment_gateway_fee'] = str_replace('checked="checked"','',$this->lists['pay_payment_gateway_fee']); $this->lists['pay_payment_gateway_fee'] = str_replace('value="0"','value="0" checked="checked"',$this->lists['pay_payment_gateway_fee']); ?>

Basically, this code does a search for the "checked" property and removes it. Then it looks for the "NO / value=0" radio button and adds the "checked" property to it instead.

James Riley .: EventBooking user since 2014 ::: JoomDonation user since 2016 :.
.: grfx & web design / IT / AV @ St. Therese Institute of Faith and Mission, Bruno, SK, Canada :.
Last edit: 4 years 9 months ago by James Riley. Reason: formatting

Please Log in or Create an account to join the conversation.

Moderators: Mr. DamDũng Nguyễn Việt