Developer forum

Forum » Templates » Visibility of navigation buttons in Shopping cart app

Visibility of navigation buttons in Shopping cart app

Tomas Gomez
Reply

Hi,

We use InformationUser.cshtml as the template of one of the steps of the Shopping cart app. The version is DW 9.15.3 and Swift 1.16.0.

In that template, the visibility of the navigation buttons depends on the non-emptyness condition of some fields (Address, Zip and City). See code below.

This way, the buttons are sometimes displayed and sometimes not. This is confusing, as not even the "Go to previous" button is displayed so the user is stucked at the page.

What is the purpose of this condition? Is this a bug?

List<string> addressList = new List<string>()
if (!string.IsNullOrEmpty(GetString("UserManagement:User.Address")))
{
addressList.Add(GetString("UserManagement:User.Address"));
}
if (!string.IsNullOrEmpty(GetString("UserManagement:User.Zip")))
{
addressList.Add(GetString("UserManagement:User.Zip"));
}
if (!string.IsNullOrEmpty(GetString("UserManagement:User.City")))
{
addressList.Add(GetString("UserManagement:User.City"));
}
string addressString = (string.Join(",", addressList.Select(x => x.ToString()).ToArray()));
...
@if (!string.IsNullOrWhiteSpace(addressString))   
{
@RenderStepsNavigation()
           
 
Regards,
Tomas
 

Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

A logged in user needs to go to edit profile to change the address.

This is a logged in user running this template - so you do not have input fields for it by default. You need to handle that on the user profile which will then fill out the order fields for you.

 

You must be logged in to post in the forum