How to echo the mini address in checkOut Status Section!

  • Posts: 129
  • Thank you received: 0
7 years 7 months ago #267526

-- HikaShop version -- : 3.0.1

hi,
i need some string to echo the cart shipping address in the last step of checkout section right before the user goes to bank gateway,
may main goal is to show the user something like this:

This Order will be delivered to {shipping name} on {Shipping mini address} with phone number : {shipping phone}
This Order will be delivered with {Shipping method} with {shipping cost} to you.

i think the best way is to somehow customize the Show_Block_Status file.
i know where and how to make changes i only need the strings to echo the :

  1. shipping name
  2. Shipping mini address
  3. shipping phone
  4. Shipping method
  5. shipping cost

i'm really running out of time, and i know i have to hire some one and it takes time.
but i'll appreciate it it any one can give me the string or an example or any help on this case.
i can only make it up to him $

Thanks !

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

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

Hi,

You can do var_dump on checkout helper to see all string you are looking for.

var_dump($cart = $this->checkoutHelper->getCart());

1 and 4 is already loaded in default show_block_status view. Just check the code and you will see this code below:
if(!empty($cart->shipping)) {
		$names = array();
		foreach($cart->shipping as $shipping) {
			$names[] = $shipping->shipping_name;
		}
		$array[] = JText::sprintf('HIKASHOP_SHIPPING_METHOD_CHOSEN', '<span class="label label-info">'.implode('</span> <span class="label label-info">', $names).'</span>');
	}

2. Not sure how to get full address but as example to get address street, city and post code:
$address = $cart->shipping_address->address_street.'<br>'.$cart->shipping_address->address_city.'<br>'.$cart->shipping_address->address_post_code;
echo $address;

3. To get phone:
$phone = $cart->shipping_address->address_telephone;
echo $phone;

5. To get cost (this should be added after code for 1 and 4):
echo $shipping->shipping_price_with_tax;

I just did quick view in our file and copy paste code here as we done some similar modifications to that file.

Hope that helps.

You should wait for hika devs answer. They will give you more help then me :)

Thanks

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

  • Posts: 129
  • Thank you received: 0
7 years 7 months ago #267547

Hi Keyratn,
the string all works like a charm, Thanks for your fast help bro.

can i ask u some more ?
1)
echo $shipping->shipping_price_with_tax;
shows the price like 20.0000 $ i wan it to show 20$ instead.

2) i need this three strings too : www.hikashop.com/forum/checkout/889825-d...unt-in-the-cart.html

i really appreciate your help already bro :-) <3

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

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

Hi,

1. You can use :
echo floatval($shipping->shipping_price_with_tax);

2. Please understand that we're here to provide help to users, and we can give hints to developers regarding HikaShop-specific functions but we're not here to teach you programing nor to do your programing for you.

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

  • Posts: 129
  • Thank you received: 0
7 years 7 months ago #267874

1. Thanks!
2. okay, sorry for my insists !

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

Time to create page: 0.070 seconds
Powered by Kunena Forum