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
 

Senior Member
  
Join Date: Oct 2008
Posts: 109
 

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:	1043
Size:	29.5 KB
ID:	5656  Click image for larger version

Name:	At the top.JPG
Views:	1060
Size:	27.2 KB
ID:	5657  
__________________
Four sites using 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: 446
 

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
 

Senior Member
  
Join Date: Oct 2008
Posts: 109
 

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.
__________________
Four sites using X-Cart 5.4.x.x. Oh the joy
Reply With Quote
  #4  
Old 11-21-2021, 02:45 AM
 
TimHaynes TimHaynes is offline
    
Join Date: Mar 2021
Posts: 1
 

Default Re: Change order of address fields

It looks like a design bug that doesn't affect performance.
__________________
X-Cart Business 5.3.6.3
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 06:17 AM.

   

 
X-Cart forums © 2001-2020