Thank you for your feedback.
Form temporarily unavailable. Please try again or contact to submit your comments.
  • London
  • Kingston
  • Jakarta
  • Istanbul
  • Helsinki
  • Geneva
  • Store

Create macros for cart layout

Create macros for cart layout

Service catalog enables you to create macros for cart layout records using Jelly scripts to define customized behavior and display within a widget or screen.

About this task

Macros that you create do not affect upgrades because customized widget functionality is isolated from general cart behavior.

To create a new macro:


  1. Open the relevant cart layout record.
  2. Navigate to Widget Macros or Column Macrorelated list.
  3. Click New.
  4. Enter details for the macro.
    Table 1. Macro form
    Field Description
    Name The name for the new macro.
    Active A check box to indicate whether the macro is displayed or not.
    Description A summary of how the macro is used.
    Active A check box to indicate whether the macro is displayed or not.
    XML The Jelly script to apply for your macro.
  5. Save the macro record.


This example demonstrates the script to add a Requested for reference field as a widget macro to a cart layout record.
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
    <j:set var="ref" value="sc_cart" />
    <j:set var="jvar_ref" value="${jvar_cart.getRequestedFor()}" />
    <j:set var="jvar_ref_display" value="${jvar_cart.getRequestedForDisplayName()}" />
        <td colspan="3">
            ${gs.getMessage('Requested for')}:
        <td colspan="3" style="padding: 4px;">
            <g:catalog_requested_for />