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

Валюта, конверсия, неправильные итоги.


alexpst
 Share

Recommended Posts

Ув. форумчане! Прошу помощи в таком вопросе:

Есть магазин на ocStore 1.5.3.1

В его настройках 2 валюты - доллар и гривна, по умолчанию стоит гривна, у доллара курс = 1, у гривны 8.25. У доллара и у гривны по 2 знака после запятой. Учет в магазине ведется в долларах. Т.е. цены забиваются в долларах, а покупатель их видит в гривнах. Всё работает нормально и корректно кроме одной важной детали - неправильно считаются итоги. Приведу такой пример:

Цена товара в админке - 0.09 долларов (9 центов) - покупатель в карточке товара видит 0.74 грн. Это правильно (0.09х8.25) = 0.74

Теперь такая ситуация: пользователь покупает 24 единицы товара. Опенкарт считает такие итоги:

кол-во 24 цена 0.74 итого 17.82 грн. Но ведь это не правильно, итог должен быть 0.74х24=17.76

Происходит это потому, что опенкарт считает итоги так: 0.09х24х8.25=17.82 Т.е. он берет товар в долларах, умножает на кол-во и умножает на курс.

Ув. сообщество, подскажите, как подправить алгоритм подсчета, чтобы цена (уже переведенная в гривну) умножалась на кол-во.

Link to comment
Share on other sites


я покажу на примере корзины, все остальные места потрудитесь найти сами

catalog/controller/checkout/cart.php

// Display prices

if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {

$total = $this->currency->format($this->tax->calculate($product['total'], $product['tax_class_id'], $this->config->get('config_tax')));

$total = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax')), '', '', false);

$total = $this->currency->format($total * $product['quantity'], '', 1);

} else {

$total = false;

}

http://first.net23.net/index.php?route=checkout/cart

Link to comment
Share on other sites

  • 1 month later...

я покажу на примере корзины, все остальные места потрудитесь найти сами

catalog/controller/checkout/cart.php

// Display prices

if (($this->config->get('config_customer_price') && $this->customer->isLogged()) || !$this->config->get('config_customer_price')) {

$total = $this->currency->format($this->tax->calculate($product['total'], $product['tax_class_id'], $this->config->get('config_tax')));

$total = $this->currency->format($this->tax->calculate($product['price'], $product['tax_class_id'], $this->config->get('config_tax')), '', '', false);

$total = $this->currency->format($total * $product['quantity'], '', 1);

} else {

$total = false;

}

http://first.net23.n...e=checkout/cart

Спасибо, но итоговая сумма всех покупок в корзине отображается без учета этого фикса, по примеру топикстартера это будет так

кол-во 24 цена 0.74 итого 17.76 грн. Это правильно, но итог(сумма по всех заказанных товарам) должен быть 17.76, а есть 17.82 грн

Link to comment
Share on other sites


  • 1 year later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • 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.