41 lines
988 B
PHP
41 lines
988 B
PHP
<?php
|
|
|
|
namespace Helpers;
|
|
|
|
class StringFormatter
|
|
{
|
|
public static function productTitle()
|
|
{
|
|
return function ($template, $context, $args, $source) {
|
|
$productTitle = $context->get($args);
|
|
$parts = explode("(", $productTitle);
|
|
|
|
return trim($parts[0]);
|
|
};
|
|
}
|
|
|
|
public static function adminOrderLabel()
|
|
{
|
|
return function ($template, $context, $args, $source) {
|
|
$label = $context->get($args);
|
|
if (substr($label, 0, 21) === "Select if this person") {
|
|
return "Caretaker is authorized";
|
|
}
|
|
|
|
if ($label === "SESSpromoid") {
|
|
return "Promotion ID";
|
|
}
|
|
|
|
if ($label === "SESSpromotion_description") {
|
|
return "Promotion Description";
|
|
}
|
|
|
|
if ($label === "SESScoupon_code") {
|
|
return "Coupon Code";
|
|
}
|
|
|
|
return $label;
|
|
};
|
|
}
|
|
}
|