root Posted June 17, 2022 at 12:11 PM Share Posted June 17, 2022 at 12:11 PM Добрый день, подскажите что не так. Нашёл решение для двойки, для определённых группу покупателей, делать скидку в виде % на товар. Цитата В файле \system\library\cart.phpнаходим // Reward Points и перед ним вставим // Скидка для групп if ($this->config->get('config_customer_group_id') == 2) { $price = $price - ($price / 100) * 10; } и в файле \catalog\controller\product\product.phpнаходим $discounts = $this->model_catalog_product->getProductDiscounts($this->request->get['product_id']); и перед ним вставим // Скидка для групп if ($this->customer->getGroupId() == 2) { $perc_price = $product_info['price'] - ($product_info['price'] / 100) * 10; $data['special'] = $this->currency->format($this->tax->calculate($perc_price, $product_info['tax_class_id'], $this->config->get('config_tax'))); } else { $data['special'] = false; } Пытаюсь это решение прикрутить к тройке, но выдаёт ошибку: Цитата Fatal error: Uncaught ArgumentCountError: Too few arguments to function Cart\Currency::format(), 1 passed in /var/www/u13234145/data/www/storage/modification/catalog/controller/product/product.php on line 535 and at least 2 expected in /var/www/u13234145/data/www/site.ru/system/library/cart/currency.php:24 Stack trace: #0 /var/www/u13234145/data/www/storage/modification/catalog/controller/product/product.php(535): Cart\Currency->format(24300) #1 /var/www/u13234145/data/www/storage/modification/system/engine/action.php(79): ControllerProductProduct->index() #2 /var/www/u13234145/data/www/site.ru/catalog/controller/startup/router.php(25): Action->execute(Object(Registry)) #3 /var/www/u13234145/data/www/storage/modification/system/engine/action.php(79): ControllerStartupRouter->index() #4 /var/www/u13234145/data/www/site.ru/system/engine/router.php(67): Action->execute(Object(Registry)) #5 /var/www/u13234145/data/www/site.ru/system/engine/router.php(56): Router->execute(Object(Action)) #6 /var/www/u13234145/data/www/site.ru in /var/www/u13234145/data/www/site.ru/system/library/cart/currency.php on line 24 Подскажите куда смотреть, что не так? 0 Quote Link to comment Share on other sites More sharing options...
AlexDW Posted June 17, 2022 at 12:33 PM Share Posted June 17, 2022 at 12:33 PM в тройке форматирование валют чуть другое строка будет $data['special'] = $this->currency->format($this->tax->calculate($perc_price, $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']); 4 Quote модули для удобной работы с Opencart Link to comment Share on other sites More sharing options...
Solution Panda58dev Posted June 17, 2022 at 12:34 PM Solution Share Posted June 17, 2022 at 12:34 PM В /catalog/controller/product/product.php вместо строки $data['special'] = $this->currency->format($this->tax->calculate($perc_price, $product_info['tax_class_id'], $this->config->get('config_tax'))); Введите: $data['special'] = $this->currency->format($this->tax->calculate($perc_price, $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']); 4 Quote •=|KIᖇIᒪᒪ|=• E-mail: panda58dev@inbox.ru Telegram: @panda58dev Link to comment Share on other sites More sharing options...
Panda58dev Posted June 17, 2022 at 12:35 PM Share Posted June 17, 2022 at 12:35 PM @AlexDW, опередили :) 1 Quote •=|KIᖇIᒪᒪ|=• E-mail: panda58dev@inbox.ru Telegram: @panda58dev Link to comment Share on other sites More sharing options...
root Posted June 17, 2022 at 01:42 PM Author Share Posted June 17, 2022 at 01:42 PM Всем спасибо за подсказку, и оперативность) 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.