shipping address country

  • Posts: 1119
  • Thank you received: 114
7 years 9 months ago #262830

Hi,

How can i get and show shipping address country during checkout?

I used this for name "$cart->shipping_address->address_firstname" but i am struggling with country and i get "array" insteed country name.

Thanks

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
7 years 9 months ago #262850

Hi,

You should take a look at the content of the variable :
us3.php.net/manual/fr/function.var-dump.php

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: 1119
  • Thank you received: 114
7 years 9 months ago #262951

Hi,

Jerome honestly, whenever i create new topic i hope someone else will answer it :lol:
You always give tips and a lot documentation and this is welcome but not exactly how could you do it. ...

It would take 3 min for u to give code example but insteed i will have now to spend 2 hours with trying. :D

No offense :)

Thanks

Last edit: 7 years 9 months ago by kyratn.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 9 months ago #262954

Hi,

Try something like that with the new checkout:

$this->cart_addresses = $this->checkoutHelper->getAddresses();
$address = $this->cart_addresses['data'][ $cart->cart_billing_address_id ];
echo $address->address_country;

Please understand that custom coding is not part of customer support.

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

  • Posts: 1119
  • Thank you received: 114
7 years 9 months ago #263061

Hi,

Thank you Nicolas. That did the trick. Looking into code i see that was doing it wrong.

I understand that custom coding is not part of customer support.
I am with hikashop almost for 2 years and i found a lot topics with custom code given which did help me and many other people. So few lines of code is 2 minutes for you...and in the future it will help other people.

Anyway. You always can just ignore it and allow other people not hika team members to answer it.

Thanks again.

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

Time to create page: 0.057 seconds
Powered by Kunena Forum