Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/293.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 在prestashop中显示价格_Php_Content Management System_Prestashop_Smarty_Prestashop 1.6 - Fatal编程技术网

Php 在prestashop中显示价格

Php 在prestashop中显示价格,php,content-management-system,prestashop,smarty,prestashop-1.6,Php,Content Management System,Prestashop,Smarty,Prestashop 1.6,我使用的是prestashop 1.6,在我的前台办公室,当用户未登录时,产品价格不会显示出来,我在谷歌搜索了所有地方,并在后台尝试了不同的解决方案,但没有任何效果 这是我的模板中的代码 {if !$priceDisplay} {convertPrice price=$product.price} {else} {convertPrice price=$product.price_tax_exc} {/if} 我尝试转储price内容

我使用的是prestashop 1.6,在我的前台办公室,当用户未登录时,产品价格不会显示出来,我在谷歌搜索了所有地方,并在后台尝试了不同的解决方案,但没有任何效果

这是我的模板中的代码

      {if !$priceDisplay}
      {convertPrice price=$product.price}
      {else}
      {convertPrice price=$product.price_tax_exc}
      {/if}
我尝试转储price内容,但当用户未登录时,其中没有任何内容


我的目标是显示价格,即使对于未在管理面板中登录的用户,也要转到客户/组,并为所有组启用显示价格。问题似乎在于

你所说的“价格内容”是什么意思(什么变量)?你在哪里做的?在模板中或在
convertPrice
plugin中?我说的是'price=$product.price',我直接在产品图片后将其转储到模板中,我的意思是,在所有条件之外,我也转储了“$product”,它向我显示了除价格
price=$product之外的所有产品信息。在
convertPrice
之后,价格将为空。因此,您需要确保有
$product.PRICEXXX
值,然后才能将其传递给
convertPrice
函数。如果没有,则在将
$product
分配给时,需要在适当的位置搜索它们view@r_a_f你能告诉我在哪里搜索吗,我已经阅读了/class/Product.php,并在其中做了一些修改,搜索价格,但什么都没有发生,当我转储产品{$Product |@var_dump}时,它会显示一个数组(size=64)在price项中,当用户未登录时,我有“'price'=>boolean false”,但如果用户登录,我会得到“'price'=>float 48384”,我已经这样做了,并尝试了所有的管理面板技巧,但它们都不起作用,这就是为什么我尝试直接编辑php代码的原因,所以你能告诉我从哪里开始pleaseOk,那你能解释一下你想在哪一页上得到价格吗?它是产品页面还是产品列表页面?用户在单击产品之前和之后都会获得产品列表页面,因此我想在产品列表中显示价格:product-list-item.tpl在product-list.tpl中我有{include file='./product list item.tpl'product=$product}'我已经转储了$product,我得到了:C:\wamp64\www\local.test\tools\smarty\sysplugins\smarty\u internal\u templatebase.php(157):eval()'d代码:55:boolean false(当用户记录笔记时)和C:\wamp64\www\local.test\tools\smarty\sysplugins\smarty\u internal\u templatebase.php(157):eval()'d代码:55:float(当用户连接基本上说来,我认为您需要深入研究Product.php类方法priceCalculation(),它可能会引导您使用SpecificPrice类getSpecificPrice方法。但坦率地说,这是一种奇怪的行为,所以问题也会出现在克劳普课堂上。我的目标是展示价格,让你知道……;)我应该编辑产品类还是继承它