Hi,
Thank you for the detailed explanation, however I'm not sure I can see the issue. The price shown next to the product name includes all the add-ons from the price calculation plugin, which is confusing since those add-ons are also listed separately below.
This, I can agree.
We've fixed this in the next release of HikaShop (6.4.1). The base price next to the main product name will now show the original price before the price calculation formula was applied.
In the meantime, if you'd like to apply the fix right away, you can create a view override:
1. Go to HikaShop > Display > Views
2. Find `checkout / show_block_cart`
3. Click on it to create an override
4. Find this line (around line 259):
echo ' <span class="hikashop_product_base_price">' . strip_tags($this->getDisplayProductPrice($product, true)) . '</span>';
Replace it with:
echo ' <span class="hikashop_product_base_price">' . strip_tags($this->getDisplayProductPrice($product, true, true)) . '</span>';
Then, this requires a small change in the checkout view class. You can also edit the file `components/com_hikashop/views/checkout/view.html.php` and find the `getDisplayProductPrice` method (around line 442). Replace:
public function getDisplayProductPrice(&$product, $unit = false) {
with:
public function getDisplayProductPrice(&$product, $unit = false, $beforeCalculation = false) {
And add the following code right after the opening of the method (before `$previous_price_with_tax`):
$savedPrices = null;
if($beforeCalculation && !empty($product->price_calculation) && isset($product->price_calculation->price_before)) {
$savedPrices = $product->prices;
$product->prices = array();
foreach($savedPrices as $k => $price) {
$product->prices[$k] = clone $price;
if(isset($price->unit_price))
$product->prices[$k]->unit_price = clone $price->unit_price;
}
if(isset($product->prices[0]->unit_price)) {
$product->prices[0]->unit_price->price_value = $product->price_calculation->price_before;
if(isset($product->price_calculation->price_before_with_tax))
$product->prices[0]->unit_price->price_value_with_tax = $product->price_calculation->price_before_with_tax;
}
}
And at the end of the method, just before `return $ret;`, add:
if($savedPrices !== null)
$product->prices = $savedPrices;
Is this "the cart view does not display the prices clearly, as the different items are not properly separated" you were talking about ? Or are you talking about something else ?
Because on my end, I can see the different elements of the product clearly separated:
imgur.com/AttgHrl
If you're talking about something else, then maybe you could provide some screenshots to illustrate the problem ?