Get $amount, but without prefix

  • Posts: 359
  • Thank you received: 24
  • Hikaserial Standard Hikashop Business
3 years 11 months ago #327203

-- HikaShop version -- : 4.4.0
-- Joomla version -- : 3.9.23
-- PHP version -- : 7.4

Hi

I'm making some changes in the Order Creation Notification e-mail and would like to display the total amount like $amount, but without the currency prefix - is this possible?

Kind regards
Thomas

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
3 years 11 months ago #327207

It sure is.
You can use the tag {VAR:order.order_full_price}
However, this might display the price with more decimals than you want.
So a better solution might be:

<?php echo round($data->cart->order_full_price,2); ?>

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

  • Posts: 359
  • Thank you received: 24
  • Hikaserial Standard Hikashop Business
3 years 11 months ago #327243

Great!
And it works!

I tried the same on the override of banktransfer_end.php, but with no result.

Tried both of these:
<?php echo JText::_($this->order_full_price);?>
<?php echo round($data->cart->order_full_price,2); ?>

Any hints? :-)

Regards
Thomas

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

  • Posts: 4747
  • Thank you received: 644
  • MODERATOR
3 years 11 months ago #327268

Hello,

This is because the data isn't arranged the same every time.
In order to have what you required, don't forget that you can add a "var_dump(this)" in order to see your available data.
Note : Don't do this on an website in production phase on a page that customer can reached, because this display sometime lots of data.

Here, for what you required I think this will fit your expectations :

echo $this->order->order_full_price; echo ' '.$this->currency->currency_symbol;

Regards

Last edit: 3 years 11 months ago by Philip.

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

  • Posts: 359
  • Thank you received: 24
  • Hikaserial Standard Hikashop Business
3 years 11 months ago #327305

Perfect!

Thank you :-)

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

Time to create page: 0.058 seconds
Powered by Kunena Forum