[Skip to main content](#vessel-content)

#   Override shipping address, possible?

##

- **[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")**
- [![dyvel's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39996-dyvel "View dyvel's Profile") Topic Author
- [ Offline](/forum/user/39996-dyvel)

Less More

- Posts: 88
- Thank you received: 20
-
-

9 years 7 months ago -  9 years 7 months ago [\#265129](#265129) by [dyvel](/forum/user/39996-dyvel "View dyvel's Profile")  *[Override shipping address, possible?](/forum/31-development/889374-override-shipping-address-possible#265129 "-- HikaShop version -- : 3.0.0 -- Joomla version -- : 3.6.5  Hi  I've put together a custom shipping plugin. I would like to use the function onShippingDisplay to inject a custom shipping address as the users delivery address, but I don't know how to address those fields, if possible?  Any advice is appreciated.  Thanks")* was created by *[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")*

-- HikaShop version -- : 3.0.0
-- Joomla version -- : 3.6.5

Hi

I've put together a custom shipping plugin. I would like to use the function onShippingDisplay to inject a custom shipping address as the users delivery address, but I don't know how to address those fields, if possible?

Any advice is appreciated.

Thanks

Last edit: 9 years 7 months ago by [dyvel](/forum/user/39996-dyvel "View dyvel's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTM3NC1vdmVycmlkZS1zaGlwcGluZy1hZGRyZXNzLXBvc3NpYmxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

9 years 7 months ago [\#265130](#265130) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Override shipping address, possible?](/forum/31-development/889374-override-shipping-address-possible#265130 "-- HikaShop version -- : 3.0.0 -- Joomla version -- : 3.6.5  Hi  I've put together a custom shipping plugin. I would like to use the function onShippingDisplay to inject a custom shipping address as the users delivery address, but I don't know how to address those fields, if possible?  Any advice is appreciated.  Thanks")*

Hi,

You can't use the getShippingAddress to inject a custom shipping address as a normal shipping address.
The getShippingAddress allows you to completely replace the shipping address interfaces to only display your text.
So for example, you can store your address data in a custom field of the table "order", and in the getShippingAddress function you can just return the HTML of your address that you want to appear instead of the normal shipping address interface.
Or you could implement the onBeforeOrderCreate function and replace the shipping address fields in $order by your own data.
That way, the address would be replaced when the order is created and it would act like a normal shipping address, that you can edit in the order backend interface, etc.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTM3NC1vdmVycmlkZS1zaGlwcGluZy1hZGRyZXNzLXBvc3NpYmxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")**
- [![dyvel's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39996-dyvel "View dyvel's Profile") Topic Author
- [ Offline](/forum/user/39996-dyvel)

Less More

- Posts: 88
- Thank you received: 20
-
-

9 years 7 months ago [\#265148](#265148) by [dyvel](/forum/user/39996-dyvel "View dyvel's Profile")  Replied by *[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")* on topic *[Override shipping address, possible?](/forum/31-development/889374-override-shipping-address-possible#265148 "-- HikaShop version -- : 3.0.0 -- Joomla version -- : 3.6.5  Hi  I've put together a custom shipping plugin. I would like to use the function onShippingDisplay to inject a custom shipping address as the users delivery address, but I don't know how to address those fields, if possible?  Any advice is appreciated.  Thanks")*

onBeforeOrderCreate looks like the way to go. Thanks.

I can see I have selected shipping data in $order-&gt;shipping. I can see the content through &amp;$order-&gt;shipping but seem to access the content ? I was thinking of storing the data in a session variable, and then use that onBeforeOrderCreate.

Is it possible to access the data?

Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTM3NC1vdmVycmlkZS1zaGlwcGluZy1hZGRyZXNzLXBvc3NpYmxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")**
- [![dyvel's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39996-dyvel "View dyvel's Profile") Topic Author
- [ Offline](/forum/user/39996-dyvel)

Less More

- Posts: 88
- Thank you received: 20
-
-

9 years 7 months ago -  9 years 7 months ago [\#265162](#265162) by [dyvel](/forum/user/39996-dyvel "View dyvel's Profile")  Replied by *[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")* on topic *[Override shipping address, possible?](/forum/31-development/889374-override-shipping-address-possible#265162 "-- HikaShop version -- : 3.0.0 -- Joomla version -- : 3.6.5  Hi  I've put together a custom shipping plugin. I would like to use the function onShippingDisplay to inject a custom shipping address as the users delivery address, but I don't know how to address those fields, if possible?  Any advice is appreciated.  Thanks")*

How can I override users shipping address onBeforeOrderCreate?
I tried the following without luck:
Code:

function onBeforeOrderCreate(&amp;$order,&amp;$send_email) { $order-&gt;cart-&gt;shipping_address-&gt;address_lastname = 'Smith'; }

Last edit: 9 years 7 months ago by [dyvel](/forum/user/39996-dyvel "View dyvel's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTM3NC1vdmVycmlkZS1zaGlwcGluZy1hZGRyZXNzLXBvc3NpYmxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

9 years 7 months ago [\#265163](#265163) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Override shipping address, possible?](/forum/31-development/889374-override-shipping-address-possible#265163 "-- HikaShop version -- : 3.0.0 -- Joomla version -- : 3.6.5  Hi  I've put together a custom shipping plugin. I would like to use the function onShippingDisplay to inject a custom shipping address as the users delivery address, but I don't know how to address those fields, if possible?  Any advice is appreciated.  Thanks")*

Hello,

What do you exactly mean by "Is it possible to access the data?" ?
Note that the "onBeforeOrderCreate" trigger is launched during the "end" step of your checkout workflow.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTM3NC1vdmVycmlkZS1zaGlwcGluZy1hZGRyZXNzLXBvc3NpYmxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")**
- [![dyvel's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/39996-dyvel "View dyvel's Profile") Topic Author
- [ Offline](/forum/user/39996-dyvel)

Less More

- Posts: 88
- Thank you received: 20
-
-

9 years 7 months ago -  9 years 7 months ago [\#265220](#265220) by [dyvel](/forum/user/39996-dyvel "View dyvel's Profile")  Replied by *[dyvel](/forum/user/39996-dyvel "View dyvel's Profile")* on topic *[Override shipping address, possible?](/forum/31-development/889374-override-shipping-address-possible#265220 "-- HikaShop version -- : 3.0.0 -- Joomla version -- : 3.6.5  Hi  I've put together a custom shipping plugin. I would like to use the function onShippingDisplay to inject a custom shipping address as the users delivery address, but I don't know how to address those fields, if possible?  Any advice is appreciated.  Thanks")*

I mean the data that is stored in $order-&gt;shipping - I can see the data, but when I try to access it, I just get null/nothing

Last edit: 9 years 7 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile"). Reason: removing useless quote

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTM3NC1vdmVycmlkZS1zaGlwcGluZy1hZGRyZXNzLXBvc3NpYmxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

9 years 7 months ago [\#265245](#265245) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Override shipping address, possible?](/forum/31-development/889374-override-shipping-address-possible#265245 "-- HikaShop version -- : 3.0.0 -- Joomla version -- : 3.6.5  Hi  I've put together a custom shipping plugin. I would like to use the function onShippingDisplay to inject a custom shipping address as the users delivery address, but I don't know how to address those fields, if possible?  Any advice is appreciated.  Thanks")*

Hi,

$order-&gt;cart is only the content of the cart.
What you need to do is this :
get the address_id of the shipping address in that variable: $order-&gt;order_shipping_address_id
And then you can save the new data with the HikaShop address class like that: Code:

$shipping = new stdClass(); $shipping-&gt;address_id = $order-&gt;order_shipping_address_id; $shipping-&gt;address_lastname = 'smith'; $addressClass = hikashop_get('class.address'); $addressClass-&gt;save($shipping);

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTM3NC1vdmVycmlkZS1zaGlwcGluZy1hZGRyZXNzLXBvc3NpYmxlP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.054 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
