Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

domtermo

Newbie
  
  • Posts

    19
  • Joined

  • Last visited

domtermo's Achievements

Apprentice

Apprentice (3/14)

  • First Post
  • Collaborator
  • Conversation Starter
  • Week One Done
  • One Month Later

Recent Badges

0

Reputation

  1. Подскажите пожалуйста код для конвертации прямо в шаблоне без контроллера. Интересно конкретно для модуля latest.
  2. Может кто в курсе почему вторая цена одинакова на все товары и конвертируется с последнего товара? Касается всех модулей кроме product.
  3. вы попробуйте так number_format(round($price_by, -3), 0, '.', ' ') Большое спасибо! Работает!
  4. Всё, спасибо за помощь, разобрался.В product.tpl <?php if (($this->currency->getCode())!='BYR') { echo ' / '. number_format($price_by, 0, '.', ' ') . ' rub';} ?> В product.php функция конвертации. Осталось округлить до тысяч. Не подскажите что прописать в number_format для округления до 1 000. В currency.php прописано if ($currency == 'BYR') { $string .= number_format(round($value, -3), (int)$decimal_place, $decimal_point, $thousand_point); } else { $string .= number_format(round($value, (int)$decimal_place), (int)$decimal_place, $decimal_point, $thousand_point); } цена всё равно 4 493 600 (к примеру)
  5. В том то и дело, что делал. Но вторая цена почему то принимает значение первой цены. if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); $this->data['price_usd'] = $product_info['price']; } else { $this->data['price'] = false; $this->data['price_usd'] = false; } Может Вы где нибудь в другом месте прописывали конвертацию? Потому как судя по коду price_usd принимает обычную цену.
  6. Не выходит.. Цена сразу 0. Подытожим. Если в конфиге прописывать $this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); $this->data['price_byr'] = $product_info['price']; } else { $this->data['price'] = false; $this->data['price_byr'] = false; То второй цене присваивается значение первой цены, т.е. , отображаются 2 одинаковые цены. Поэтому в конфиге прописал if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); $this->data['price_2'] = "(".round($this->currency->convert($product_info['price'], 'EUR', 'BYR'), '0')." руб.)"; } else { $this->data['price'] = false; } В шаблоне <?php echo $price_2; ?> Если пишу в шаблоне <?php echo number_format((double)$price_2 , 0 , '.' , ' '); ?> То price_2 вообще не отображается, а отображается 0. Не могу въехать..
  7. Поставил Ничего не поменялось.. Видимо срабатывет только для первой цены. Почему не распространяется на вторую?
  8. а где в настройке валют руб. ? Может я не правильно выразился. Я имел в виду, что у меня к примеру цена выглядит 12345000, а хотелось бы 12 345 000 .
  9. Всё, удалось вывести 2 цену. А проблема была в том, что в файле product.tpl <div class="price"><?php echo $text_price; ?> <?php if (!$special) { ?> <?php echo $price; ?> ВОТ ТУТ Я ЗАБЫЛ ДОБАВИТЬ <?php echo $price_byr; ?> <?php } else { ?> <span class="price-old"><?php echo $price; ?><?php echo ' ($'. round($price_byr,0) . ') '; ?></span> <span class="price-new"><?php echo $special; ?><?php echo ' ($'. round($special_byr,0) . ') '; ?></span> <?php } ?> <br /> <?php if ($tax) { ?> <span class="price-tax"><?php echo $text_tax; ?> <?php echo $tax; ?></span><br /> <?php } ?> <?php if ($points) { ?> <span class="reward"><small><?php echo $text_points; ?> <?php echo $points; ?></small></span><br /> <?php } ?> <?php if ($discounts) { ?> <br /> <div class="discount"> <?php foreach ($discounts as $discount) { ?> <?php echo sprintf($text_discount, $discount['quantity'], $discount['price']); ?><?php echo ' ($'. round($discount['price_byr'],0) . ') '; ?><br /> <?php } ?> </div> Теперь вылезла другая проблема. Как у тебя реализованы пробелы в стоимости с б. рублях?
  10. Переменную изменил. Всё равно одна цена в евро(( if ($currency == 'BYR') А вот тут если можно поподробней)) Это в файле /public_html/system/library/currency.php ? Что туда добавить? В настройках евро стоит по умолчанию, BYR включен, конвертация в админке правильная. Переключатель валют давно уже удалил.
  11. Блин, проделал всё как написано: /public_html/catalog/view/theme/default/template/product/product.tpl <div class="price"><?php echo $text_price; ?> <?php if (!$special) { ?> <?php echo $price; ?> <?php } else { ?> <span class="price-old"><?php echo $price; ?><?php echo ' ($'. round($price_byr,0) . ') '; ?></span> <span class="price-new"><?php echo $special; ?><?php echo ' ($'. round($special_byr,0) . ') '; ?></span> <?php } ?> <br /> <?php if ($tax) { ?> <span class="price-tax"><?php echo $text_tax; ?> <?php echo $tax; ?></span><br /> <?php } ?> <?php if ($points) { ?> <span class="reward"><small><?php echo $text_points; ?> <?php echo $points; ?></small></span><br /> <?php } ?> <?php if ($discounts) { ?> <br /> <div class="discount"> <?php foreach ($discounts as $discount) { ?> <?php echo sprintf($text_discount, $discount['quantity'], $discount['price']); ?><?php echo ' ($'. round($discount['price_byr'],0) . ') '; ?><br /> <?php } ?> </div> /public_html/catalog/controller/product/product.php if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) { $this->data['price'] = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))); $this->data['price_'] = $product_info['price']; } else { $this->data['price'] = false; $this->data['price_byr'] = false; } if ((float)$product_info['special']) { $this->data['special'] = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $this->data['special'] = false; } if ($this->config->get('config_tax')) { $this->data['tax'] = $this->currency->format((float)$product_info['special'] ? $product_info['special'] : $product_info['price']); } else { $this->data['tax'] = false; } $discounts = $this->model_catalog_product->getProductDiscounts($this->request->get['product_id']); $this->data['price_'] = $this->currency->convert($product_info['price'], 'EUR', 'BYR'); $this->data['discounts'] = array(); foreach ($discounts as $discount) { $this->data['discounts'][] = array( 'quantity' => $discount['quantity'], 'price' => $this->currency->format($this->tax->calculate($discount['price'], $product_info['tax_class_id'], $this->config->get('config_tax'))) ); } Цена как было в евро, так и осталась :| . Блин не врубаюсь почему. Может когда я удалял из шаблона смену валюты нечаянно удалил функцию конвертации? И ещё вопросик: Переменные должны быть разными?
  12. Не получается вывести вторую цену. Вот что пишу в catalog/view/theme/default/template/product/product.tpl Вот что добавляю в catalog/controller/product/product.php Цена по умолчанию ЕВРО, нужно так же вывести цену в бел.рублях. В админке евро 1, BYR конвертируется правильно. Почему не работает? Сайт
Guest
×
  • Create New...

Important Information

On our site, cookies are used and personal data is processed to improve the user interface. To find out what and what personal data we are processing, please go to the link. If you click "I agree," it means that you understand and accept all the conditions specified in this Privacy Notice.