Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Change order of address fields

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 09-13-2021, 01:58 AM
 
bionuts bionuts is offline
 

Advanced Member
  
Join Date: Oct 2008
Location: At my desk, probably scratching my head over an X Cart problem....
Posts: 88
 

Default Change order of address fields

Hi all,

We currently have X-Cart 5 installed on four of our websites, each one using a different theme.

On one of the themes, when looking at the Checkout page, the Email address field is at the top of the list whereas on the other three themes it is at the bottom. (see attached images)

I would prefer to have the email field at the top of the list for all of the themes, but as it is not in the list of fields for Cart & Checkout > Address Fields I'm not sure how to do this.

I've tried to find the differences in the files between the themes but haven't been able to. Can anyone point me in the right direction here?

Thanks as ever for your help.
Attached Thumbnails
Click image for larger version

Name:	At the bottom.JPG
Views:	37
Size:	29.5 KB
ID:	5656  Click image for larger version

Name:	At the top.JPG
Views:	38
Size:	27.2 KB
ID:	5657  
__________________
Currently transitioning to X-Cart 5.4.x.x. Oh the joy
Reply With Quote
  #2  
Old 09-26-2021, 01:35 AM
 
Ed B. Ed B. is offline
 

X-Adept
  
Join Date: Apr 2016
Posts: 409
 

Default Re: Change order of address fields

Hi, a quick glance at the codes suggest that the output comes from


../../../skins/customer/checkout/steps/shipping/parts/address.shipping.twig


which looks like
Code:
{## # Checkout shipping address form #} {% form '\\XLite\\View\\Form\\Checkout\\UpdateProfile' with {className: 'addr ess shipping-address'} %} <ul class="form shipping-address-form"> {% for fieldName, fieldData in this.getAddressSchemaFields() %} <li class="item-{{ fieldName }} {{ fieldData.additionalClass }} clearfi x"> {{ this.displayCommentedData(this.getFieldCommentedData(fieldData)) } } {{ fieldData.widget.display() }} {{ widget_list('checkout.shipping.address.' ~ fieldName, address=this .getAddressInfo(), fieldName=fieldName, fieldData=fieldData) }} </li> {% endfor %} {{ widget_list('checkout.shipping.address', address=this.getAddressInfo() ) }} </ul> {% endform %}


Unfortunately I have been unable to figure out where the widget list checkout.shipping.address is defined. But with a little luck, you an maybe get away just by making sure the array this.getAddressSchemaFields() (which is defined in the view class View/Checkout/AAddressBlock.php) isn't sorted in the theme that outputs address fields in a wrong order.
__________________
X-cart 5.2.12, php 5.6
Ed from Grenoble, France
Reply With Quote
  #3  
Old 10-04-2021, 05:15 AM
 
bionuts bionuts is offline
 

Advanced Member
  
Join Date: Oct 2008
Location: At my desk, probably scratching my head over an X Cart problem....
Posts: 88
 

Default Re: Change order of address fields

Hi,

Thanks for your reply.

I haven't been able to find any code differences between the themes that do this how I want and the ones that don't, so I'm a bit lost. I haven't really got my head round the way that 5 does things compared to 4, where I think I would have been able to achieve this relatively easily.

Guess I'll just have to live with it for now, until I manage to get some time to really learn 5 properly.
__________________
Currently transitioning to X-Cart 5.4.x.x. Oh the joy
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:44 PM.

   

 
X-Cart forums © 2001-2020