To implement site custom functionality, a developer creates a new cartridge.
Which step should the developer take to ensure their cartridge changes take effect?
Screen image with “Active†“Log Category†and “Log Level†along the top. Under the log category are three lines. On the first line, there is an empty log category field. To the right of this empty field is the word “Info†under the log level. On the second line, the word “root†is under the log category and to the right of that is the word “Warn†under the log level. On the third line, a checked box is under “Active†with “myLogCategory†under the “log category†and to the right of that is the word “Info†under the log level. Beneath this information is the header “Custom Log Targets. Under this header is an empty space for an email with the Text “Messages with log level FATAL can be sent to email recipients†Below this is a list of log file to select log levels written to files. The following love levels are selected: “Fatalâ€, “Errorâ€, and “Warn†and the following log levels are not checked: “Info†and “Debugâ€
The developer wants to be able to view DEBUG level messages for myLogCategory in the Request Log tool. Given the custom log configurations in the image above, what does the developer need to do to accomplish this?
Which of these situations is an appropriate use of the B2C Commerce OCAPIs?
The developer needs to add custom category debug logging into the " contact " script, to ensure that a third-party service call responds as expected.
Assuming that the logging configurations for the contact category are correctly in place, which line of code should the developer add in the 06 placeholder to meet this requirement?
01varLogger=require( ' dw/system/Logger ' );
02varservice=dw.svc.LocalServiceRegistry.createService( ' contact.http.submit ' ,options);
03varserviceResponse=service.call(requestJSON);
04
05if(serviceResponse.ok) {
06// Insert logging code here
07}
A developer is implementing new Page Designer content on a merchant ' s Storefront and adds the line below to the setupContentSearch function in the searchHelpers.js file.
apiContentSearchModel.setFilteredByFolder(false);
What does this achieve?
Which is an appropriate use of the < isif > ISML tag that follows B2C Commerce and SFRA best practices?
A developer wants to configure multiple products that should only be sold as a group. It should not be possible for buyers to buy these products individually. How should the developer configure the products?
Which item is appropriate content for custom logs implemented at checkout?
What should a developer do to ensure that the gift vouchers are always available?
A developer needs to render a Page Designer page in JSON format. What is the correct syntax?
What is the expected result when the code segment executes with the logger configuration?
In the SFRA Page controller, the following route exists:
server.get( ' Include ' ,server.middleware.include,cache.applyDefaultCache,
function(req,res,next) {
...assume original code here...
next();
}
);
The result of navigating to the address below is an error page.
https://yourinstance/on/demandware.store/Sites-RefArch-Site/en_US/Page-Include?cid=about-us
What is the correct way to use this controller route in an ISML template?
Given a NewsletterSubscription custom object that has a key attribute named email of type String, what is the correct syntax to create the NewsletterSubscription custom object?
A developer is asked to implement a simple call to an authentication-protected REST web service.
Which configuration is valid?
A developer cannot create a custom object in Business Manager because the attributes do not show. The developer can view the object but not the attributes.
Which action should the developer take to resolve the problem?
To build the SFRA code to a developer sandbox for the first time, which build steps should the developer perform for the site to appear and function as designed?
A client has a requirement to allow users on the Storefront to filter by a newly created attribute. Which is necessary to achieve this?
A developer needs to update the package.json file so that it points to the hook file for a cartridge, using the hooks keyword.
Which snippet works correctly when added to the file?
What should a developer implement to enhance the functionality of an existing controller route?
A client has a requirement to allow users on the Storefront to filter by a newly created attribute.
After creating the search refinement, what else is necessary to achieve this?
A client sells its product in single-brand stores as well as in multi-brand stores. When shown in the store locator list, the client wants the single-brand stores to have a particular background color to highlight them.
Which Business Manager action should be completed to allow the developer to apply different styling to the single-brand stores?
A developer needs to perform the same additional checks before completing multiple routes in a custom controller, in order to decide whether to render a template or redirect the user to a different page.
According to SFRA best practices, what is the correct approach to improve code reusability in this scenario?
A developer implements the necessary code for a new Page Designer component.
What is the purpose of the JSON metadata definition file the developer creates?
Given the requirements:
• To show the washing instructions for a clothing product on a dedicated section of the detail page
• Washing instructions come from the product information manager (PIM)
• To have this attribute available to localize in the Storefront
Which action meets these requirements?
A merchant checked the " Show Orderable Products Only " preference in Business Manager.
What impact does this have on the Storefront from a user perspective?
A developer has the following files in template/resources:
• account.properties - > weight.unit=kilos
• account_en.properties - > weight.unit=stones
• account_en_US.properties - > weight.unit=pounds
Using the default locale configuration, what is the current outcome of the page that renders the account.isml template snippet below when visiting the Storefront with the English for Canada (en_CA) locale?
Your parcel weighs 10 ${Resource.msg( ' weight.unit ' , ' account ' ,null)}.
A developer working on a simple web service integration is asked to add appropriate logging to allow future troubleshooting.
According to logging best practices, which code should the developer write to log when an operation succeeds, but has an unexpected outcome that may produce side effects?
A controller route in the SFRA base looks as follows:
server.get( ' Show ' ,consentTracking.consent,cache.applyDefaultCache,
function(req,res,next) {
...base code omitted on purpose...
next();
},
pageMetaData.computedPageMetaData
);
In order to extend this route usingprepend(), what should the developer consider?
Recent code changes to an existing cartridge do not appear correctly on a Storefront. The developer confirms that the code is uploaded in the IDE and ensures that the cartridge is associated with the sandbox.
After checking the Storefront site cartridge path, which step should the developer take to troubleshoot this problem?
A developer customized the Cart-Show controller route with a LINK cartridge that adds social media data. There is a new requirement to add a dataLayer object to the Cart-Show controller route.
How should the developer achieve this to ensure that no code change will be needed if the client decides to remove the LINK cartridge?
The Home-Show route uses this middleware chain:
server.get( ' Show ' ,consentTracking.consent,cache.applyDefaultCache,
function(req,res,next) {
// base code here
}
);
The developer added Home.js in another cartridge, which is before the original cartridge in the cartridge path, to extend that route but it does not have the middleware chain:
server.append( ' Show ' ,function(req,res,next) {
// custom code here
});
Assuming the code is correct on both functions, what is the expected result?
Given a B2C Commerce client with these specifics:
Sells in two different countries: US and IN
Uses only the English language
A developer has a requirement to add a new field to the IN registration form that must not appear in the US one.
Which path should be created to accomplish this requirement?
A developer wants to add a link to the My Account page.
What is the correct code to accomplish this?
A developer is working on a new site for the U.S. based on an existing Canadian site. One of the requirements is a change to the address form. The current Canadian form has an < options > list with the correct two-letter abbreviation for the provinces.
The U.S. requirements are to:
Have an < options > list with the correct two-letter abbreviation for the states in place of the province field.
Set the U.S. site locale.
Add the options list field definition to the XML file.
How should the developer set up the files before making the required edits?
A client that sells sport shoes wants to allow its customers to filter products based on the intended activity (such as tennis, jogging, basketball, etc.), but this particular information is not present in the current catalog.
Which two actions does a developer need to perform in a B2C Commerce instance to allow this to happen?
Which snippet works correctly when updating the package.json file to point to the hook file for a cartridge?
A developer wants to configure the following products so that same search results are returned regardless of the search term used. The search term can be bag, purse, pocketbook, and tote. How should the developer configure this?
Given the following OCAPI definitions, which permission or permissions apply?
{
" resource_id " : " /sites/*/coupons/* " ,
" methods " :[
" put "
],
" read_attributes " : " (**) " ,
" write_attributes " : " (**) "
}
Given a template rendered by a controller with caching and a remote include without caching, which situation applies?
Which line of code should a developer add for custom category debug logging?
A merchant wants customers to be able to order gift vouchers via their site. Since they can issue an unlimited number of these digital vouchers, this item should be available to sell at all times.
How can a developer use Business Manager to ensure that the gift vouchers are always available?