Some Variables not possible in other Template by default

Situation:
I make my own templates and want the country names to be displayed completely.
Normaly it shows: “DE”
I want it to show: “Deutschland” (Germany)

In the PDF I solved it with

get_country_name(trans('cldr'), $quote->user_country)

But when I use it in the Web-View it throws this error:

Call to undefined function get_country_name()

Is there any workaround to also display in the Web-Template the complete country name?

Thanks in advance!

You need this in the controller

<?php $this->load->helper('country'); ?>

2 Likes

First, thanks for the help! After adding this into the controller it worked properly! :slight_smile:

I just edited the Thread-Topic to ask some more questions about variables which are not possible to set by default.

In the Web-Template I also want to display the quote_tax_rate_name and the quote_tax_rate

Can you help me with that aswell?
Thanks!

#EDIT: solved it with this code:

<?php foreach ($quote_tax_rates as $quote_tax_rate) : ?>
  <?php echo $quote_tax_rate->quote_tax_rate_name . ' ' . format_amount($quote_tax_rate->quote_tax_rate_percent); ?> %
<?php endforeach ?>
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.