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

#   Changing Billing Address Fields ID

##

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

Less More

- Posts: 57
- Thank you received: 1
-
-

9 years 8 months ago [\#264551](#264551) by [tariaki](/forum/user/43507-tariaki "View tariaki's Profile")  *[Changing Billing Address Fields ID](/forum/27-checkout/889274-changing-billing-address-fields-id#264551 "-- HikaShop version -- : 3.0 -- Joomla version -- : 3.6 -- PHP version -- : 5.6  Hey,  At the moment both billing and shipping address are using the same ID :  Both IDs are called 'address&#95;street' - Is there a way to change the ID of the Billing Address fields?  This is not for CSS purposes. I know that for CSS I can use  Ideas?  Thanks")* was created by *[tariaki](/forum/user/43507-tariaki "View tariaki's Profile")*

-- HikaShop version -- : 3.0
-- Joomla version -- : 3.6
-- PHP version -- : 5.6

Hey,

At the moment both billing and shipping address are using the same ID :

[ ![ScreenShot2017-03-09at11.24.02.jpg](/forum/attachment/36913) ](/forum/attachment/36913 "...at11.24.02.jpg")

Both IDs are called 'address_street' - Is there a way to change the ID of the Billing Address fields?

**This is not for CSS purposes**. I know that for CSS I can use Code:

hikashop_shipping_address_address_street td input#address_street

Ideas?

Thanks

- [ ![ScreenShot2017-03-09at11.24.02.jpg](/forum/attachment/36913) ](/forum/attachment/36913 "...at11.24.02.jpg") [ ](/forum/attachment/36913?download=1 "...at11.24.02.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg4OTI3NC1jaGFuZ2luZy1iaWxsaW5nLWFkZHJlc3MtZmllbGRzLWlkP3RtcGw9bWFya2Rvd24=) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

9 years 8 months ago [\#264558](#264558) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Changing Billing Address Fields ID](/forum/27-checkout/889274-changing-billing-address-fields-id#264558 "-- HikaShop version -- : 3.0 -- Joomla version -- : 3.6 -- PHP version -- : 5.6  Hey,  At the moment both billing and shipping address are using the same ID :  Both IDs are called 'address&#95;street' - Is there a way to change the ID of the Billing Address fields?  This is not for CSS purposes. I know that for CSS I can use  Ideas?  Thanks")*

Hi,

You would have to edit the file "custom_fields" of the view "checkout".
You could do a str_replace on the code: Code:

echo $this-&gt;fieldsClass-&gt;display( $oneExtraField, $this-&gt;$type-&gt;$fieldName, 'data['.$type.']['.$fieldName.']', false, ' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\''.$type.'\',0);"' );

Or, you could use the new checkout of HikaShop by turning off the "checkout legacy" setting.
The new checkout has a different address system and thus the fact that the fields have the same id shouldn't be a problem anymore.

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

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

Less More

- Posts: 57
- Thank you received: 1
-
-

9 years 8 months ago [\#264627](#264627) by [tariaki](/forum/user/43507-tariaki "View tariaki's Profile")  Replied by *[tariaki](/forum/user/43507-tariaki "View tariaki's Profile")* on topic *[Changing Billing Address Fields ID](/forum/27-checkout/889274-changing-billing-address-fields-id#264627 "-- HikaShop version -- : 3.0 -- Joomla version -- : 3.6 -- PHP version -- : 5.6  Hey,  At the moment both billing and shipping address are using the same ID :  Both IDs are called 'address&#95;street' - Is there a way to change the ID of the Billing Address fields?  This is not for CSS purposes. I know that for CSS I can use  Ideas?  Thanks")*

Hey Nicolas,

Thanks for your reply.

I have switched off legacy but don't understand how it solved the problem... Input fields still have same ID name...

Regarding the str_replace on the code - can you please give an example?

Thanks
Avi

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg4OTI3NC1jaGFuZ2luZy1iaWxsaW5nLWFkZHJlc3MtZmllbGRzLWlkP3RtcGw9bWFya2Rvd24=) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14325
-
-

9 years 8 months ago [\#264641](#264641) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Changing Billing Address Fields ID](/forum/27-checkout/889274-changing-billing-address-fields-id#264641 "-- HikaShop version -- : 3.0 -- Joomla version -- : 3.6 -- PHP version -- : 5.6  Hey,  At the moment both billing and shipping address are using the same ID :  Both IDs are called 'address&#95;street' - Is there a way to change the ID of the Billing Address fields?  This is not for CSS purposes. I know that for CSS I can use  Ideas?  Thanks")*

Hi,

When the checkout legacy is activated, you'll have only one address form on the page, never two. So you won't have a problem in CSS or in JS to target a field of the form, if that's what you want.
As we don't know what you want to do, I thought that this would be better.
A str_replace is really easy: Code:

echo str_replace('STRING TO REPLACE','REPLACEMENT STRING',$this-&gt;fieldsClass-&gt;display( $oneExtraField, $this-&gt;$type-&gt;$fieldName, 'data['.$type.']['.$fieldName.']', false, ' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\''.$type.'\',0);"' ));

Note that the exact view where to do the change will vary based on how your checkout is configured (the address selector, etc) and whether the "checkout legacy" option is activated or not. It might be one of the files of the address view, or one of the files with the text "address" in it in the view "checkout".

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

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

Less More

- Posts: 57
- Thank you received: 1
-
-

9 years 8 months ago [\#264715](#264715) by [tariaki](/forum/user/43507-tariaki "View tariaki's Profile")  Replied by *[tariaki](/forum/user/43507-tariaki "View tariaki's Profile")* on topic *[Changing Billing Address Fields ID](/forum/27-checkout/889274-changing-billing-address-fields-id#264715 "-- HikaShop version -- : 3.0 -- Joomla version -- : 3.6 -- PHP version -- : 5.6  Hey,  At the moment both billing and shipping address are using the same ID :  Both IDs are called 'address&#95;street' - Is there a way to change the ID of the Billing Address fields?  This is not for CSS purposes. I know that for CSS I can use  Ideas?  Thanks")*

Hey Nicolas

Thanks for your reply.

I think maybe I'm not explaining myself correctly.

[ ![ScreenShot2017-03-11at09.35.19.jpg](/forum/attachment/36980) ](/forum/attachment/36980 "...at09.35.19.jpg")

I need the input ID to be different for billing and shipping.

Ideas?

- [ ![ScreenShot2017-03-11at09.35.19.jpg](/forum/attachment/36980) ](/forum/attachment/36980 "...at09.35.19.jpg") [ ](/forum/attachment/36980?download=1 "...at09.35.19.jpg")

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

9 years 8 months ago [\#264723](#264723) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Changing Billing Address Fields ID](/forum/27-checkout/889274-changing-billing-address-fields-id#264723 "-- HikaShop version -- : 3.0 -- Joomla version -- : 3.6 -- PHP version -- : 5.6  Hey,  At the moment both billing and shipping address are using the same ID :  Both IDs are called 'address&#95;street' - Is there a way to change the ID of the Billing Address fields?  This is not for CSS purposes. I know that for CSS I can use  Ideas?  Thanks")*

Hi,

The Nicolas trick is still valid for your request.
You need to tweak it a little to check if you're editing in the shipping or billing context ; but otherwise that's the best way to override the ID of the inputs.

Regards,

---

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

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

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

Less More

- Posts: 57
- Thank you received: 1
-
-

9 years 7 months ago [\#266156](#266156) by [tariaki](/forum/user/43507-tariaki "View tariaki's Profile")  Replied by *[tariaki](/forum/user/43507-tariaki "View tariaki's Profile")* on topic *[\[SOLVED\] Changing Billing Address Fields ID](/forum/27-checkout/889274-changing-billing-address-fields-id#266156 "-- HikaShop version -- : 3.0 -- Joomla version -- : 3.6 -- PHP version -- : 5.6  Hey,  At the moment both billing and shipping address are using the same ID :  Both IDs are called 'address&#95;street' - Is there a way to change the ID of the Billing Address fields?  This is not for CSS purposes. I know that for CSS I can use  Ideas?  Thanks")*

Or simply go to components/com_hikashop/address/form.php and change from line 64 to :
Code:

&lt;td&gt;&lt;?php $onWhat='onchange'; if($oneExtraField-&gt;field_type=='radio') $onWhat='onclick'; echo $this-&gt;fieldsClass-&gt;display( $oneExtraField, @$this-&gt;address-&gt;$fieldName, 'data[address]['.$fieldName.']', false, ' '.$onWhat.'="hikashopToggleFields(this.value,\''.$fieldName.'\',\'address\',0);"', false, $this-&gt;extraFields['address'], @$this-&gt;address ); ?&gt;&lt;/td&gt;

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

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