Notifications

598 views

Description

The Buy Item REST API unexpectedly adds item to default cart.

Steps to Reproduce

 

  1. Open a zbooted instance.
  2. Ensure that the two-step checkout property is false.
  3. Navigate to Service Catalog > Catalog Definitions > Maintain Items.
  4. Open the Standard Laptop item.
  5. Right-click in the header bar and select Copy sys_id.
  6. Navigate to System Web Services > REST > REST API Explorer.
  7. Launch the REST API explorer with the following specifications:
    • Namespace: sn_sc
    • API Name: Service Catalog
    • API Version: latest
  8. Click the Buy Item (POST) REST API.
  9. In the sys_id Value field, paste the sys id copied in step 5.
  10. Under Request Body, in the Raw tab or section, type {'sysparm_quantity':2,'variables':{}}.
  11. Click Send.
  12. Navigate to the Self-Service > Service Catalog page.
    Note that the item is in the Shopping cart widget, which is unexpected.The order has already been placed so there should not be any items in the cart.

Workaround

Set the property named glide.sc.enable_order_now to false. The Buy Item REST API does the order without adding the item to the default cart.
 
Note that if the property is disabled, clicking "Order Now" from the user interface orders the current item along with the default cart items. This was the behavior in the Helsinki release. If you need the Istanbul behavior where clicking "Order Now" only orders the items and keeps the default cart items intact, follow these steps:
  1. Navigate to Service Catalog > Catalog Definitions > Maintain Cart Layouts.
  2. Open the Item Ordering Widget.
  3. In Buttons tab or section, do the following:
    • Select Order Item
    • Clear Order Now
  4. In Button Labels tab or section, change the label of Order Item to Order Now.
  5. Click Update.

Related Problem: PRB733964

Seen In

Istanbul

Fixed In

Jakarta

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2017-09-06 09:04:54
Published:2017-09-06