function smartyModifierPP($product, $mode, $wrap = true) { $key = 'pp_' . $mode; if (is_array($product)) { if (isset($product[$key])) { $text = $product[$key]; } } if (!isset($text)) { $properties = PP::getProductProperties($product); if (isset($properties[$key])) { $text = $properties[$key]; } } return isset($text) && $text != '' ? $wrap === true ? PP::wrap($text, $key) : ($wrap == 'left' ? ' ' . $text : ($wrap == 'right' ? $text . ' ' : $text)) : ''; }