Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/249.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 价格未显示在前端virtuemart上_Php_Mysql_Joomla3.0_Virtuemart - Fatal编程技术网

Php 价格未显示在前端virtuemart上

Php 价格未显示在前端virtuemart上,php,mysql,joomla3.0,virtuemart,Php,Mysql,Joomla3.0,Virtuemart,在升级joomla和virtuemart 3.0.6价格未显示在前端之后,我已经升级了joomla和virtuemart,我不知道我的代码和virtuemart配置出了什么问题。 我已经把我的代码贴在这里显示价格 if ($this->show_prices == '1') { if ($product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and !$product-&

在升级joomla和virtuemart 3.0.6价格未显示在前端之后,我已经升级了joomla和virtuemart,我不知道我的代码和virtuemart配置出了什么问题。 我已经把我的代码贴在这里显示价格

if ($this->show_prices == '1') {

            if ($product->prices['salesPrice']<=0 and VmConfig::get ('askprice', 1) and  !$product->images[0]->file_is_downloadable) {

                echo JText::_ ('COM_VIRTUEMART_PRODUCT_ASKPRICE');
            }
            //todo add config settings
            //echo $this->showBasePrice;
            if ($this->showBasePrice) {

                echo $this->currency->createPriceDiv ('basePrice', 'COM_VIRTUEMART_PRODUCT_BASEPRICE', $product->prices);
                echo $this->currency->createPriceDiv ('basePriceVariant', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_VARIANT', $product->prices);

            }
            echo $this->currency->createPriceDiv ('variantModification', 'COM_VIRTUEMART_PRODUCT_VARIANT_MOD', $product->prices);
            if (round($product->prices['basePriceWithTax'],$this->currency->_priceConfig['salesPrice'][1]) != $product->prices['salesPrice']) {

                echo '<div class="price-crossed" >' . $this->currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $product->prices) . "</div>";
            }
            if (round($product->prices['salesPriceWithDiscount'],$this->currency->_priceConfig['salesPrice'][1]) != $product->prices['salesPrice']) {

                echo $this->currency->createPriceDiv ('salesPriceWithDiscount', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT', $product->prices);
            }
            echo $this->currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices);
            if ($product->prices['discountedPriceWithoutTax'] != $product->prices['priceWithoutTax']) {
                echo $this->currency->createPriceDiv ('discountedPriceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $product->prices);
            } else {

                echo $this->currency->createPriceDiv ('priceWithoutTax', 'Price :  ', $product->prices);
            }
            echo $this->currency->createPriceDiv ('discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $product->prices);
            echo $this->currency->createPriceDiv ('taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $product->prices);
            $unitPriceDescription = JText::sprintf ('COM_VIRTUEMART_PRODUCT_UNITPRICE', $product->product_unit);
            echo $this->currency->createPriceDiv ('unitPrice', $unitPriceDescription, $product->prices);
        } ?>
if($this->show_prices==“1”){
如果($product->prices['salesPrice']图像[0]->文件可下载){
echo JText::((“COM_VIRTUEMART_PRODUCT_ASKPRICE”);
}
//todo添加配置设置
//echo$this->showBasePrice;
如果($this->showBasePrice){
echo$this->currency->createPriceDiv('basePrice'、'COM\u VIRTUEMART\u PRODUCT\u basePrice'、$PRODUCT->prices);
echo$this->currency->createPriceDiv('basePriceVariant'、'COM\u VIRTUEMART\u PRODUCT\u BASEPRICE\u VARIANT'、$PRODUCT->prices);
}
echo$this->currency->createPriceDiv('variantModification','COM\u VIRTUEMART\u PRODUCT\u VARIANT\u MOD',$PRODUCT->prices);
如果(四舍五入($product->prices['basePriceWithTax'],$this->currency->u priceConfig['salesPrice'][1])!=$product->prices['salesPrice']){
回显“”。$this->currency->createPriceDiv('basePriceWithTax','COM\u VIRTUEMART\u PRODUCT\u BASEPRICE\WITHTAX','$PRODUCT->prices');
}
如果(四舍五入($product->prices['salesPriceWithDiscount'],$this->currency->u priceConfig['salesPrice'][1])!=$product->prices['salesPrice']){
echo$this->currency->createPriceDiv('salepricewithdiscount'、'COM\u VIRTUEMART\u PRODUCT\u saleprice\u without\u DISCOUNT'、$PRODUCT->prices);
}
echo$this->currency->createPriceDiv('salesPrice','COM\u VIRTUEMART\u PRODUCT\u salesPrice',$PRODUCT->prices);
如果($product->prices['PRESSENTEDPRICES WITHOUT TAX']!=$product->prices['prices WITHOUT TAX']){
echo$this->currency->createPriceDiv('discountedpricewithout TAX'、'COM\u VIRTUEMART\u PRODUCT\u saleprice\u WITHOUT TAX'、$PRODUCT->prices);
}否则{
echo$this->currency->createPriceDiv('pricewithout tax','Price:',$product->prices);
}
echo$this->currency->createPriceDiv('deffentamount'、'COM\u VIRTUEMART\u PRODUCT\u折扣\u AMOUNT'、$PRODUCT->prices);
echo$this->currency->createPriceDiv('taxAmount','COM\u VIRTUEMART\u PRODUCT\u TAX\u AMOUNT',$PRODUCT->prices);
$unitPriceDescription=JText::sprintf('COM\u VIRTUEMART\u PRODUCT\u UNITPRICE',$PRODUCT->PRODUCT\u unit);
echo$this->currency->createPriceDiv('unitPrice',$unitPriceDescription,$product->prices);
} ?>

请任何人检查此“给我解决方案”以了解此问题,我完全不喜欢此问题

我在更新vm和joomla时也遇到过同样的问题,但经过大量搜索,我找到了解决方案,它对我有效

我必须遵循3到4个步骤

1. you have to update your vm tables through control panel
 Go to tools and migration->DB Tools
 under DB Tools there is option for Install/update vm  tables click on it and update vm tables structure.

2. After upgrading just tables called vm shopergroups and check field **custom_price_display** set to all field **0**
我已附上显示正确字段的图像


你可以试试这个我知道这会帮你找到你的解决方案

你有没有试过逐行检查并找出失败的地方?它甚至进入了
if($this->show\u prices==“1”)的内部吗{
?为了理智起见,
'1
'不应该只是
1
,因为你比较的是一个整数而不是一个字符串吗?除非那个字段是一个字符串而不是一个整数。我在胡说。是的,我已经试过了,所有这些1都很好,但我不知道出了什么问题。..var_dump($product->prices);如果它有正确的值,则显示有问题。然后开始逐行添加echos以跟踪代码流,这样您就可以看到它停止的位置。