Jump to content
Sign in to follow this  
mseo

[HELP] Попытка вывести доп.поля в категорию - Undefined variable

Recommended Posts

Приветствую форумчани!

 

Была задача вывести в категорию доп. поля.

В карточке работает нормально, сделал по аналогии в категорию - но выдает ошибку

2020-01-17 0:22:59 - PHP Notice:  Undefined variable: entry_1 in /home/*/*/html/system/storage/modification/catalog/view/theme/electro/template/product/category.tpl on line 113
2020-01-17 0:22:59 - PHP Notice:  Undefined variable: entry_2 in /home/*/*/html/system/storage/modification/catalog/view/theme/electro/template/product/category.tpl on line 119
2020-01-17 0:22:59 - PHP Notice:  Undefined variable: entry_3 in /home/*/*/html/system/storage/modification/catalog/view/theme/electro/template/product/category.tpl on line 125

Не могу понять, где допустил ошибку. Помоги плиз найти

Код прикрепил

 

extra_fields_in_product.ocmod.xml

Share this post


Link to post
Share on other sites
<file path="catalog/view/theme/*/template/product/category.tpl">
        <operation error="log">
			<search>
				<![CDATA[
// обратите внимание сюда как выводиться description   и как выводите свои поля
					<div class="description"><?php echo $product['description']; ?></div>
				]]>
			</search>
			<add position="after"><![CDATA[
			<div class="loans-desc">
			<?php if($entry_1 && $entry_text_1) { ?>
				<div class="loans-desc-item">
					<div class="loans-desc-left"><?php echo $entry_1; ?>:</div>
					<div class="loans-desc-right"><?php echo $entry_text_1; ?></div>
				</div>
			<?php } ?>
			<?php if($entry_2 && $entry_text_2) { ?>
				<div class="loans-desc-item">
					<div class="loans-desc-left"><?php echo $entry_2; ?>:</div>
					<div class="loans-desc-right"><?php echo $entry_text_2; ?></div>
				</div>
			<?php } ?>
			<?php if($entry_3 && $entry_text_3) { ?>
				<div class="loans-desc-item">
					<div class="loans-desc-left"><?php echo $entry_3; ?>:</div>
					<div class="loans-desc-right"><?php echo $entry_text_3; ?></div>
				</div>
			<?php } ?>
			</div>
				]]>
			</add>
		</operation>
	</file>

 

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×

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.