Back to PhocacartSize class

Method getSizeFormat

public
getSizeFormat
(mixed $value, mixed $type = 'size')

Method getSizeFormat - Source code

public function getSizeFormat($value, $type = 'size')
{
    $suffix = '';
    if ($value > 0) {
        switch ($type) {
            case 'weight':
                $suffix = $this->p->get('unit_weight');
                break;
            case 'volume':
                $suffix = $this->p->get('unit_volume');
                break;
            case 'size':
            default:
                $suffix = $this->p->get('unit_size');
                break;
        }
        return $this->roundSize($value) . ' ' . $suffix;
    }
    return false;
}