How does one change "Order Now" button to "Submit" for a single catalog item that has no cart layout?

Kristian Johns3
Tera Expert

What's the best way to change the label for the "Order Now" button to "Submit" for a single catalog item where there is no cart layout. The old document.getElementById("oi_order_now_button").innerHTML='Submit'; catalog client on load script solution doesn't seem to work anymore, and neither do a few other document solutions. This is in Jakarta.

1 ACCEPTED SOLUTION

Kristian Johns3
Tera Expert

I copied the catalog_cart_default UI Macro and disabled the original, and then created a custom field called u_show_submit and created an orderLabel variable to contain the "Submit" text.

 

<g:evaluate var="jvar_orderLabel" object="true">
    var orderLabel = "Order Now";
    <j:if test="${sc_cat_item.u_show_submit == true}">
        orderLabel = "submit";
    </j:if>
	orderLabel;
</g:evaluate>

Then wherever the label is written as "Order Now" it can be switched out with the variable:

<j:if test="${sc_cat_item.no_order_now != true}">
    <g:sc_button img="images/button_cursor.gifx" classes="request_catalog_button_with_icon" id="order_now" onclick="if ($$('.order_buttons .disabled_order_button').length == 0) { orderNow(); } else { alert('${gs.getMessage('Please wait - price being updated')}'); }" label="${jvar_orderLabel}" title="Order Now" isPrimary="true"/>
</j:if>

View solution in original post

13 REPLIES 13

If you are comfortable modifying the UI macro catalog_cart_default, you can add a field to catalog item called 'Show Submit'. And then add condition in the UI macro to show Submit button when 'Show Submit' is checked. 

 

Are you using Service Catalog or Service Portal?


Please mark this response as correct or helpful if it assisted you with your question.

Service Catalog. This sounds like it has potential. I'll give it a try and report back.

Mark Stanger
Giga Sage

I'm not sure exactly when it was added, but you might personalize your catalog client script form and see if the 'Isolate script' field is present.  If it is, you can probably get your script working again just by un-checking that field.  I just tested your script successfully in my London instance and it worked as long as 'Isolate script' was un-checked.

Hmm. Maybe this is a London feature. I do not see the field present when personalizing the catalog client script form, and looking in the dictionary, I don't see any *isolate fields in the whole system (although it might be named something else).

Mark, The isolate script field does not exist in KP6.  The above script does not work either.