有同样的问题。但我必须只显示价格。所以最快的方法是在customfields.php中更改sql select语句
Joomla 2.5 中 Virtuemart 2.0 管理员/components/com_virtuemart/models/customfields.php 第 548 行的路径
public function getProductCustomsFieldRelatedProducts($product)
只改变
$query=
和
'SELECT C.`virtuemart_custom_id` , `custom_parent_id` , `admin_only` , `custom_title` , `custom_tip` , C.`custom_value`
AS value, `custom_field_desc` , `field_type` , `is_list` , `is_hidden` , C.`published` , field.`virtuemart_customfield_id` ,
field.`custom_value`, field.`custom_param`, price.`product_price`, field.`ordering`
FROM `#__virtuemart_customs` AS C
LEFT JOIN `#__virtuemart_product_customfields` AS field ON C.`virtuemart_custom_id` = field.`virtuemart_custom_id`
LEFT JOIN `#__virtuemart_product_prices` AS price ON
field.`custom_value` = price.`virtuemart_product_id`
Where field.`virtuemart_product_id` ='.(int)$product->virtuemart_product_id.' and `field_type` = "R"';
毕竟在 559 行更改
$field->custom_price
至
$field->product_price
最后......在产品描述的模板视图中插入下面的代码以显示相关产品的价格
<?php echo $field->product_price ?>