VictorDiez Posted June 13, 2013 Share Posted June 13, 2013 Основная валюта - доллар. Вторая валюта - рубль. Курс рубля 8700. Есть цены в центах, соответсвенно в рублях получаются не круглые числа. Да и хождение наличности мелкой отсутствует. Надо округлять цену в рублях до сотен, например 6235 -> 6200 руб. или 3860 -> 3900 руб. кто знает где что менять? помогите! версия 1.5.4.1 round($price,-2); <<<<<<< решение как бы есть в факе и как бы его нет, так как не указано, где эта строка. Куплю адрес куда вставлять эту строку :D Link to comment Share on other sites More sharing options...
zubovd Posted June 14, 2013 Share Posted June 14, 2013 в шаблонах, все вхождения <?php echo $price; ?> заменить на <?php echo round($price,-2); ?> и <?php echo $product['price']; ?> , соответсвенно :) Link to comment Share on other sites More sharing options... zubovd Posted June 14, 2013 Share Posted June 14, 2013 в шаблонах, все вхождения <?php echo $price; ?> заменить на <?php echo round($price,-2); ?> и <?php echo $product['price']; ?> , соответсвенно :) А не замахаешься шаблоны править? system.library/currency.php строку $string .= number_format(round($value, (int)$decimal_place), (int)$decimal_place, $decimal_point, $thousand_point); заменить на $string .= number_format(round($value, -2), (int)$decimal_place, $decimal_point, $thousand_point); верняк:) 2 Link to comment Share on other sites More sharing options... VictorDiez Posted June 14, 2013 Author Share Posted June 14, 2013 :eek: Link to comment Share on other sites More sharing options... krumax Posted June 14, 2013 Share Posted June 14, 2013 модуль сможете написать такой? модуль замены одной строки? Link to comment Share on other sites More sharing options... VictorDiez Posted June 14, 2013 Author Share Posted June 14, 2013 модуль сможете написать такой? модуль замены одной строки? для ленивых мажоров) Link to comment Share on other sites More sharing options... vitya Posted June 14, 2013 Share Posted June 14, 2013 $string .= number_format(round($value, -2), (int)$decimal_place, $decimal_point, $thousand_point); отлично! только это (округление) нужно для рубля, а для доллара нет как будет выглядеть условие проверки валюты, например (RUB) ? Link to comment Share on other sites More sharing options... CODEONETEAM Posted June 14, 2013 Share Posted June 14, 2013 как будет выглядеть условие проверки валюты, например (RUB) ? Так: if ($currency == 'RUB') { $string .= number_format(round($value, -2), (int)$decimal_place, $decimal_point, $thousand_point); } else { $string .= number_format(round($value, (int)$decimal_place), (int)$decimal_place, $decimal_point, $thousand_point); } 4 Link to comment Share on other sites More sharing options... 4 weeks later... ygetko Posted July 10, 2013 Share Posted July 10, 2013 (edited) Вот за это спасибо! А что тут можно подправить что бы округлялась цена в рублях до 500 рублей? Напр. 8200=8000 8700=8500 8800=9000 Edited July 11, 2013 by afwollis Link to comment Share on other sites More sharing options... zubovd Posted July 10, 2013 Share Posted July 10, 2013 (edited) round($value, -3) :wink: Edited July 11, 2013 by afwollis Link to comment Share on other sites More sharing options... ygetko Posted July 11, 2013 Share Posted July 11, 2013 (edited) Пробовал, до 1000 округляет Edited July 11, 2013 by afwollis Link to comment Share on other sites More sharing options... zubovd Posted July 11, 2013 Share Posted July 11, 2013 (edited) прошу прощения, упустил что до 500 надо..попробуйте так round(($value/5),-2)*5 :) Edited July 11, 2013 by afwollis 1 Link to comment Share on other sites More sharing options... ygetko Posted July 11, 2013 Share Posted July 11, 2013 (edited) Спасибо, помогло!!! Edited July 11, 2013 by afwollis Link to comment Share on other sites More sharing options... 7 months later... angelShlesser Posted February 17, 2014 Share Posted February 17, 2014 А не замахаешься шаблоны править? system.library/currency.php строку $string .= number_format(round($value, (int)$decimal_place), (int)$decimal_place, $decimal_point, $thousand_point); заменить на $string .= number_format(round($value, -2), (int)$decimal_place, $decimal_point, $thousand_point); Что то найти не могу этот файл в корне. 1.5.5.1.1 Link to comment Share on other sites More sharing options... shoputils Posted February 17, 2014 Share Posted February 17, 2014 В каком корне? )) system/library Link to comment Share on other sites More sharing options... This topic is now closed to further replies. Share More sharing options... Followers 0 Go to topic listing Similar Content Округление итоговой цены в корзине By Dozent, November 29, 2020 9 replies 713 views Crist January 19 Проблема с округлением цен в opencart 3 By iler, December 8, 2022 3 replies 238 views vier December 8, 2022 Округление цен на товраы By Armouries, September 6, 2022 2 replies 262 views chukcha October 3, 2022 Округление итоговой суммы корзины Opencart 3 By Crist, January 14 1 reply 115 views Crist January 16 Подарочные сертификаты (округление суммы в админке) By AnnValder, December 3, 2022 2 replies 126 views AnnValder December 3, 2022 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Услуги Настройка и мелкая работа по уже существующему сайту [Решено] Округление цены до сотен (например 5762->5800 руб.) Покупателям Оплата дополнений физическими лицами Оплата дополнений юридическими лицами Политика возвратов Разработчикам Регламент размещения дополнений Регламент продаж и поддержки дополнений Виртуальный аккаунт автора Политика продвижения объявлений API каталога дополнений Урегулирование споров по авторским правам Полезная информация Публичная оферта Политика возвратов Политика конфиденциальности Платежная политика Политика Передачи Персональных Данных Политика прозрачности Последние дополнения Chameleon - Responsive & Multipurpose Opencart Template + Quick Start By 29aleksey Wayforpay API оплата для Opencart 2.3, 3.x By bogdan281989 TgMarket - Модуль интернет магазина в телеграмме. By Rassol2 ShowCase – Responsive / Multipurpose Opencart Template By octemplates Telnotification By Yevhenii_7777 × Existing user? Sign In Sign Up Shopping section Back Purchased extensions Invoices Whishlist Alternative Contacts Forums News ocStore Back Official site Demo ocStore 3.0.3.2 Demo ocStore 2.3.0.2.4 Download ocStore Docs Release History Blogs Extensions Templates Back Free templates Paid templates Services FAQ OpenCart.Pro Back Demo Buy Compare × 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. I accept
zubovd Posted June 14, 2013 Share Posted June 14, 2013 в шаблонах, все вхождения <?php echo $price; ?> заменить на <?php echo round($price,-2); ?> и <?php echo $product['price']; ?> , соответсвенно :) А не замахаешься шаблоны править? system.library/currency.php строку $string .= number_format(round($value, (int)$decimal_place), (int)$decimal_place, $decimal_point, $thousand_point); заменить на $string .= number_format(round($value, -2), (int)$decimal_place, $decimal_point, $thousand_point); верняк:) 2 Link to comment Share on other sites More sharing options... VictorDiez Posted June 14, 2013 Author Share Posted June 14, 2013 :eek: Link to comment Share on other sites More sharing options... krumax Posted June 14, 2013 Share Posted June 14, 2013 модуль сможете написать такой? модуль замены одной строки? Link to comment Share on other sites More sharing options... VictorDiez Posted June 14, 2013 Author Share Posted June 14, 2013 модуль сможете написать такой? модуль замены одной строки? для ленивых мажоров) Link to comment Share on other sites More sharing options... vitya Posted June 14, 2013 Share Posted June 14, 2013 $string .= number_format(round($value, -2), (int)$decimal_place, $decimal_point, $thousand_point); отлично! только это (округление) нужно для рубля, а для доллара нет как будет выглядеть условие проверки валюты, например (RUB) ? Link to comment Share on other sites More sharing options... CODEONETEAM Posted June 14, 2013 Share Posted June 14, 2013 как будет выглядеть условие проверки валюты, например (RUB) ? Так: if ($currency == 'RUB') { $string .= number_format(round($value, -2), (int)$decimal_place, $decimal_point, $thousand_point); } else { $string .= number_format(round($value, (int)$decimal_place), (int)$decimal_place, $decimal_point, $thousand_point); } 4 Link to comment Share on other sites More sharing options... 4 weeks later... ygetko Posted July 10, 2013 Share Posted July 10, 2013 (edited) Вот за это спасибо! А что тут можно подправить что бы округлялась цена в рублях до 500 рублей? Напр. 8200=8000 8700=8500 8800=9000 Edited July 11, 2013 by afwollis Link to comment Share on other sites More sharing options... zubovd Posted July 10, 2013 Share Posted July 10, 2013 (edited) round($value, -3) :wink: Edited July 11, 2013 by afwollis Link to comment Share on other sites More sharing options... ygetko Posted July 11, 2013 Share Posted July 11, 2013 (edited) Пробовал, до 1000 округляет Edited July 11, 2013 by afwollis Link to comment Share on other sites More sharing options... zubovd Posted July 11, 2013 Share Posted July 11, 2013 (edited) прошу прощения, упустил что до 500 надо..попробуйте так round(($value/5),-2)*5 :) Edited July 11, 2013 by afwollis 1 Link to comment Share on other sites More sharing options... ygetko Posted July 11, 2013 Share Posted July 11, 2013 (edited) Спасибо, помогло!!! Edited July 11, 2013 by afwollis Link to comment Share on other sites More sharing options... 7 months later... angelShlesser Posted February 17, 2014 Share Posted February 17, 2014 А не замахаешься шаблоны править? system.library/currency.php строку $string .= number_format(round($value, (int)$decimal_place), (int)$decimal_place, $decimal_point, $thousand_point); заменить на $string .= number_format(round($value, -2), (int)$decimal_place, $decimal_point, $thousand_point); Что то найти не могу этот файл в корне. 1.5.5.1.1 Link to comment Share on other sites More sharing options... shoputils Posted February 17, 2014 Share Posted February 17, 2014 В каком корне? )) system/library Link to comment Share on other sites More sharing options... This topic is now closed to further replies. Share More sharing options... Followers 0 Go to topic listing Similar Content Округление итоговой цены в корзине By Dozent, November 29, 2020 9 replies 713 views Crist January 19 Проблема с округлением цен в opencart 3 By iler, December 8, 2022 3 replies 238 views vier December 8, 2022 Округление цен на товраы By Armouries, September 6, 2022 2 replies 262 views chukcha October 3, 2022 Округление итоговой суммы корзины Opencart 3 By Crist, January 14 1 reply 115 views Crist January 16 Подарочные сертификаты (округление суммы в админке) By AnnValder, December 3, 2022 2 replies 126 views AnnValder December 3, 2022 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Услуги Настройка и мелкая работа по уже существующему сайту [Решено] Округление цены до сотен (например 5762->5800 руб.) Покупателям Оплата дополнений физическими лицами Оплата дополнений юридическими лицами Политика возвратов Разработчикам Регламент размещения дополнений Регламент продаж и поддержки дополнений Виртуальный аккаунт автора Политика продвижения объявлений API каталога дополнений Урегулирование споров по авторским правам Полезная информация Публичная оферта Политика возвратов Политика конфиденциальности Платежная политика Политика Передачи Персональных Данных Политика прозрачности Последние дополнения Chameleon - Responsive & Multipurpose Opencart Template + Quick Start By 29aleksey Wayforpay API оплата для Opencart 2.3, 3.x By bogdan281989 TgMarket - Модуль интернет магазина в телеграмме. By Rassol2 ShowCase – Responsive / Multipurpose Opencart Template By octemplates Telnotification By Yevhenii_7777
VictorDiez Posted June 14, 2013 Author Share Posted June 14, 2013 :eek: Link to comment Share on other sites More sharing options...
krumax Posted June 14, 2013 Share Posted June 14, 2013 модуль сможете написать такой? модуль замены одной строки? Link to comment Share on other sites More sharing options...
VictorDiez Posted June 14, 2013 Author Share Posted June 14, 2013 модуль сможете написать такой? модуль замены одной строки? для ленивых мажоров) Link to comment Share on other sites More sharing options...
vitya Posted June 14, 2013 Share Posted June 14, 2013 $string .= number_format(round($value, -2), (int)$decimal_place, $decimal_point, $thousand_point); отлично! только это (округление) нужно для рубля, а для доллара нет как будет выглядеть условие проверки валюты, например (RUB) ? Link to comment Share on other sites More sharing options...
CODEONETEAM Posted June 14, 2013 Share Posted June 14, 2013 как будет выглядеть условие проверки валюты, например (RUB) ? Так: if ($currency == 'RUB') { $string .= number_format(round($value, -2), (int)$decimal_place, $decimal_point, $thousand_point); } else { $string .= number_format(round($value, (int)$decimal_place), (int)$decimal_place, $decimal_point, $thousand_point); } 4 Link to comment Share on other sites More sharing options...
ygetko Posted July 10, 2013 Share Posted July 10, 2013 (edited) Вот за это спасибо! А что тут можно подправить что бы округлялась цена в рублях до 500 рублей? Напр. 8200=8000 8700=8500 8800=9000 Edited July 11, 2013 by afwollis Link to comment Share on other sites More sharing options...
zubovd Posted July 10, 2013 Share Posted July 10, 2013 (edited) round($value, -3) :wink: Edited July 11, 2013 by afwollis Link to comment Share on other sites More sharing options... ygetko Posted July 11, 2013 Share Posted July 11, 2013 (edited) Пробовал, до 1000 округляет Edited July 11, 2013 by afwollis Link to comment Share on other sites More sharing options... zubovd Posted July 11, 2013 Share Posted July 11, 2013 (edited) прошу прощения, упустил что до 500 надо..попробуйте так round(($value/5),-2)*5 :) Edited July 11, 2013 by afwollis 1 Link to comment Share on other sites More sharing options... ygetko Posted July 11, 2013 Share Posted July 11, 2013 (edited) Спасибо, помогло!!! Edited July 11, 2013 by afwollis Link to comment Share on other sites More sharing options... 7 months later... angelShlesser Posted February 17, 2014 Share Posted February 17, 2014 А не замахаешься шаблоны править? system.library/currency.php строку $string .= number_format(round($value, (int)$decimal_place), (int)$decimal_place, $decimal_point, $thousand_point); заменить на $string .= number_format(round($value, -2), (int)$decimal_place, $decimal_point, $thousand_point); Что то найти не могу этот файл в корне. 1.5.5.1.1 Link to comment Share on other sites More sharing options... shoputils Posted February 17, 2014 Share Posted February 17, 2014 В каком корне? )) system/library Link to comment Share on other sites More sharing options... This topic is now closed to further replies. Share More sharing options... Followers 0 Go to topic listing Similar Content Округление итоговой цены в корзине By Dozent, November 29, 2020 9 replies 713 views Crist January 19 Проблема с округлением цен в opencart 3 By iler, December 8, 2022 3 replies 238 views vier December 8, 2022 Округление цен на товраы By Armouries, September 6, 2022 2 replies 262 views chukcha October 3, 2022 Округление итоговой суммы корзины Opencart 3 By Crist, January 14 1 reply 115 views Crist January 16 Подарочные сертификаты (округление суммы в админке) By AnnValder, December 3, 2022 2 replies 126 views AnnValder December 3, 2022 Recently Browsing 0 members No registered users viewing this page. Последние темы Последние дополнения Последние новости All Activity Home Услуги Настройка и мелкая работа по уже существующему сайту [Решено] Округление цены до сотен (например 5762->5800 руб.)
ygetko Posted July 11, 2013 Share Posted July 11, 2013 (edited) Пробовал, до 1000 округляет Edited July 11, 2013 by afwollis Link to comment Share on other sites More sharing options...
zubovd Posted July 11, 2013 Share Posted July 11, 2013 (edited) прошу прощения, упустил что до 500 надо..попробуйте так round(($value/5),-2)*5 :) Edited July 11, 2013 by afwollis 1 Link to comment Share on other sites More sharing options... ygetko Posted July 11, 2013 Share Posted July 11, 2013 (edited) Спасибо, помогло!!! Edited July 11, 2013 by afwollis Link to comment Share on other sites More sharing options... 7 months later... angelShlesser Posted February 17, 2014 Share Posted February 17, 2014 А не замахаешься шаблоны править? system.library/currency.php строку $string .= number_format(round($value, (int)$decimal_place), (int)$decimal_place, $decimal_point, $thousand_point); заменить на $string .= number_format(round($value, -2), (int)$decimal_place, $decimal_point, $thousand_point); Что то найти не могу этот файл в корне. 1.5.5.1.1 Link to comment Share on other sites More sharing options... shoputils Posted February 17, 2014 Share Posted February 17, 2014 В каком корне? )) system/library Link to comment Share on other sites More sharing options... This topic is now closed to further replies. Share More sharing options... Followers 0 Go to topic listing Similar Content Округление итоговой цены в корзине By Dozent, November 29, 2020 9 replies 713 views Crist January 19 Проблема с округлением цен в opencart 3 By iler, December 8, 2022 3 replies 238 views vier December 8, 2022 Округление цен на товраы By Armouries, September 6, 2022 2 replies 262 views chukcha October 3, 2022 Округление итоговой суммы корзины Opencart 3 By Crist, January 14 1 reply 115 views Crist January 16 Подарочные сертификаты (округление суммы в админке) By AnnValder, December 3, 2022 2 replies 126 views AnnValder December 3, 2022 Recently Browsing 0 members No registered users viewing this page.
ygetko Posted July 11, 2013 Share Posted July 11, 2013 (edited) Спасибо, помогло!!! Edited July 11, 2013 by afwollis Link to comment Share on other sites More sharing options...
angelShlesser Posted February 17, 2014 Share Posted February 17, 2014 А не замахаешься шаблоны править? system.library/currency.php строку $string .= number_format(round($value, (int)$decimal_place), (int)$decimal_place, $decimal_point, $thousand_point); заменить на $string .= number_format(round($value, -2), (int)$decimal_place, $decimal_point, $thousand_point); Что то найти не могу этот файл в корне. 1.5.5.1.1 Link to comment Share on other sites More sharing options...
shoputils Posted February 17, 2014 Share Posted February 17, 2014 В каком корне? )) system/library Link to comment Share on other sites More sharing options... This topic is now closed to further replies. Share More sharing options... Followers 0
Recommended Posts