27 lines
582 B
PHP
27 lines
582 B
PHP
<?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);
|
|
}
|
|
}
|