我正在将 VirtueMart 2.0.10 与 Joomla 一起使用!2.5.6,我的问题是每个产品的自动生成的 pdf 文档不包括我的自定义字段。我不是 php 专家,但我认为文件/components/com_virtuemart/views/productdetails/tmpl/default_pdf.php中的这些行与它有关,从第 145 行开始:
<?php // Product custom_fields TODO relation to Childs
if (!empty($this->product->customfields)) { ?>
<div class="product-fields">
<?php
$custom_title = null ;
foreach ($this->product->customfields as $field){
?><div style="display:inline-block;" class="product-field product-field-type-<?php echo $field->field_type ?>">
<?php if ($field->custom_title != $custom_title) { ?>
<span class="product-fields-title" ><strong><?php echo JText::_($field->custom_title); ?></strong></span>
<?php //echo JHTML::tooltip($field->custom_tip, $field->custom_title, 'tooltip.png');
} ?>
<span class="product-field-display"><?php echo $field->display ?></span>
<span class="product-field-desc"><?php echo jText::_($field->custom_field_desc) ?></span>
</div>
<?php
$custom_title = $field->custom_title;
} ?>
</div>
<?php
} // Product custom_fields END ?>
我测试了在上面的 if 语句之后添加一个 else 语句来回显一些文本,它执行了。所以显然没有自定义字段......但确实有......
我还没有发现其他人遇到这个问题,我认为这很奇怪,但我不认为我搞砸了。我在/components/com_virtuemart/views/productdetails/tmpl/default.php文件中做了一些更改。