Don't want to display price/unit in cart

  • Posts: 137
  • Thank you received: 2
11 years 8 months ago #123427

Hika 2.2.1, Joomla 3.1

Hi I've included the following at the end of product / listing_price to display a customized price / unit information.

<span font-weight="normal">
<?php
if(isset($this->row->product_weight) && bccomp($this->row->product_weight,0,3)){ 
                    $weight_price = $price->price_value_with_tax / $this->row->product_weight; 
                    echo JText::_('PRICE_SEPARATOR').'(entspricht '.$this->currencyHelper->format($weight_price,$price->price_currency_id).' pro '.JText::_($this->row->product_weight_unit).')'; 
                } 
    }
    echo JText::_('PRICE_END');
  }
    ?>
</span> 

This works fine on the category and product display, but won't work correct in the cart display. I would like to suppress the display of this in the cart. What code would I need to do so?

Last edit: 11 years 8 months ago by Jerome. Reason: [code] is nice

Please Log in or Create an account to join the conversation.

  • Posts: 26251
  • Thank you received: 4040
  • MODERATOR
11 years 8 months ago #123445

Hi,

Which cart ?
The product cart or the checkout cart ?

I think you can override the cart view in order to set a variable before the calls of the listing_price view. Something like

$this->displayWeightPrice = false;
And add a check in your part of code
if(isset($this->row->product_weight) && bccomp($this->row->product_weight,0,3) && (!isset($this->displayWeightPrice) || $this->displayWeightPrice)){
Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 137
  • Thank you received: 2
11 years 8 months ago #123472

works just perfect! Thanks so much!!!

Please Log in or Create an account to join the conversation.

Time to create page: 0.055 seconds
Powered by Kunena Forum