На форуме 9558 тем, 76453 сообщений, 44667 участников
тема · 2 446 просмотров · 8 ответов

Как прописать отдельные стили для отображения валюты?

Дизайн, оформление и шаблоны
читают: 0 участников и 1 гость
порядок
17 фев 2016 12:30#1
Добрый день, валюта и цена на сайте заключены в один тег и стиль у них одинаковый http://joxi.ru/p2776OKS0xEYX2 Смотрится не очень, прямо скажем. Подскажите, пожалуйста, как можно сделать отдельный стиль для отображения наименования валюты?
17 фев 2016 16:42#2
В файле system/library/currency.php
Найти:
php
public function format($number, $currency = '', $value = '', $format = true) {
if ($currency && $this->has($currency)) {
$symbol_left = $this->currencies[$currency]['symbol_left'];
$symbol_right = $this->currencies[$currency]['symbol_right'];
$decimal_place = $this->currencies[$currency]['decimal_place'];
} else {
$symbol_left = $this->currencies[$this->code]['symbol_left'];
$symbol_right = $this->currencies[$this->code]['symbol_right'];
$decimal_place = $this->currencies[$this->code]['decimal_place'];

$currency = $this->code;
}

Заменить на
php
public function format($number, $currency = '', $value = '', $format = true) {
if ($currency && $this->has($currency)) {
$symbol_left = $this->currencies[$currency]['symbol_left'];
$symbol_right = '<span class="currency">'.$this->currencies[$currency]['symbol_right'].'</span>';
$decimal_place = $this->currencies[$currency]['decimal_place'];
} else {
$symbol_left = $this->currencies[$this->code]['symbol_left'];
$symbol_right = '<span class="currency">'.$this->currencies[$this->code]['symbol_right'].'</span>';
$decimal_place = $this->currencies[$this->code]['decimal_place'];

$currency = $this->code;
}


Потом назначить стили для класса "currency"
17 фев 2016 17:10#3
RoS написал(а): ↑В файле system/library/currency.php
Найти:
php
public function format($number, $currency = '', $value = '', $format = true) {
if ($currency && $this->has($currency)) {
$symbol_left = $this->currencies[$currency]['symbol_left'];
$symbol_right = $this->currencies[$currency]['symbol_right'];
$decimal_place = $this->currencies[$currency]['decimal_place'];
} else {
$symbol_left = $this->currencies[$this->code]['symbol_left'];
$symbol_right = $this->currencies[$this->code]['symbol_right'];
$decimal_place = $this->currencies[$this->code]['decimal_place'];

$currency = $this->code;
}

Заменить на
php
public function format($number, $currency = '', $value = '', $format = true) {
if ($currency && $this->has($currency)) {
$symbol_left = $this->currencies[$currency]['symbol_left'];
$symbol_right = '<span class="currency">'.$this->currencies[$currency]['symbol_right'].'</span>';
$decimal_place = $this->currencies[$currency]['decimal_place'];
} else {
$symbol_left = $this->currencies[$this->code]['symbol_left'];
$symbol_right = '<span class="currency">'.$this->currencies[$this->code]['symbol_right'].'</span>';
$decimal_place = $this->currencies[$this->code]['decimal_place'];

$currency = $this->code;
}


Потом назначить стили для класса "currency"


Спасибо. Все получилось!
18 фев 2016 13:01#4
RoS написал(а): ↑В файле system/library/currency.php
Найти:
php
public function format($number, $currency = '', $value = '', $format = true) {
if ($currency && $this->has($currency)) {
$symbol_left = $this->currencies[$currency]['symbol_left'];
$symbol_right = $this->currencies[$currency]['symbol_right'];
$decimal_place = $this->currencies[$currency]['decimal_place'];
} else {
$symbol_left = $this->currencies[$this->code]['symbol_left'];
$symbol_right = $this->currencies[$this->code]['symbol_right'];
$decimal_place = $this->currencies[$this->code]['decimal_place'];

$currency = $this->code;
}

Заменить на
php
public function format($number, $currency = '', $value = '', $format = true) {
if ($currency && $this->has($currency)) {
$symbol_left = $this->currencies[$currency]['symbol_left'];
$symbol_right = '<span class="currency">'.$this->currencies[$currency]['symbol_right'].'</span>';
$decimal_place = $this->currencies[$currency]['decimal_place'];
} else {
$symbol_left = $this->currencies[$this->code]['symbol_left'];
$symbol_right = '<span class="currency">'.$this->currencies[$this->code]['symbol_right'].'</span>';
$decimal_place = $this->currencies[$this->code]['decimal_place'];

$currency = $this->code;
}


Потом назначить стили для класса "currency"


Но теперь заказ приходит в таком виде
Товары:
1x amet dolor sit (Product 5) 100<span class="currency"> руб. </span>

Заказ итого:
Сумма: 100<span class="currency"> руб. </span>
Для заказов до 10000 р.: 490<span class="currency"> руб. </span>
Итого: 590<span class="currency"> руб. </span>
18 фев 2016 15:14#5
у вас проблема не в отдельном стили, а в шрифте на сайте который не поддерживает кириллицу. Поменяйте шрифт на другой, например Verdana и увидите как все теперь стало ровно.
18 фев 2016 15:32#6
Ален написал(а): ↑у вас проблема не в отдельном стили, а в шрифте на сайте который не поддерживает кириллицу. Поменяйте шрифт на другой, например Verdana и увидите как все теперь стало ровно.


Так вроде Arial... Почему он не поддерживается то?
18 фев 2016 16:34#7
oli413 написал(а): ↑Так вроде Arial... Почему он не поддерживается то?

покажите сайт.
20 фев 2016 11:51#9
Поменяла формат письма о заказе админу. Так что, думаю, вопрос закрыт. Все везде выглядит нормально)
сообщения 1–9 из 9
Чтобы ответить, войдите или зарегистрируйтесь.

Похожие темы