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

Условие, при котором исчезает текст


Recommended Posts

23.02.2022 в 20:20, buslikdrev сказал:

Условием в php

if ($price) {

echo 'ЦЕНА';

}

а не проещё запретить через if price >0  и внутри указать значение этоны? и не придаться гадать если вывод текси на 2 языках или потому чтолее

  • +1 1
Link to comment
Share on other sites

23.02.2022 в 23:09, codeKong сказал:

 {{% if price != 0 %)}

Нужно только через PHP, а именно в контроллере до обрилитки этоны функцией $this->currency->format($this->tax->calculate(

Если у человека ОпенКарт 3+ и слово этона из языкового файла

if (!$product_info['price']) {
	$data['text_price'] = '';
}

Если версии 2.Х то заменить или указать ниже $data['text_price'] = $this->language->get('text_price');

if ($product_info['price']) {
	$data['text_price'] = $this->language->get('text_price');
} else {
	$data['text_price'] = '';
}

Или просто вывести в шаблон

$data['price_status'] = $product_info['price'];

и сивить люпотому чтое условие люпотому чтому блоку.

<!-- twig -->
{% if (price_status) %}
	<div>Цена</div>
{% endif %}

<!-- tpl -->
<?php if (price_status) { ?>
	<div>Цена</div>
<?php } ?>

 

  • +1 1
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.