Checkout displayData $d

Phoca Cart - complex e-commerce extension
Picannick
Phoca Member
Phoca Member
Posts: 13
Joined: 10 May 2013, 15:50
Contact:

Checkout displayData $d

Post by Picannick »

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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47794
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Checkout displayData $d

Post by Jan »

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:

Code: Select all

$price  = new PhocacartPrice();
$priceP = $price->getPriceItems(...)
For b) you need to get the data from current product

Code: Select all

PhocacartProduct::getProduct(...)
Jan
If you find Phoca extensions useful, please support the project
Post Reply