Skip to main content

display selected addresses during cart status

10 years 5 months ago - 10 years 5 months ago #239410 by issa.mouawad
-- 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,
Code:
$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: 10 years 5 months ago by issa.mouawad.

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

10 years 5 months ago #239436 by nicolas
Hi,

You want to do like that:
Code:
$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.

10 years 5 months ago #239447 by issa.mouawad
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.

10 years 5 months ago #239458 by nicolas
Hi,

Ah yes, I had forgotten something. You need to add the line:
Code:
if(is_array($address->$namekey)) $address->$namekey = reset($address->$namekey);
before:
Code:
$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.

10 years 5 months ago #239473 by issa.mouawad
Thanks , Now it's solved :)

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

Time to create page: 0.085 seconds
Powered by Kunena Forum