在我的prestashop商店中,我有两个变量per_sqft_price
和per_box_price
。 per_sqft_price之前使用货币($
)签名。我正在尝试打印这两个变量的乘积值。但是它总是打印0。
{assign var = per_sqft_price value = $product.price} {assign var = per_box_price value = $product.features[0].value} <meta itemprop="per_sqft_price" content="{$per_sqft_price|replace:'$':''}"/> {math equation = "x * y" x = $per_sqft_price y = $per_box_price }
[请帮助我如何解决此问题。在此先感谢
在我的prestashop商店中,我有两个变量per_sqft_price和per_box_price。 per_sqft_price之前使用货币($)签名。我正在尝试打印这两个变量的乘积值。但是...
使用$product.price_amount
而不是$product.price
,它会给出没有货币符号的数字价格输出。并且请确保$product.features[0].value
也为数字,因为它可能是字符串,可能仅包含文本。另外,您可以将intval
用于变量,例如:
尝试此代码: