Hi, we are using PhocaCart for a few weeks now and are more than happy with the functionality.
But now there is a problem, we cannot solve alone.
In the checkout we need to display the unitprice per kg. This was no problem in the items_grid.php where we used the base and baseformat values to calculate the price per kg.
But in the checkout in $d and therefore also in $v the values "base", "baseformat", "unit_amount" and "unit_unit" are not included, so I can find no way to calculate the unit price.
Can someone tell me, how I can get these values for each item in the checkout cart? Or where the $displayData is set for this view?
If it is possible, we would be happy not to overwrite a core file but only a layout.
Kind regards
Tanja
Checkout displayData $d
-
- Phoca Member
- Posts: 15
- Joined: 10 May 2013, 15:50
- Contact:
- Jan
- Phoca Hero
- Posts: 48402
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Checkout displayData $d
Hi,
a) "base" and "baseformat" are variables set in price class
b) "unit_amount" and "unit_unit" are variables stored in product database.
So, for the a) the price class needs to be set, for the b) the product data for current product needs to be asked.
So for a) you need to get the price variables with:
For b) you need to get the data from current product
Jan
a) "base" and "baseformat" are variables set in price class
b) "unit_amount" and "unit_unit" are variables stored in product database.
So, for the a) the price class needs to be set, for the b) the product data for current product needs to be asked.
So for a) you need to get the price variables with:
Code: Select all
$price = new PhocacartPrice();
$priceP = $price->getPriceItems(...)
Code: Select all
PhocacartProduct::getProduct(...)
If you find Phoca extensions useful, please support the project