【发布时间】:2016-06-11 10:16:30
【问题描述】:
我使用joomla 2.5 和mercurymart 2。我试图回显一个由php 构建的脚本。 因此,在 foreach 函数内的购物车文件中,我需要将每个产品保存到可变的产品 ID、数量和销售价格中。
我可以这样显示产品编号和数量:
$wantedproductid = $product->virtuemart_product_id;
$wantedproductquantity = $product->quantity;
但我对价格有疑问。我回应了$this,我明白了:
VirtueMartCart Object
(
[products] => Array
(
[812] => stdClass Object
(
[virtuemart_manufacturer_id] => 11
[slug] => hill-s-puppy-healthy-development-large-breed-koutavia-anaptyksi-kotopoulo-11kg
[published] => 1
...
...
[pricesUnformatted] => Array
(
[basePrice] => 70.6
[basePriceWithTax] => 0
[discountedPriceWithoutTax] => 60.31
[salesPrice] => 60.31
[taxAmount] => 0
[salesPriceWithDiscount] => 60.31
[discountAmount] => 57.4
[priceWithoutTax] => 70.6
[subTotalProducts] => 0
[2Diff] => -9.585
[812] => Array
(
[costPrice] => 63.90000
[basePrice] => 63.9
[basePriceVariant] => 63.9
[basePriceWithTax] => 0
[discountedPriceWithoutTax] => 54.32
[priceBeforeTax] => 63.9
[salesPrice] => 54.32
[taxAmount] => 0
[salesPriceWithDiscount] => 54.32
[salesPriceTemp] => 54.32
[unitPrice] => 0
[discountAmount] => 14.99
[priceWithoutTax] => 63.9
[variantModification] => 0
...
...
我需要的是例如这个值:[salesPrice] => 54.32
如何将[salesPrice] 保存在一个值中?
【问题讨论】:
标签: php joomla virtuemart