public function formatTemplate($amount, array $data)
    {
        $placeholders = array();

        foreach (array_keys($data) as $key) {
            $placeholders["%$key"] = $key;
        }

        $formatted = gplcart_string_replace($data['template'], $placeholders, $data);
        return $amount < 0 ? "-$formatted" : $formatted;
    }