Hide Fax field is no number

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
I'm working with NOP3.5 and using OnePageCheckout.  On the Confirm portion of the page, I'd like to hide the Fax: line in the billing and shipping address if there is no fax number to display.

I'd appreciate any suggestions for the simplest method to do make this change.

Thank you in advance for your advise and support.

JohnJ
7 years ago
Have a look at the _OrderReviewData.cshtml partial view. Where there's code like this:

@if (Model.BillingAddress.FaxEnabled)
{
  <li class="fax">
    @T("Order.Fax"): @Model.BillingAddress.FaxNumber
  </li>
}

change it to this:

@if (Model.BillingAddress.FaxEnabled && !string.IsNullOrWhiteSpace(Model.BillingAddress.FaxNumber))
  <li class="fax">
    @T("Order.Fax"): @Model.BillingAddress.FaxNumber
  </li>
}
7 years ago
Thank you.  I applied the code on the _OrderReviewData.cshtml and the order/Details.cshtml pages.

Works great.

JohnJ
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.