142 views

Description

Many unnecessary calls are being made to the PriceGenerator code for service catalog items, even when their cart layouts are defined to specifically omit the prices. This issue was originally opened as PRB628164 (the GlideappCatalogPriceGenerator gets called unconditionally, even if glide.sc.price.display=never), and the problem was closed. However, the code still demonstrates the same behavior: regardless of whether we display the price or not, we always calculate the price. Catalog items are rendering slowly because of unnecessary function calls that include DB queries.

Steps to Reproduce

 

  1. Navigate to System Diagnostics > Session Debug > Debug SQL (Detailed).
  2. Navigate to System Properties > Service Catalog.
    1. Ensure that the Use the sc_layout driven cart macros (default true) checkbox is checked (i.e., glide.sc.use_cart_layouts = true).
    2. Ensure that the When to show prices and sub-totals on the Service Catalog Cart (Overrides sc_layout record settings) field is set to Never Show Prices (i.e., the glide.sc.price.display = )
    3. If either value was changed, click Save.
  3. Navigate to Service Catalog > Catalog Definitions > Maintain Cart Layouts.
    1. Click the Order Status Screen cart layout.
    2. Click Components. Uncheck the Frequency Subtotal and Total checkboxes.
    3. Click Columns. Uncheck the Price column and Total column checkboxes.
    4. Update.
  4. Navigate to Service Catalog > Catalog Definitions > Maintain Cart Layouts.
    1. Click the Shopping Cart Widget cart layout.
    2. Click Components. Uncheck the Price, Recurring Price, and Subtotal checkboxes.
    3. Update.
  5. Navigate to Service Catalog > Catalog Definitions > Maintain Cart Layouts.
    1. Click the Item Ordering Widget cart layout.
    2. Click Components tab. Uncheck the Price, Recurring Price, Subtotal, and Recurring Subtotal checkboxes.
    3. Update.
  6. Navigate to Service Catalog > Catalog Definitions > Maintain Items.
    1. Find and click the Finishing Services Catalog Item.
    2. Click Additional actions > Configure > Form Layout.
    3. Add the Use cart Layout field to the form.
    4. Save.
    5. Ensure that Use cart layout is checked for the record.
    6. Save.
  7. Navigate to Self-Service > Service Catalog.
    1. Click the Office category.
    2. Click the Services related category.
    3. Click the Finishing Services catalog item.

The cost is calculated regardless of whether the cost is displayed.

Note the many queries related to item_option_new, sc_cart_item, sc_item_option, sc_cat_item, fx_price, etc. Click the + sign at the end of the queries to expand the stack trace and make note of the stack traces:

com.glide.script.GlideRecord.query(GlideRecord.java:2707)
com.glideapp.servicecatalog.Cart.remove(Cart.java:452)
com.glideapp.servicecatalog.pricing.PriceGenerator.calcInitialPrice(PriceGenerator.java:94)
com.glideapp.servicecatalog.pricing.PriceGenerator.init(PriceGenerator.java:73)
com.glideapp.servicecatalog.pricing.PriceGenerator.(PriceGenerator.java:66)
com.glideapp.servicecatalog.ServiceCatalogLayoutService.getItemPrices(ServiceCatalogLayoutService.java:348)
com.glideapp.servicecatalog.tags.CatalogCartTag.initializeJellyContext(CatalogCartTag.java:117)
com.glideapp.servicecatalog.tags.CartTag.doTag(CartTag.java:31)

and

com.glideapp.servicecatalog.pricing.PriceGenerator.getDisplayPriceFromCartItem(PriceGenerator.java:153)
com.glideapp.servicecatalog.pricing.PriceGenerator.calcDisplayPrice(PriceGenerator.java:145)
com.glideapp.servicecatalog.pricing.PriceGenerator.calcTotalAndDisplay(PriceGenerator.java:126)
com.glideapp.servicecatalog.pricing.PriceGenerator.getPriceFromCartorRequestItem(PriceGenerator.java:104)
com.glideapp.servicecatalog.pricing.PriceGenerator.calcInitialPrice(PriceGenerator.java:93)
com.glideapp.servicecatalog.pricing.PriceGenerator.init(PriceGenerator.java:73)
com.glideapp.servicecatalog.pricing.PriceGenerator.(PriceGenerator.java:66)
com.glideapp.servicecatalog.ServiceCatalogLayoutService.getItemPrices(ServiceCatalogLayoutService.java:348)
com.glideapp.servicecatalog.tags.CatalogCartTag.initializeJellyContext(CatalogCartTag.java:117)
com.glideapp.servicecatalog.tags.CartTag.doTag(CartTag.java:31)

Workaround

There is no known workaround for this issue. If you are able to upgrade, review the Fixed In field below to determine the versions that have a permanent fix. You can also subscribe to this known error article (click Subscribe button at the top of the article) to receive notifications when more information is available about this issue.


Related Problem: PRB649987

Seen In

Eureka Patch 11 Hot Fix 2
Fuji Patch 10
Fuji Patch 11
Fuji Patch 8
Geneva Patch 4
Geneva Patch 7 Hot Fix 2
Geneva Patch 8

Fixed In

Geneva Patch 6 Hot Fix 1
Geneva Patch 7
Helsinki

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2017-04-10 06:14:59
Published:2016-05-15