Question 36

A Newsletter controller contains the following route:
Server.post('Subscribe', function (req,res,next){
var newsletterForm = server.forms.getForm('newsletter');var CustomObjectMgr = require('dw/object/CustomObjectMgr'); if(newsletterForm.valid){ try{ var CustomObject = CustomObjectMgr.createCustomObejct('NewsletterSubscription', newsletterform.email.value); CustomObject.custom.firstName = newsletterForm.fname.value; CustomObject.custom.lastName = newsletterForm.lname.value;-
} catch(e){
//Catch error here
}
}
next();
});
Assuming the Custom Object metadata exists, why does this route fail to render the newsletter template when the subscription form is correctly submitted?
  • Question 37

    Which technical reports datapoint measures the performance of a controller's script execution if network factors and Web Adaptor processing is ignored?
  • Question 38

    A Digital Developer is requesting product information for an external integration. The following Open Commerce API (OCAPI) request is NOT functioning correctly:

    How should the Developer change the request?
  • Question 39

    Given a sandbox with an active slot configuration with the following specifications:
    * Content type set to product
    * With some product configured
    * With the following rendering template: slots/product/product_1x2 isml
    * Correctly enabled and scheduled
    And given the code contained in the selected rendering template:

    Is an additional action needed for this to work as intended?
  • Question 40

    Given the customer basket described below:
    * A customer has an existing basket that consists of multiple items.
    * One of the items is identified as a gift item by an attribute at the product line item.
    The developer needs to write custom code to fetch the customer basket and then modify the basket based upon the items in the cart. If the basket contains any gift items, modify the basket and create a separate shipment for the gift item.
    Four hooks are required to make the modification, beginning with modifyGETRespone and ending with validatebasket.
    * Dw.ocapi.shop.basket.modifyGETResponse
    * -- missing hook -
    * -- missing hook --
    * dw.ocapi.shop.basket.validateBasket
    What are the two missing hooks in the middle?