本文整理匯總了PHP中XLite\Core\Translation::translateWeightSymbol方法的典型用法代碼示例。如果您正苦於以下問題:PHP Translation::translateWeightSymbol方法的具體用法?PHP Translation::translateWeightSymbol怎麽用?PHP Translation::translateWeightSymbol使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XLite\Core\Translation
的用法示例。
在下文中一共展示了Translation::translateWeightSymbol方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: formatModifierWeight
/**
* Format modifier weight
*
* @param float $value Value
*
* @return string
*/
public static function formatModifierWeight($value)
{
return $value . ' ' . \XLite\Core\Translation::translateWeightSymbol();
}
示例2: getWeightSymbol
/**
* Get translated weight symbol
*
* @return string
*/
protected function getWeightSymbol()
{
return \XLite\Core\Translation::translateWeightSymbol();
}
示例3: getTestRatesSchema
/**
* Get fields for schema
*
* @return array
*/
protected function getTestRatesSchema()
{
$result = $this->schemaTestRates;
$fields = $this->getAvailableSchemaFields();
// Add separators
$separators = $this->getSchemaFieldsSubsections();
foreach ($separators as $k => $v) {
if (array_intersect($v, $fields)) {
$fields[] = $k;
}
}
// Add custom state fields
if (in_array(static::SCHEMA_FIELD_SRC_STATE, $fields)) {
$fields[] = static::SCHEMA_FIELD_SRC_CUSTOM_STATE;
}
if (in_array(static::SCHEMA_FIELD_DST_STATE, $fields)) {
$fields[] = static::SCHEMA_FIELD_DST_CUSTOM_STATE;
}
// Get list of schema fields
if ($fields) {
foreach ($result as $k => $v) {
if (!in_array($k, $fields)) {
unset($result[$k]);
} else {
if (self::SCHEMA_FIELD_WEIGHT === $k) {
$result[$k][self::SCHEMA_LABEL_PARAMS] = array('units' => \XLite\Core\Translation::translateWeightSymbol());
} elseif (self::SCHEMA_FIELD_SUBTOTAL === $k) {
$result[$k][self::SCHEMA_LABEL_PARAMS] = array('units' => \XLite::getInstance()->getCurrency()->getSymbol());
}
}
}
}
return $result;
}