Developer forum

Forum » Swift » Minor bug in AddressDeliveryAnonymous_v2.cshtml

Minor bug in AddressDeliveryAnonymous_v2.cshtml

Kenneth Radoor
Reply

in the file \Templates\Designs\Swift\eCom7\CartV2\Step\Shared\Helpers\AddressDeliveryAnonymous_v2.cshtml, where your trying to get the ID of the checkoutpage

string userCheckoutPage = Pageview.CurrentParagraph.Item["CheckoutUserPageLink"] != null ? Pageview.CurrentParagraph.Item["CheckoutUserPageLink"].ToString().Replace("Default.aspx?Id=", "") : "";

The replace does not work.

the CheckoutUserPageLink is returned as Default.aspx?ID=xx, so it wille never be replaced.

Simple fix with null checks 

string userCheckoutPage = Pageview.CurrentParagraph.Item["CheckoutUserPageLink"] != null ? Pageview.CurrentParagraph.Item["CheckoutUserPageLink"]?.ToString()?.ToLower().Replace("default.aspx?id=", "") ?? "" : "";


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Thank you very much for the detailed reporting - much appreciated.

We will check it out and fix accordingly.

Thanks, Nicolai

 

You must be logged in to post in the forum