Я использую joomla 2.5 и добродетельмарт 2. Я попытался повторить скрипт, который собран из php. Итак, внутри файла корзины внутри функции foreach, которая проходит через каждый продукт, мне нужно сохранить идентификатор продукта, количество и цену продажи.
Я могу показать идентификатор продукта и количество следующим образом:
$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]
в значении?