2004 Posts in 533 Topics by 435 members
E-Commerce Modules
SilverStripe Forums » E-Commerce Modules » Add Processing Fee if Paying By Credit Card
Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.
Moderators: martimiz, Nicolaas, Howard, Sean, Ryan M., biapar, Willr, Ingo, Jedateach, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 386 Views |
-
Add Processing Fee if Paying By Credit Card

12 September 2012 at 8:46pm
I am hoping someone might be able to give me some direction on how to make my checkout process apply a 3% fee only if the consumer is paying by credit card. There is a radio button for 'Invoice' or 'Credit Card' and if 'Credit Card' is selected I would like the cart to update with Javascript to show the new total.
I already have some other custom functions for different fees (eg insurance) but they are all applied irrespective of what payment method.
I am not sure how to get the SubTotal and Total functions available in the javascript function. I have used the
function updateForAjax(array &$js) {
...
$insurance = $subTotal * 0.08;
$insurance = DBField::create('Currency', $this->Insurance())->Nice();
$js[] = array('id' => $this->InsuranceID(), 'parameter' => 'innerHTML', 'value' => $insurance);
}
for the other custom functions, but not sure how to test what option is selected to determine if a fee should be applied or not. Or even if this is the way to do it.I am still pretty new to Silverstripe, so still trying to get my head around it.
Thanks.
Vic
| 386 Views | ||
|
Page:
1
|
Go to Top |

