kim_purcell
Kilo Explorer

If you create and name a catalog item with an ampersand on your two-step shopping cart page, say "B&B", add this item to your cart and proceed to checkout, you may find yourself staring at a blank page with this error: The entity name must immediately follow the '&' in the entity reference.

 

This will occur in your two-step shopping cart when:

  • a catalog item has a variable question that has an ampersand
  • a catalog item has a name that has an ampersand

 

In this case, "&" is not followed by "#" (for example   or   ) identified in HTML. So the XML parser is basically looking for any predefined or manual defined entity names (such as lt, gt, amp, quot and apos). You're just using "&" by itself and not as an XML entity, which explains why you're getting this XML parsing error.   To fix this, you can to modify a couple of UI macros to escape HTML.

 

To fix a variable with a question that contains an ampersand:

1. Navigate to System UI > UI Macros.

2. In the UI Macro cart_variable_summary_v2, change:

${questionLabel}

to

${HTML:questionLabel}

OR

${JS:questionLabel}

 

Line 16 should look like this:

<td style="color:grey;">${HTML:questionLabel}$[SP]</td>

 

And change:

${displayValue}

to

${HTML:displayValue}

OR

${JS:displayValue}

 

Line 19 should look like this:

${HTML:displayValue}

 

UI_Macro.jpg


To fix a catalog item with a name and short description that contains an ampersand:

1. Navigate to System UI > UI Macros.

2. In the UI Macro, sc_cart_view_column_expandable_desc, change:

${jvar_questionHelpTag} 

to

${HTML:jvar_questionHelpTag}

OR

${JS:jvar_questionHelpTag}

 

Line 23 should then look like this:

<g:inline template="help_text.xml" question_show_help="true" question_help_tag="${HTML:jvar_questionHelpTag}" question_name="${jvar_cart_item.getID()}" help_class="${jvar_line_color}">

 

Here are releases where you may run into this problem:

  • Eureka Patch 4 Hot Fix 1
  • Fuji Patch 2 Hot Fix 1
  • Fuji Patch 3
  • Fuji Patch 5
  • Fuji Patch 6
  • Fuji Patch 7 Hot Fix 5

 

Looking for more answers to your Service Catalog questions?

Associate CMS to Service Catalog and UI buttons

Redirecting the Back to Catalog button

Customize your service catalog's shopping cart

Create a custom attachment button for your service catalog

Get the Continue Shopping button working in your Service Catalog

How to fix Catalog UI style issues (CSS) in Fuji

The Continue Shopping button in the shopping cart redirects to incorrect an URL (KB0535421)

"Back to catalog" button redirects to the incorrect catalog (KB0547169)

Creating Catalog Client Scripts

Defining Catalog Items

Adding Content Items to Service Catalog