first commit
This commit is contained in:
26
class/smarty_plugins/function.get_payment_method.php
Normal file
26
class/smarty_plugins/function.get_payment_method.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Smarty plugin
|
||||
* -------------------------------------------------------------
|
||||
* Type: function
|
||||
* Name: get_payment_method
|
||||
* Purpose: get a class representing payment method
|
||||
* -------------------------------------------------------------
|
||||
*/
|
||||
function smarty_function_get_payment_method($params, &$smarty)
|
||||
{
|
||||
$name = false;
|
||||
|
||||
extract($params);
|
||||
|
||||
$payment = Payment::getClass($name);
|
||||
|
||||
if (!$payment) {
|
||||
echo "Neexistující platebni metoda '{$name}'";
|
||||
}
|
||||
|
||||
if (!empty($assign)) {
|
||||
$smarty->assign($assign, $payment);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user