Joomla JDOC: включить. Как избавиться от пустого текстового узла - PullRequest
0 голосов
/ 16 декабря 2011

Когда я вставляю модуль minicart в свой шаблон, пустой текстовый узел добавляется в HTML-код. Вопрос в том, как избавиться от этого текстового узла.

Код в моем файле index.php

</div><jdoc:include type="modules" name="minicart" />

Вот мой minicart.tpl.php

<?php if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' ); ?>
<div id="cartPanel" class="main">
        <div id="cartWrapper">
            <?php if(!$vmMinicart) { ?>
                <a href="index.php?page=shop.cart&amp;option=com_virtuemart" target="_self">
                    <?php } ?>
                    <div id="cartIcon"><img alt="Корзина" src="/templates/denas/images/bag-icon.png" /></div>
                    <div id="cartInfo"><span>
                        <?php 
                            $qnt = 0;
                                // Loop through each row and build the table
                                foreach( $minicart as $cart ) {         
                                    foreach( $cart as $attr => $val ) {
                                    // Using this we make all the variables available in the template
                                    // translated example: $this->set( 'product_name', $product_name );
                                        $this->set( $attr, $val );
                                    }
                                    if(!$vmMinicart) { // Build Minicart
                                        ?>
                                        <?php $qnt = $qnt + $cart['quantity']; 
                                    }
                                }
                                echo $VM_LANG->_('PHPSHOP_PRODUCT_COUNT_NAME').': '.$qnt.' '.$VM_LANG->_('PHPSHOP_PRODUCT_FORM_UNIT_DEFAULT');?>
                    </span>
                    <span>
                    <?php  if ($total_price != '') echo $VM_LANG->_('PHPSHOP_PRODUCTS_PAYS').': '.$total_price; ?>
                    </span></div>
                </a>
        </div>
    </div>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...