Jump to content

Get shipping address in payment module


Recommended Posts

Hello!

 

We are creating new payment module, alongside with other cart information, we need to send the payment service provider shipping address of order.

 

Can someone tell me how can we get order shipping address in the payment module?

 

In php code, of course.

 

Thanks..

Edited by MKhve (see edit history)
Link to comment
Share on other sites

thanks

 

 

$address = new Address(intval($params['cart']->id_address_delivery));

 

this returns id of the address of corresponding user.

 

I need to get actual address(string value), as i guess i can get it from user information by id which is taken by code above, but don't know exact code which will request string value of address id.

Link to comment
Share on other sites

I assume you have a .tpl file for the module where you're sending a form of all the information across to the payment provider. If so, using the $smarty variable you've assigned for address above, send across the address in a string like this:

 


<input type="hidden" name="name" value="{$address->firstname} {$address->lastname}" />
<input type="hidden" name="address" value="{$address->address1}{if !empty($address->address2)}, {$address->address2}{/if}, {$address->city}" />
<input type="hidden" name="country" value="{$country->iso_code}" />

Link to comment
Share on other sites

Actually I have php file in new payment module folder and there is :

 

class newpamentmodule extends PaymentModule
{
//....
$shippingAddress =  "shipping address string"; // here i want to get order shipping address

//....
}

 

Here i want to assign shipping address (string value not just id) of order to variable $shippingAddress

 

Can you help me with this, i don't know how to "call" for shipping address string.

Edited by MKhve (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...