check()) || config('bosettings.show_prices_guest') == "guest"; } /** * Format the sales unit according to configuration. * Used for blade directive @fmt_sellunit. * * @param mixed $expression * @return string */ public static function formatSellUnit($expression): string { if (config('bosettings.sell_unit_management') == "strict") { return !empty($expression) ? sprintf('/ %s', SellUnit::make($expression)->label) : ''; } return !empty($expression) ? sprintf('/ %s', $expression) : ''; } /** * Extract a title produced according to the theme configuration. * Used for blade directive @excerpt_product_title. * * @param string $expression * @param int|null $limit * @return string */ public static function excerptTitle(string $expression, $limit = null): string { $limit = $limit ?? config('theme.max_product_title_length'); return Str::limit($expression, $limit); } }