Jump to content

Ошибка Opencart 3


Go to solution Solved by Panda58dev,

Recommended Posts

Добрый день, подскажите что не так. 

Нашёл решение для двойки, для определённых группу покупателей, делать скидку в виде % на товар. 

 

Цитата

В файле \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

 

Подскажите куда смотреть, что не так? 

Link to comment
Share on other sites

в тройке форматирование валют чуть другое

строка будет

$data['special'] = $this->currency->format($this->tax->calculate($perc_price, $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);

 

Link to comment
Share on other sites

  • Solution

В /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']);

 

•=|KIᖇIᒪᒪ|=•

E-mail: panda58dev@inbox.ru
Telegram: @panda58dev

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...