我使用joomla 2.5和virtuemart 2.我試圖迴應一個腳本,它是從PHP構建的。 那麼經過每個產品的foreach函數裏面的cart文件我需要保存到一個可變的產品id,數量和銷售價格。virtmart購物車中產品的回聲價格
我可以顯示產品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]
的價值呢?
謝謝你的幫助!正確答案:$ product-> product_price –