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

#   onHikashopBeforeDisplayView in checkout address

##

- **[kaya](/forum/user/25605-kaya "View kaya's Profile")**
- [![kaya's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/vacation.jpg)](/forum/user/25605-kaya "View kaya's Profile") Topic Author
- [ Offline](/forum/user/25605-kaya)

Less More

- Posts: 120
- Thank you received: 2
-
-
- [](http://arasjoomla.ir)
-

8 years 2 weeks ago -  8 years 2 weeks ago [\#299850](#299850) by [kaya](/forum/user/25605-kaya "View kaya's Profile")  *[onHikashopBeforeDisplayView in checkout address](/forum/27-checkout/896106-onhikashopbeforedisplayview-in-checkout-address#299850 "-- HikaShop version -- : 4.0.0 -- Joomla version -- : 3.8.10 -- PHP version -- : 7  Hi dear 1: I need developing custom hikashop plugin an using onHikashopBeforeDisplayView trigger for display my data so I need if view is checkout address part display my data but can't found which code using in onHikashopBeforeDisplayView for recognition address view. How can do it? 2: If add custom text input in checkout form by using onHikashopBeforeDisplayView or onCheckoutStepDisplay after submit checkout form which plugin trigger I can get my input data? thank you.")* was created by *[kaya](/forum/user/25605-kaya "View kaya's Profile")*

-- HikaShop version -- : 4.0.0
-- Joomla version -- : 3.8.10
-- PHP version -- : 7

Hi dear
1: I need developing custom hikashop plugin an using onHikashopBeforeDisplayView trigger for display my data so I need if view is checkout address part display my data but can't found which code using in onHikashopBeforeDisplayView for recognition address view. How can do it?
2: If add custom text input in checkout form by using onHikashopBeforeDisplayView or onCheckoutStepDisplay after submit checkout form which plugin trigger I can get my input data?
thank you.

Last edit: 8 years 2 weeks ago by [kaya](/forum/user/25605-kaya "View kaya's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5NjEwNi1vbmhpa2FzaG9wYmVmb3JlZGlzcGxheXZpZXctaW4tY2hlY2tvdXQtYWRkcmVzcz90bXBsPW1hcmtkb3du) 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
-
-

8 years 2 weeks ago [\#299861](#299861) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[onHikashopBeforeDisplayView in checkout address](/forum/27-checkout/896106-onhikashopbeforedisplayview-in-checkout-address#299861 "-- HikaShop version -- : 4.0.0 -- Joomla version -- : 3.8.10 -- PHP version -- : 7  Hi dear 1: I need developing custom hikashop plugin an using onHikashopBeforeDisplayView trigger for display my data so I need if view is checkout address part display my data but can't found which code using in onHikashopBeforeDisplayView for recognition address view. How can do it? 2: If add custom text input in checkout form by using onHikashopBeforeDisplayView or onCheckoutStepDisplay after submit checkout form which plugin trigger I can get my input data? thank you.")*

Hi,

The trigger onHikashopBeforeDisplayView has a variable &amp;$view
To get the current controller, you can use $view-&gt;ctrl
To get the current task, you can use $view-&gt;getLayout()
To get the current step, you can use $view-&gt;step
To get the current position, you can use $view-&gt;module_position
To get the options of the current view, you can use $view-&gt;options
So basically, you can have such code so that you skip your code if you're not in the checkout:
if($view-&gt;ctrl != 'checkout' &#124;&#124; $view-&gt;getLayout() != 'show') return;

Supposing that you add your input fields in the address view form, you can use the onAfterAddressCreate and the onAfterAddressUpdate triggers to check the data in $_POST.

We use something similar with the recaptcha plugin which adds the catpcha in the registration form of the "login" view with the onHikashopBeforeDisplayView trigger and then checks the captcha in the onUserBeforeSave trigger called before the new user is being created.
[ www.hikashop.com/support/documentation/7...-with-recaptcha.html](https://www.hikashop.com/support/documentation/72-hikashop-integration-with-recaptcha.html)

The following user(s) said Thank You: [kaya](/forum/user/25605-kaya "View kaya's Profile"), [oxido](/forum/user/29793-oxido "View oxido's Profile")

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

- **[kaya](/forum/user/25605-kaya "View kaya's Profile")**
- [![kaya's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/vacation.jpg)](/forum/user/25605-kaya "View kaya's Profile") Topic Author
- [ Offline](/forum/user/25605-kaya)

Less More

- Posts: 120
- Thank you received: 2
-
-
- [](http://arasjoomla.ir)
-

8 years 1 week ago [\#299904](#299904) by [kaya](/forum/user/25605-kaya "View kaya's Profile")  Replied by *[kaya](/forum/user/25605-kaya "View kaya's Profile")* on topic *[onHikashopBeforeDisplayView in checkout address](/forum/27-checkout/896106-onhikashopbeforedisplayview-in-checkout-address#299904 "-- HikaShop version -- : 4.0.0 -- Joomla version -- : 3.8.10 -- PHP version -- : 7  Hi dear 1: I need developing custom hikashop plugin an using onHikashopBeforeDisplayView trigger for display my data so I need if view is checkout address part display my data but can't found which code using in onHikashopBeforeDisplayView for recognition address view. How can do it? 2: If add custom text input in checkout form by using onHikashopBeforeDisplayView or onCheckoutStepDisplay after submit checkout form which plugin trigger I can get my input data? thank you.")*

thank you dear Nicolas
we add custom input in checkout page using onCheckoutStepDisplay and can not get $_POST data in any plugin trigger after submit checkout form. only when add input in address part get data whit onAfterAddressCreate or onAfterAddressUpdate but my input not in address I need get value in another plugin trigger to save data in database and use my data in my project after submit order.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5NjEwNi1vbmhpa2FzaG9wYmVmb3JlZGlzcGxheXZpZXctaW4tY2hlY2tvdXQtYWRkcmVzcz90bXBsPW1hcmtkb3du) 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
-
-

8 years 1 week ago [\#299908](#299908) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[onHikashopBeforeDisplayView in checkout address](/forum/27-checkout/896106-onhikashopbeforedisplayview-in-checkout-address#299908 "-- HikaShop version -- : 4.0.0 -- Joomla version -- : 3.8.10 -- PHP version -- : 7  Hi dear 1: I need developing custom hikashop plugin an using onHikashopBeforeDisplayView trigger for display my data so I need if view is checkout address part display my data but can't found which code using in onHikashopBeforeDisplayView for recognition address view. How can do it? 2: If add custom text input in checkout form by using onHikashopBeforeDisplayView or onCheckoutStepDisplay after submit checkout form which plugin trigger I can get my input data? thank you.")*

Hi,

Well, I still don't know what goal you have in doing that. So I can't say for sure what would be the best.
Alternatively, if you don't want to attach your input field to any pre existing form of the checkout, you can use the checkout API of HikaShop to create your own view that you can add to the checkout workflow.
[ www.hikashop.com/support/documentation/6...tation.html#checkout](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#checkout)
You can use the plugins/hikashop/user_points/ plugin as an example as it implements that API to add its own user points view to the checkout. Thanks to that API, you'll be able to display whatever you want, and you'll also be called by the checkout system when the block or the page where the block is are submitted so that you'll be able to find your input data in $_POST.

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

- **[kaya](/forum/user/25605-kaya "View kaya's Profile")**
- [![kaya's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/vacation.jpg)](/forum/user/25605-kaya "View kaya's Profile") Topic Author
- [ Offline](/forum/user/25605-kaya)

Less More

- Posts: 120
- Thank you received: 2
-
-
- [](http://arasjoomla.ir)
-

8 years 1 week ago [\#299936](#299936) by [kaya](/forum/user/25605-kaya "View kaya's Profile")  Replied by *[kaya](/forum/user/25605-kaya "View kaya's Profile")* on topic *[onHikashopBeforeDisplayView in checkout address](/forum/27-checkout/896106-onhikashopbeforedisplayview-in-checkout-address#299936 "-- HikaShop version -- : 4.0.0 -- Joomla version -- : 3.8.10 -- PHP version -- : 7  Hi dear 1: I need developing custom hikashop plugin an using onHikashopBeforeDisplayView trigger for display my data so I need if view is checkout address part display my data but can't found which code using in onHikashopBeforeDisplayView for recognition address view. How can do it? 2: If add custom text input in checkout form by using onHikashopBeforeDisplayView or onCheckoutStepDisplay after submit checkout form which plugin trigger I can get my input data? thank you.")*

Than you Dear Nicolas
I can get my data but we have a problem in each checkout step trigger onAfterCheckoutStep called twice my controller. we add this code top of onAfterCheckoutStep Code:

if($controllerName != 'plg.shop.mycontroller') return false;

but my controller called twice in each step. How can called only once? I checked user_points plugin on this plugin controller called once in each checkout step.what is my problem?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5NjEwNi1vbmhpa2FzaG9wYmVmb3JlZGlzcGxheXZpZXctaW4tY2hlY2tvdXQtYWRkcmVzcz90bXBsPW1hcmtkb3du) 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
-
-

8 years 1 week ago [\#299938](#299938) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[onHikashopBeforeDisplayView in checkout address](/forum/27-checkout/896106-onhikashopbeforedisplayview-in-checkout-address#299938 "-- HikaShop version -- : 4.0.0 -- Joomla version -- : 3.8.10 -- PHP version -- : 7  Hi dear 1: I need developing custom hikashop plugin an using onHikashopBeforeDisplayView trigger for display my data so I need if view is checkout address part display my data but can't found which code using in onHikashopBeforeDisplayView for recognition address view. How can do it? 2: If add custom text input in checkout form by using onHikashopBeforeDisplayView or onCheckoutStepDisplay after submit checkout form which plugin trigger I can get my input data? thank you.")*

Hi,

When the view is submitted in ajax it is called once so that it can get the data from the view.
When the whole step is submitted, it is called once so that it can get the data from the view. Also, if all the views of the step tell the checkout that it's ok and it can move to the next step, the checkout will call again that trigger on the views of all the steps prior to the new current step so that they can check that they have the correct data.
So the user_points plugin should also be called twice when you click on the "next" or "finish" button on a step where this plugin displays its view.
So there is no problem. It's just the normal way it works.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5NjEwNi1vbmhpa2FzaG9wYmVmb3JlZGlzcGxheXZpZXctaW4tY2hlY2tvdXQtYWRkcmVzcz90bXBsPW1hcmtkb3du) 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.073 seconds

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