| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
If statement for "State" | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
![]() Hello
I have states enabled for the USA but for other countries it displays "The selected country doesn't require 'state' field". Does any one know what the best method would be to only show the "States" field when United States is selcted as the country and not show at all, (either on registration page or invoice) when any other country is selected? I am thinking the following if statement should hide it for all countries but the United States. Code:
Thanks in advance. |
|||||||||
#2
|
|||||||||
|
|||||||||
![]() I am having problems getting this to work to show the state field for only US users, using the following code in skin1/mail/html/order_invoice.tpl
Code:
Thanks |
|||||||||
#3
|
|||||||
|
|||||||
![]() The problem is, when they are filling out that form, they aren't logged in, so the cart has no idea where they are from
![]()
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#4
|
|||||||||
|
|||||||||
![]() I was also thinking that. Nothing can ever be simple I guess. To me it just does not look professional to have a big old "NONE" in the state field on the invoice for those countries that do not have states.
![]() |
|||||||||
#5
|
|||||||
|
|||||||
![]() I hear ya - if you dig in to the code I believe you could rework the if statements they use to swap from the drop -down to 'none' to hide the row completely.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#6
|
|||||||||
|
|||||||||
![]() Quote:
![]() |
|||||||||
#7
|
|||||||
|
|||||||
![]() Heh...true, very true.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#8
|
|||||||||
|
|||||||||
![]() I got help from the Pro's over at Qualiteam and thanks to them this now works great.
For anyone else interested in only showing the "state" field for only the US (or you could change or add any country you want). Xcart Version 4.1.10 - change the following two bits of code in skin1/mail/html/order_invoice.tpl Code:
Code:
Code:
Code:
|
|||||||||
|
|||
X-Cart forums © 2001-2020
|