Hi,
I customized Ecommerce.Address Module and added two new fields: AddressProvinceID and AddressCityID.
Ecommerce.Address
AddressProvinceID
AddressCityID
Form control for Both of them are Dropdownlist and AddressCityID depends on AddressProvinceID and Dropdownlist of AddressCityID fills with data accourding to selected AddressProvinceID.
SQL query for AddressProvinceID data source is: SELECT -1 as ProvinceID, '(Select)' as ProvinceDisplayName UNION SELECT ProvinceID, ProvinceDisplayName FROM CustomTable_Province
SELECT -1 as ProvinceID, '(Select)' as ProvinceDisplayName UNION SELECT ProvinceID, ProvinceDisplayName FROM CustomTable_Province
and SQL query for AddressCityID data source is: SELECT -1 as CityID, '(Select)' as CityDisplayName UNION SELECT CityID, CityDisplayName FROM CustomTable_City INNER JOIN CustomTable_Province ON CustomTable_City.CityProvinceID = CustomTable_Province.ProvinceID WHERE CustomTable_City.CityProvinceID = {% AddressProvinceID %}
SELECT -1 as CityID, '(Select)' as CityDisplayName UNION SELECT CityID, CityDisplayName FROM CustomTable_City INNER JOIN CustomTable_Province ON CustomTable_City.CityProvinceID = CustomTable_Province.ProvinceID WHERE CustomTable_City.CityProvinceID = {% AddressProvinceID %}
The problem is when I set both of them in checkout process and go to the next step the value of AddressCityID not saving.
Also when I debug the macro, {% AddressProvinceID %} returns two times, -1 for first time and then returns correct value of selected AddressProvinceID.
{% AddressProvinceID %}
Have you tried AddressProvinceID.Value?
Hi Zachary, AddressProvinceID.Value not work on Data source SQL query. I tested {%Form.GetValue("AddressProvinceID")|(identity)GlobalAdministrator%} get same result and not working.
{%Form.GetValue("AddressProvinceID")|(identity)GlobalAdministrator%}
Please help me to solve this issue.
I believe what you need to do is ensure the field you need to get the value from does a post back so the value is set before submission. So in the field you are getting the value from, set has depending forlds (which should cause a post back) and hopefully fix the issue.
Please, sign in to be able to submit a new answer.