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

#   Module with VAT Number?

##

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

Less More

- Posts: 60
- Thank you received: 3
-
-

11 years 7 months ago [\#200102](#200102) by [blueagle1829](/forum/user/5850-blueagle1829 "View blueagle1829's Profile")  *[Module with VAT Number?](/forum/32-content-creation/876656-module-with-vat-number#200102 "-- HikaShop version -- : 2.2.2 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.29  Is it possible to create a Custom HTML module that would show the address&#95;vat value for the logged in user? That would be incredibly helpful for me.  Thanks!")* was created by *[blueagle1829](/forum/user/5850-blueagle1829 "View blueagle1829's Profile")*

-- HikaShop version -- : 2.2.2
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.3.29

Is it possible to create a Custom HTML module that would show the address_vat value for the logged in user? That would be incredibly helpful for me.

Thanks!

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

11 years 6 months ago [\#200114](#200114) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Module with VAT Number?](/forum/32-content-creation/876656-module-with-vat-number#200114 "-- HikaShop version -- : 2.2.2 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.29  Is it possible to create a Custom HTML module that would show the address&#95;vat value for the logged in user? That would be incredibly helpful for me.  Thanks!")*

Hi,

A Custom HTML module no ; but a custom module (with some PHP), yes.
Because you will need to load the user if you want to display that value and to do that, you will need some custom PHP code.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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

Less More

- Posts: 60
- Thank you received: 3
-
-

11 years 6 months ago [\#200168](#200168) by [blueagle1829](/forum/user/5850-blueagle1829 "View blueagle1829's Profile")  Replied by *[blueagle1829](/forum/user/5850-blueagle1829 "View blueagle1829's Profile")* on topic *[Module with VAT Number?](/forum/32-content-creation/876656-module-with-vat-number#200168 "-- HikaShop version -- : 2.2.2 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.29  Is it possible to create a Custom HTML module that would show the address&#95;vat value for the logged in user? That would be incredibly helpful for me.  Thanks!")*

Could I pay for the support that would be necessary to implement this?

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

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

Less More

- Posts: 60
- Thank you received: 3
-
-

11 years 6 months ago -  11 years 6 months ago [\#200171](#200171) by [blueagle1829](/forum/user/5850-blueagle1829 "View blueagle1829's Profile")  Replied by *[blueagle1829](/forum/user/5850-blueagle1829 "View blueagle1829's Profile")* on topic *[Module with VAT Number?](/forum/32-content-creation/876656-module-with-vat-number#200171 "-- HikaShop version -- : 2.2.2 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.29  Is it possible to create a Custom HTML module that would show the address&#95;vat value for the logged in user? That would be incredibly helpful for me.  Thanks!")*

I believe that I can use [ this plugin](https://www.nonumber.nl/extensions/sourcerer) to execute the php code directly in the module. I'm using the below code but I don't get a result. Any ideas? Code:

&lt;?php $db-&gt;setQuery("SELECT ha.address_vat FROM #__hikashop_address ha LEFT JOIN #__hikashop_user hu ON ha.address_user_id=hu.user_cms_id WHERE hu.user_cms_id = '".$userId."' LIMIT 1"); ?&gt;

Last edit: 11 years 6 months ago by [blueagle1829](/forum/user/5850-blueagle1829 "View blueagle1829's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODc2NjU2LW1vZHVsZS13aXRoLXZhdC1udW1iZXI/dG1wbD1tYXJrZG93bg==) 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: 86587
- Thank you received: 14325
-
-

11 years 6 months ago [\#200201](#200201) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Module with VAT Number?](/forum/32-content-creation/876656-module-with-vat-number#200201 "-- HikaShop version -- : 2.2.2 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.29  Is it possible to create a Custom HTML module that would show the address&#95;vat value for the logged in user? That would be incredibly helpful for me.  Thanks!")*

We would be happy that you would renew your subscription ![:)](/media/kunena/emoticons/3.png ":)")

With sourcerer it should be possible yes.
Such code should do the job: Code:

{source}&lt;?php $query = "SELECT ha.address_vat FROM #__hikashop_address ha LEFT JOIN #__hikashop_user hu ON ha.address_user_id=hu.user_cms_id WHERE hu.user_cms_id = '".$user-&gt;id."' LIMIT 1"; $database-&gt;setQuery($query); echo $database-&gt;loadResult(); ?&gt;{/source}

The following user(s) said Thank You: [blueagle1829](/forum/user/5850-blueagle1829 "View blueagle1829's Profile")

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

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

Less More

- Posts: 60
- Thank you received: 3
-
-

11 years 6 months ago -  11 years 6 months ago [\#200442](#200442) by [blueagle1829](/forum/user/5850-blueagle1829 "View blueagle1829's Profile")  Replied by *[blueagle1829](/forum/user/5850-blueagle1829 "View blueagle1829's Profile")* on topic *[Module with VAT Number?](/forum/32-content-creation/876656-module-with-vat-number#200442 "-- HikaShop version -- : 2.2.2 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.29  Is it possible to create a Custom HTML module that would show the address&#95;vat value for the logged in user? That would be incredibly helpful for me.  Thanks!")*

That does produce a result, but it's not the VAT that is associated with my account... Any ideas why that would be?

EDIT:
Specifically, my hikashop ID is 1 and the ID for the user that it returned is 222.

Last edit: 11 years 6 months ago by [blueagle1829](/forum/user/5850-blueagle1829 "View blueagle1829's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODc2NjU2LW1vZHVsZS13aXRoLXZhdC1udW1iZXI/dG1wbD1tYXJrZG93bg==) 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: 86587
- Thank you received: 14325
-
-

11 years 6 months ago [\#200473](#200473) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Module with VAT Number?](/forum/32-content-creation/876656-module-with-vat-number#200473 "-- HikaShop version -- : 2.2.2 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.29  Is it possible to create a Custom HTML module that would show the address&#95;vat value for the logged in user? That would be incredibly helpful for me.  Thanks!")*

$user-&gt;id is the id of the user in Joomla, not HikaShop.
Sourcerer doesn't know of the id of the user in HikaShop, only in Joomla.
So it's normal that the ids do not correspond. Still, it should pick the correct address VAT number of one of the addresses of the current user.

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

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

Less More

- Posts: 60
- Thank you received: 3
-
-

11 years 6 months ago [\#200490](#200490) by [blueagle1829](/forum/user/5850-blueagle1829 "View blueagle1829's Profile")  Replied by *[blueagle1829](/forum/user/5850-blueagle1829 "View blueagle1829's Profile")* on topic *[Module with VAT Number?](/forum/32-content-creation/876656-module-with-vat-number#200490 "-- HikaShop version -- : 2.2.2 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.29  Is it possible to create a Custom HTML module that would show the address&#95;vat value for the logged in user? That would be incredibly helpful for me.  Thanks!")*

Please see the attached screen shots. It shows that the number which should be displayed with my account is 95175300, but the front end is actually displaying 10723406 (which is associated with a different account).

I really appreciate your help with this... Not sure what's going wrong here.

- [ ![FrontEnd.jpg](/forum/attachment/24202) ](/forum/attachment/24202 "FrontEnd.jpg") [ ](/forum/attachment/24202?download=1 "FrontEnd.jpg")
- [ ![BackEnd.jpg](/forum/attachment/24203) ](/forum/attachment/24203 "BackEnd.jpg") [ ](/forum/attachment/24203?download=1 "BackEnd.jpg")
- [ ![WhatIsShowing.jpg](/forum/attachment/24204) ](/forum/attachment/24204 "WhatIsShowing.jpg") [ ](/forum/attachment/24204?download=1 "WhatIsShowing.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMyLWNvbnRlbnQtY3JlYXRpb24vODc2NjU2LW1vZHVsZS13aXRoLXZhdC1udW1iZXI/dG1wbD1tYXJrZG93bg==) 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: 86587
- Thank you received: 14325
-
-

11 years 6 months ago [\#200501](#200501) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Module with VAT Number?](/forum/32-content-creation/876656-module-with-vat-number#200501 "-- HikaShop version -- : 2.2.2 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.29  Is it possible to create a Custom HTML module that would show the address&#95;vat value for the logged in user? That would be incredibly helpful for me.  Thanks!")*

Ha, I know, there is a mistake in the code you gave. It should be like that: Code:

{source}&lt;?php $query = "SELECT ha.address_vat FROM #__hikashop_address ha LEFT JOIN #__hikashop_user hu ON ha.address_user_id=hu.user_id WHERE hu.user_cms_id = '".$user-&gt;id."' LIMIT 1"; $database-&gt;setQuery($query); echo $database-&gt;loadResult(); ?&gt;{/source}

The following user(s) said Thank You: [blueagle1829](/forum/user/5850-blueagle1829 "View blueagle1829's Profile")

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

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

Less More

- Posts: 60
- Thank you received: 3
-
-

11 years 6 months ago [\#200680](#200680) by [blueagle1829](/forum/user/5850-blueagle1829 "View blueagle1829's Profile")  Replied by *[blueagle1829](/forum/user/5850-blueagle1829 "View blueagle1829's Profile")* on topic *[Module with VAT Number?](/forum/32-content-creation/876656-module-with-vat-number#200680 "-- HikaShop version -- : 2.2.2 -- Joomla version -- : 3.3.6 -- PHP version -- : 5.3.29  Is it possible to create a Custom HTML module that would show the address&#95;vat value for the logged in user? That would be incredibly helpful for me.  Thanks!")*

That got it. You can lock this thread. Thank you!

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

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