display selected addresses during cart status

  • Posts: 26
  • Thank you received: 0
8 years 6 months ago #239410

-- HikaShop version -- : 2.6.4
-- Joomla version -- : 3.4.8

Hi,
I am trying to customize the cart_status view to display the addresses that customer selected for order,
I looked in other views to know how to display the address, I got this,

$addressClass = hikashop_get('class.address');
		
echo $addressClass->displayAddress($this->full_cart->fields,$this->full_cart->shipping_address,'address');
it worked for simple address fields, but the state and the country aren't displayed correctly (they are only displayed with word Array)
can you please assist me on this?

Last edit: 8 years 6 months ago by issa.mouawad.

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 6 months ago #239436

Hi,

You want to do like that:

$addressClass = hikashop_get('class.address');
$addresses = array('shipping_address'=>$this->full_cart->shipping_address);
$addressClass->loadZone($addresses);
echo $addressClass->displayAddress($this->full_cart->fields,$addresses['shipping_address'],'address');

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

  • Posts: 26
  • Thank you received: 0
8 years 6 months ago #239447

thank you,I did exactly as you suggested, but i actually didn't solve my problem,
the state and country are still being displayed by word "Array"

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

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
8 years 6 months ago #239458

Hi,

Ah yes, I had forgotten something. You need to add the line:

if(is_array($address->$namekey)) $address->$namekey = reset($address->$namekey);
before:
$zones[$address->$namekey] = $address->$namekey;
					$quoted_zones[$address->$namekey] = $this->database->Quote($address->$namekey);
in administrator/components/com_hikashop/classes/address.php and that code will work.
That modification will be in the next version of HikaShop.

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

  • Posts: 26
  • Thank you received: 0
8 years 6 months ago #239473

Thanks , Now it's solved :)

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

Time to create page: 0.058 seconds
Powered by Kunena Forum