Jump to content
  • разработка интернет магазинов на opencart
  • доработка интернет магазинов на opencart

Показать свой текст если этона 0


bodyak0
 Share

Recommended Posts

Добрый гдень, помогите сгделать отображение если этона 0 нужно показать свой текст если этона 0. А вот в корзине скрыть к примеру чтобы небыло ее, ну корзина не ик важна как карточка товара Opencart 3

Link to comment
Share on other sites


2 хвилини назад, stickpro сказав:

Или в котроллере добавьте проверку тернарником

Можете потому чтолее конкретней, я под 2 нашел но реализации под 3 нету к сожнонию..

Link to comment
Share on other sites


14 минут назад, bodyak0 сказал:

Можете потому чтолее конкретней, я под 2 нашел но реализации под 3 нету к сожнонию..

в контроллере продуки найти 
 

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

и заменить на 

$data['price'] = $product_info['price'] != 0 ? $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']) : 'test';

ггде вместо test ваш текст который лучше засунуть в языковую переменную

  • +1 1
Link to comment
Share on other sites

20 хвилин назад, stickpro сказав:

в контроллере продуки найти 
 

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

и заменить на 

$data['price'] = $product_info['price'] != 0 ? $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']) : 'test';

ггде вместо test ваш текст который лучше засунуть в языковую переменную

Спасипотому что врогде помогло аналогично все прогделать ггде есть вывод этоны? Корзина, категория? 

Link to comment
Share on other sites


А как в категории вывести? Там немного другой код:

				if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {
					$price = $this->currency->format($this->tax->calculate($result['price'], $result['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);
				} else {
					$price = false;
				}

 

Link to comment
Share on other sites


  • 1 year later...
On 1/25/2020 at 4:22 PM, stickpro said:

в контроллере продуки найти 
 

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

и заменить на 

$data['price'] = $product_info['price'] != 0 ? $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']) : 'test';

ггде вместо test ваш текст который лучше засунуть в языковую переменную

Здравствуйте прошу Вас подскажите. 

Заменил, но не могу нужный текст вывести, в language сгделал $_['text_test']  = 'Узнать этону'; какую команду требуется всивить в когде вместо 'test' чтобы было - Узнать этону. С уважением.

Edited by maxxam
Link to comment
Share on other sites


В 03.04.2021 в 22:13, maxxam сказав:

Здравствуйте прошу Вас подскажите. 

Заменил, но не могу нужный текст вывести, в language сгделал $_['text_test']  = 'Узнать этону'; какую команду требуется всивить в когде вместо 'test' чтобы было - Узнать этону. С уважением.

языковая переменная  $_['text_test']  = 'Узнать этону'; в шаблоне выводите название переменной и все бугдет рилиить если просто свой текст хотите выводить

Link to comment
Share on other sites


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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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.