Comrada Posted November 26, 2012 Posted November 26, 2012 Есть ИМ, в нём две валюты: российский рубль(RUR) и белорусский(BYR), по умолчанию стоит RUR, потому что товар закупается в России, в настройках валют устанавливаю между ними соответствующий курс. Как сделать так, чтобы вновь пришедшим на сайт пользователям цены отображались в BYR? Если в настройках просто изменить валюту по умолчанию на BYR, то нужно будет и цены вбивать в BYR, а привязка идёт именно к RUR, потому что курс BYR всё время плавает, а товар покупается за RUR. Не запутанно написано? )) Просто, когда пользователь первый раз заходит, то ему цены отображаются в RUR, переключатель валют я со страницы убираю, он не нужен, а как переключить отображение цен во второстепенной валюте, не пойму. Есть ли штатные средства установки отображения в выбранной валюте? Не хочется лезть в код Share this post Link to post Share on other sites More sharing options...
Dzianis Yurevich Posted December 3, 2012 Posted December 3, 2012 Штатных средств нет. Нужно реврайтить метод getDefaultCurrency() класса Currency. Какая версия престы? Напишу как это сделать 1 Share this post Link to post Share on other sites More sharing options...
Vnature Posted January 12, 2013 Posted January 12, 2013 ДД! Как поменять default currency в Prestashop 1.5.3.1? Не могу найти такой опции... Share this post Link to post Share on other sites More sharing options...
Vnature Posted January 12, 2013 Posted January 12, 2013 Нашел в Localization... А русский язык все равно не встает... Share this post Link to post Share on other sites More sharing options...
ellite Posted January 16, 2013 Posted January 16, 2013 Нашел в Localization... А русский язык все равно не встает... Скачай с оф. сайта русский язык, в архиве ru.gzip лежит еще один архив ru - вот его и импортируй (локализация / переводы / импортировать язык вручную) Share this post Link to post Share on other sites More sharing options...
xcandlelight Posted January 23, 2013 Posted January 23, 2013 Штатных средств нет. Нужно реврайтить метод getDefaultCurrency() класса Currency. Какая версия престы? Напишу как это сделать Если не очень трудно, напишите пожалуйста для Престы 1.5.2.0, ну оооочень надо, товары покупаются в долларах а продаются в рублях - бьюсь над решением задачи. Share this post Link to post Share on other sites More sharing options...
gluck Posted March 3, 2014 Posted March 3, 2014 Откопаю стюардессу 1.2.5 — подскажете то же самое? Share this post Link to post Share on other sites More sharing options...
Dark62 Posted March 10, 2014 Posted March 10, 2014 Штатных средств нет. Нужно реврайтить метод getDefaultCurrency() класса Currency. Какая версия престы? Напишу как это сделать если можно, напишите пожалуйста для Престы 1.5.6.2, никак ниемогу решить задачу. Share this post Link to post Share on other sites More sharing options...
gefest Posted June 19, 2014 Posted June 19, 2014 напишите, пожалуйста, как это сделать в 1.6.0.6 Share this post Link to post Share on other sites More sharing options...
Kerm Posted June 19, 2014 Posted June 19, 2014 Чуток изучил темку, там везде в классах и в модулях идут такие строчки: $id_currency = (int)Validate::isLoadedObject($context->currency) ? $context->currency->id : Configuration::get('PS_CURRENCY_DEFAULT'); По идее если поменять на $id_currency = 2; строчку, т.е. подставить ID той валюты, какая нужна, будет внешне так как Вам нужно, но не известно как на это отреагирует корзина, и в какой валюте в корзине будет стоимость заказа и валюты и будет ли там все правильно. Вот в этих файлах поменяйте, посмотрите будет ли так как нужно: prestashop\classes\Carrier.php prestashop\classes\Currency.php prestashop\classes\module\Module.php prestashop\classes\PaymentModule.php prestashop\classes\Product.php prestashop\controllers\front\ProductController.php prestashop\modules\blocklayered\blocklayered.php prestashop\modules\loyalty\LoyaltyModule.php prestashop\modules\referralprogram\referralprogram.php prestashop\modules\referralprogram\ReferralProgramModule.php Share this post Link to post Share on other sites More sharing options...
C4acTbe Posted August 19, 2014 Posted August 19, 2014 Вот есть тема с этой же проблемой:http://www.prestashop.com/forums/topic/147918-solved-different-currencies-in-frontend-and-backend/ В файле Tools.php папки classes поправил строку: $currency = Currency::getCurrencyInstance(Configuration::get('PS_CURRENCY_DEFAULT')); на: $currency = Currency::getCurrencyInstance((int)('1')); где ('1') номер нужной валюты для фронта из админки(можно посмотреть в админке в табличке валют) У меня преста 1,6 и это решение работает. 1 Share this post Link to post Share on other sites More sharing options...
cosmoll Posted May 7, 2017 Posted May 7, 2017 You can buy an extension for PrestaShop or you can do it yourself, fix just two lines of code. So, open the file /classes/tools.php and find this (twice): Currency::getCurrencyInstance((int)$cookie->id_currency); And replace it to Currency::getCurrencyInstance(N); where N is an id of currency (1, 2, 3 etc.). That's all. Don't forget to save the file. Tested with PrestaShop 1.6. Share this post Link to post Share on other sites More sharing options...
livem1 Posted April 27, 2019 Posted April 27, 2019 А чтобы для престы 1.7 такое сделать, есть у кого информация? Share this post Link to post Share on other sites More sharing options...
morikoff Posted December 29, 2021 Posted December 29, 2021 On 4/27/2019 at 6:01 PM, livem1 said: А чтобы для престы 1.7 такое сделать, есть у кого информация? тема ещё такая есть Share this post Link to post Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now