Black Friday Special Sale - Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: mxmas70

Home > Salesforce > Developers > B2C-Commerce-Developer

B2C-Commerce-Developer Salesforce Certified B2C Commerce Developer (SU24) Question and Answers

Question # 4

When exporting a price book from an externalsystem, which file format or formats should a developer use so it can be imported into a B2C Commerce site?

A.

JSON only

B.

XML only

C.

CSV only

D.

XML and CSV

Full Access
Question # 5

A Digital Developer wants pass control to an ISML template from a JavaScript Controller and load product on thepipeline dictionary with the name myProduct.

Which code sample will achieve this?

A.

ISML.renderTemlpate ( "helloworld.isml", { "myProduct": "product" });

B.

ISML.renderTemlpate ( "helloworld.isml", { "product": myProduct });

C.

ISML.renderTemlpate ( "helloworld.isml", { product: myProduct });

D.

ISML.renderTemlpate ( "helloworld.isml", { myProduct: product });

Full Access
Question # 6

Universal Containers requires that a new order comments attribute is added to the existing SiteGenesis checkout flow. This new attribute needs to be included as part of the standard order export.

Aside from updating the HTML markup and form definition, which option contains all necessary steps to achieve this task?

A.

• Add the new attribute to the "Order" system object.• Modify the "COPIaceOrder" controller to add this new attribute to the current session's "Order" object.

B.

• Modify the "COPIaceOrder" controller to update a CSV file in the IMPEX WebDAV directory with the order ID and comments.• Modify the order export process to read information in the CSV file and include it as part of the export.

C.

• Add the new attribute to the "Customer" system object.• Modify the "COPIaceOrder" controller to add this new attribute to the current session's "Customer" object.

D.

• Create a new custom object type for order comments that contains the attributes: order ID and comments.• Modify the "COPIaceOrder" controller to create a new order comments custom object upon order completion.

Full Access
Question # 7

In order to implement site custom functionality, a developer creates a new cartridge.

Which step should the developer take to ensure their cartridge changes take effect?

A.

Add the new cartridge to the cartridge path for the business Manager site.

B.

Rebuild the site indexes to capture incremental changes.

C.

Add the new cartridge to the cartridge path for the relevant Storefront site.

Full Access
Question # 8

A Digital Developer selects “Show Orderable Products Only” in the Search > Search Preferences Business Manager module.

Which business goal does this accomplish?

A.

Exclude products from search results ifAvailable to Sell (ATS) = 0.

B.

Exclude back-ordered products from showing on the website.

C.

Block displaying the product detail page if Available to Sell (ATS) = 0.

D.

Exclude pre-order products from search results.

Full Access
Question # 9

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.

Ensurethe attribute has data and is indexed

B.

Set the attribute as Searchable.

C.

Change the productsearchrefinebar.isml template.

Full Access
Question # 10

A merchant has a new requirement to accept American Express credit cards on its Storefront. A credit card payment method already exists.

Which step must a developer take in Business Manager to achieve this?

A.

In Payment Methods, enable American Express as a credit card type.

B.

Add American Express intothe Order settings in Site Preferences.

C.

In Payment Processor, create American Express as a payment type.

D.

Add American Express as a Payment Preference in Site Preferences.

Full Access
Question # 11

A merchant has complained to the developers that some products are not appearing in the storefront and has asked them to diagnose and solve the issue.

Which two factors might be causing a product to be hidden?

Choose 2 answers

A.

Product has been set to searchable.

B.

Product lacks a price.

C.

Product does not have any images.

D.

ProductAvailable to sell is <1.

E.

Product is not online.

Full Access
Question # 12

Universal Containers is preparing their storefront to use Open Commerce APIs (OCAPI).

To which hook should the Digital Developermove taxation logic to ensure consistent order totals within B2C Commerce?

A.

dw.ocapi.shop.order.validateOrder

B.

dw.ocapi.shop.basket.calculate

C.

dw.ocapi.shop.basket.afterPostShipment

D.

dw.ocapi.shop.order.afterPOST

Full Access
Question # 13

A Digital Developer is working on a multi-site realm. A new site requires a different layout for the account landing page. The business logic and datamodel remain the same. The existing code is in AccountControl.js and accountlanding.isml in the app_storefront cartridge. The app_storefront cartridge contains code for all other business functions. The cartridge path for the new site is currently int_cybersource:int_paypal:app_storefront.

The Developer creates a new cartridge named app_newsite that contains only the accountlanding.isml template for the new site.

Which modification should be made to the new cartridge path?

A.

Set the cartridge path sothat app_newsite is before app_storefront.

B.

Set the cartridge path so that app_storefront is before int_cybersource.

C.

Set the cartridge path to include only app_newsite.

D.

Set the cartridge path so that app_newsite is after app_storefront.

Full Access
Question # 14

A NewsletterSubscription custom object exists that has a key attribute named email of type String and the following script code.

However, the NewsletterSubscription custom object is not persisted.

What is a possible reason?

A.

The code shownneed to be wrapped in a transaction.

B.

The code shown needs to be wrapped in a try/catch block.

C.

The code shown is the wrong syntax. The correct syntax is:

Full Access
Question # 15

A Digital Developer is asked to optimize controller performance by lazy loading scripts as needed instead of loading all scripts at the start of the code execution.

Which statement should the Developer use to lazy loadscripts?

A.

importPackage () method

B.

$.ajax () jQuery method

C.

local include

D.

require () method

Full Access
Question # 16

A developer hasa sandbox configured with a service and its profile and credential. Now there is a requirement to allow changes to the service URL manually from the sandbox.

Which B2C feature should the developer use to achieve the request?

A.

Use the service credentialURL field

B.

Use the service status area, set the override URL checkbox, and then populate the URLfield with the required one.

C.

Use a Sitepreference dedicated for the service URL

D.

Use a Globalpreference dedicated for the service URL

Full Access
Question # 17

A developer wants to configure the following products so that same search results ire returned regardless of the search term used. The search term can be bag, purse, pocketbook, and tote. Mow should the developer configure this?

A.

Synonyms

B.

Hypernyms

C.

Hyponyms

Full Access
Question # 18

A Digital Developer is implementing an Open Commerce API call to add products to a basket. Given the following resource configuration:

Which modification allows the requests to successfully execute?

A.

Change the "resource_id" value to: "/baskets/*/items".

B.

Change the "write_attributes" value to: "(+items)".

C.

Change the "read_attributes" value to: "(items)".

D.

Change the "methods" value to: ["get", "post"].

Full Access
Question # 19

A DigitalDeveloper has a new requirement to disable the "Discover" credit card type for all checkouts.

What does the Developer need to change in Business Manager to fulfill this requirement?

A.

Checkout exclusion rules in the Merchant Tools > Site Preferences > Checkout Preferences module.

B.

Credit card exclusion rules in the Merchant Tools > Site Preferences > Payment Preferences module.

C.

Credit cards in the Merchant Tools > Ordering > Payment Methods module.

D.

Credit card exclusion rules in the CreditCardType.json configuration file.

Full Access
Question # 20

Refer to the screen shot below:

Given a site called RefArch that has the settings shown, whatmust be done for RefArch to use the same customer list as RefArchGlobal?

A.

Import the RefArchGlobal customer list into the RefArch site.

B.

Enable "Customer List Sharing" in Global Preferences.

C.

Select RefArchGlobal in the dropdown for Customer List.

D.

Enable "Customer List Sharing" in Site Preferences.

Full Access
Question # 21

A Digital Developer extends a system object, Product, andadds a Boolean attribute, “sellable,” to it.

Assuming “prod” is the variable name handling the product, what code can the Developer use to access it?

A.

prod.extended.sellable

B.

prod.sellable

C.

prod.persistable.sellable

D.

prod.custom.sellable

Full Access
Question # 22

A client sells its products in North America, Europe, and Asia, and has a B2C Commerce Site for each of these markets. The client receives three area-specific snippets of analytics code by a third-party provider to insert in the sites.

How should the developer configure an instance to allow the merchant to independently insert and update these snippets?

A.

Create a new "HTML" attribute in the SitePreference object type.

B.

Use ISML conditional tags to add the snippet into the codebase.

C.

Configure a new Service Profile with the provided snippet of code.

Full Access
Question # 23

A business user wants to add a link to a content page from within the body of another content asset. The target content asset ID is: terms-and-conditions.

Which link function generates the correct link?

A.

$include(‘Page-Include’, ‘cid’,‘terms-and-conditions’)$

B.

$http(‘Content-Page’, ‘cid’, ‘terms-and-conditions’)$

C.

$httpUrl(‘Content-Show’, ‘cid’, ‘terms-and-conditions’)$

D.

$url(‘Page-Show’, ‘cid’, ‘terms-and-conditions’)$

Full Access
Question # 24

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?

A.

Custom Objects can only be created by Job scripts

B.

The Subscribe route is missing the server.middleware.httpt middleware.

C.

The CustomObjectMgr variable should be declare outside of the route.

D.

The Custom Object creation is not wrapped in a Transaction.

Full Access
Question # 25

A developer has these requirements for out-of-stock products:

Save the SKUs of the out-of-stock products that the customer is interested in

Save the customer email regardless if the customer is a guest or registered

Email the customer whenthe product is back-in-stock

Which step should the developer perform as part of the solution to achieve the requirements?

A.

Create a new set-of-string type custom attribute to the system object type Profile to save all the SKUs and use the existing emailfield for the email.

B.

Create a new system object type that has a set-of-string type custom attribute for the SKUs and a string for the email field.

C.

Create a new custom object type that has a set-of-string type custom attribute for the SKUs and a string for the email field.

D.

Create a new set-of-string type custom attribute to the system object type Product to save all the customer email addresses for back-in-stock notification.

Full Access
Question # 26

Reference the following code snippets that allow a form to function correctly.

Which code should a developer insert at the EXPRESSION placeholder m the ISML template snippet above to have the form work as expected?

A.

pdict.newslettersFrom

B.

Pdict, newsletter

C.

sowslettersform

Full Access
Question # 27

A developer observed a specific issue in production, which they cannot reproduce in other environments. The developer wants to do a hot fix to one of the ISMLpages, which uses tag, to see if that resolves while issue. Which consideration must the developer keep in mind while deploying the hot fix in production?

A.

It will be required to invalidate the cache for the hot fix.

B.

If the page has multipletags, the highest cache duration will be used in production to determine the resulting page's caching behavior.

C.

The TTL cache setting only affects static content and not the page cache, which could potentially cause he production issue.

Full Access
Question # 28

Assume the code below is executing:

Business Manager has the configuration:

    Active Log category is “root” with log level of “info.”

Given this information, what is the beginningof the filename in which the log will be written?

A.

xyz

B.

custominfo-blade

C.

custom-export

D.

custom-xyz

Full Access
Question # 29

Given a template rendered by a controller with caching and a remote include without caching, which situation applies?

A.

Both the remote include portion and the rest of the page are cached.

B.

The remote include portion is not cached, but the rest of the page is cached.

C.

The page is cached only for returning customers because of the remote include.

D.

The page is not cached because the remote include introduces an uncached portion.

Full Access
Question # 30

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.

Whichaction should the developer take to resolve the problem?

A.

Change the data type of the attributes.B Create an Attnbute Group with the desired attributes in it.

B.

Set the attributes to site-specific replicable.

Full Access
Question # 31

A Digital Developer must resolve a performance issue with product tiles. The Developer determines that the product tiles are NOT being cached for a long enough period.

Which two methods can the Developer use to verify the cache settings for the product tiles? (Choose two.)

A.

Enable cache information in the storefront toolkit and view the cache information for theproduct tile.

B.

View the cache information provided by the Merchant Tools > Technical Reports Business Manager module.

C.

View the product list page cache settings provided in the Administration > Manage Sites Business Manager module.

D.

Enable the template debugger to verify the cache times for the producttile.isml template.

Full Access
Question # 32

A merchant uploads an image using the ContentImage Upload module of Business Manager.

Which three modules can the merchant or developer use to display the image on the Storefront?

Choose 3 answers

A.

ISML templates

B.

Content assets

C.

Storefront catalogs

D.

Content slots

E.

Payment types

Full Access
Question # 33

A developer is tasked with implementing the necessary code for a new Page Designer component.

What are the two purposes of the JSON metadata definition file that the developer creates7

Choose 2 answers

A.

Defines regions within the component type.

B.

Defines the responsive layout of the rendered template.

C.

Defines the business and rendering logic of the component required by the merchant.

D.

Defines theattributes that a merchant enters when using the component type.

Full Access
Question # 34

Given the following snippet:

Server.append( ‘Show’ , function (req, res, next) )

According to SFRA, which two optionsshows a correct way to complete the code above in order to provide

data to the response using a controller?

Choose 2 answers

A.

res.viewData = {data: myDataObject};res.render(‘/content/myPage’);next();});

B.

res.setViewData ({data: myDataObject});res.render(‘/content/myPage’);next();});

C.

res.render(‘/content/myPage’,{data: myDataObject});next();});

D.

res.render(‘/content/myPage’);next();}).append{(Data:myDataObject});

Full Access
Question # 35

There is a business requirement thata custom controller in app_custom_my_cartridge invokes the calculateTax(basket) function of the dw, order calculateTex hook that is defined in app_storefront_base. How can the developer implement this call?

A)

B)

C)

A.

Option A

B.

Option B

C.

Option C

Full Access
Question # 36

A client has a requirement to render different content on the homepage based on if the customer is logged in or guest user.

What should a developer implement to achieve this requirement?

A.

Write specific custom code in the Content Asset for a customer that is a registered, versus unregistered, user.

B.

Set the Content Slot configuration so it is based on the system customer group registered, versus unregistered.

C.

Set the Content Asset configuration for a customer that is a registered, versus unregistered, user.

D.

Add specific custom messages in Page Designer for a customer that is a registered, versus unregistered, user.

Full Access
Question # 37

A developer has a sandbox with code to log a message during execution, and the following code:

After the codeexecutes, the developer does not see any log file with the message in the WebDAV folder. Which two tasks does the developer need to perform to correct this issue?

Choose 2 answers

A.

Request that the developer's account be given permission to the Log Center of the current realm.

B.

Set the root log level to debug.

C.

Check the box for Info under Log Files.

D.

Set the logging global preference to true.

Full Access
Question # 38

Given the sandbox with:

Service configured and assigned to its profile and credential

A code version that uses that service

And given the requirement to limit the number of success or error calls the code can perform to a restricted number ofcalls per second.

Which configuration should the developer perform?

A.

Set the service as limited and change the services profile site preferences with the required values.

B.

Set the rate limiter in the service profile and configure its values with the ones required.

C.

Set a new quota limit for the service profile and assign the service to it.

Full Access
Question # 39

Universal Containers calls thefollowing combination of products “The Basics” and sells the combination as a unique product ID:

    One Model 103 container

    Five Model 611 container

    Tree Model 201 container

The Developer created these three products in the catalog.

What is the next stepin Business Manager to create “The Basics” as a combination?

A.

In the Product Bundles module, create a bundle named “The Basics”.

B.

In the Products module, create a product named “The Basics” and add the products to the Product Bundles tab.

C.

In the Products module, create a product named “The Basics” and add the products to the Product Sets tab.

D.

In the Product Sets module, create a product set named “The Basics”.

Full Access
Question # 40

A developer needs to check for product inventory in all inventory lists using the Open Commerce API.

An example requestURL is:

Which properly should the developer check in the OCAPI settings to confirm the appropriate resource is enabled?

A.

Client_id

B.

Ecom-inventory

C.

Inventory_list

Full Access
Question # 41

A developer has the following files in template/resources:

account.proierties

weight.unit=kilos

account_en.propierties

weight.unit=stones

account_en_US.propierties

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 Sofrefront with the English for Canada(en_CA) locale=

Your parcel weighs 10 ${Resource.msg(‘weight.unit’,’account’)}

A.

Your parcel weighs 10 stones.

B.

Your parcel weighs 10 pounds.

C.

Your parcel weighs 10 undefined.

D.

Your parcel weighs 10 kilos

Full Access
Question # 42

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.

Which two additional steps should the developer take to troubleshoot this problem?

Choose 2 answers

A.

Check that the search index was recently rebuilt.

B.

Check the Business Manager site cartridge path.

C.

Check the Storefront site cartridge path.

D.

Check that the correct code version is selected.

Full Access
Question # 43

A developer isimplementing new Page Designer content on a merchant's Storefront and adds the line shown below to the setupCsntentSearch function in the searchHelpers.Js file.

What does this achieve?

A.

Allows Page Designer pages and components to be searchable

B.

Prevents Page Designer pages from being searchable

C.

Allows filtering Page Designer pages by folder

Full Access
Question # 44

The Home-Show route uses this middleware chain:

The developer added Home.;s 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:

Assuming the code is correct on both functions, what is the expected result?

A.

A RunTime error is thrown, "Error: Params do not match route".

B.

The base code executes and then the custom code executes.

C.

The custom code executes and then the base code executes.

D.

The base code executes, but the custom code is ignored becausethe signature lines do not match.

Full Access
Question # 45

Which three techniques improve client-side performance in production while following documented best practices? (Choose three.)

A.

Use one style sheet for each ISML decorator template.

B.

Place CSS outside of templates.

C.

Compress CSS.

D.

Use inline Javascript.

E.

Combine several images into a single image.

Full Access
Question # 46

Business Manager has the configuration:

Active Log category is "root"

Log level of WARN

The code below is executing:

var log = Logger.getLogger("products");

Using this information, which two logs will be written?

Choose 2 answers

A.

log.warn("This is a warn message");

B.

log.error("This is an error message");

C.

log.info("This is an info message");

D.

log.debugfThis is a debug message");

Full Access
Question # 47

Adigital instance has one site, with one master product catalog separate from the site catalog. Some, but NOT all, products in the master catalog are assigned to categories of the site catalog.

Using Business Manager, how can a Digital Developer create a catalog export file that contains only the products assigned to the site catalog?

A.

Use the Catalog Export module to export the site catalog.

B.

Use the Catalog Export module to export the master catalog, with a category-assignment search to export specific products.

C.

Use the Site Import & Export module to export both the site catalog and the master catalog in a single archive.

D.

Use the Site Import & Export module to export the master catalog, filtered by site catalog categories to export specific products.

Full Access
Question # 48

A Digital Developer has been given a specification to integrate with aREST API for retrieving weather conditions. The service expects parameters to be form encoded.

Which service type should the Developer register?

A.

FTP

B.

SOAP

C.

HTTP Form

D.

WebDAV

Full Access
Question # 49

Universal Containers needs to have Apple Pay disabled for the country of Spain.

Which Business Manager module should the Developer use to meet this requirement?

A.

Merchant Tools > Ordering > PaymentMethods

B.

Merchant Tools > Site Preferences > Apple Pay

C.

Merchant Tools > Ordering > Payment Processors

D.

Merchant Tools > Site Preferences > Payment Types

Full Access
Question # 50

A merchant has a requirement to render personalized content ton a category page via a Content Slot that

targets VIP high-spending customers during a specific promotional period.

Which two items should the developer create to achieve the specified requirements?

Choose 2 answers:

A.

VIP Customer Group

B.

Page Template

C.

Slot Configuration

D.

Rendering Template

Full Access
Question # 51

A developer is asked to create a controller endpoint that will be used in a client-side AJAX request. Its purposes is to displayupdated information to the user when the request is completed, without otherwise modifying the appearance of the current page.

According to SFRA practices, which method best supports this objective?

A.

res.json()

B.

res.render()

C.

res.print()

Full Access
Question # 52

A client that sells sport shows wants to allow its customers to filer 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 two happen?

A.

Createa new Product custom attribute AND add a new Search Refinement Definition for the desired categories.

B.

Create a new ProductRefinement custom attribute AND add a new Search Refinement Definition for the desired categories.

C.

Create a new Product customattribute AND add a new viewtype in the storefront catalog settings

Full Access
Question # 53

A new product has been added to the Storefront catalog that 15 assigned to a site

Which configuration does a developer need to ensure to have a new product visible in the Storefror

A.

The search index is built AND the product is online and searchable.

B.

The product has a master product AND the search index is built.

C.

The product has a price AND the product rs online and searchable.

Full Access
Question # 54

A developer is asked to create a new service instance that will call a remote web service.

Which method should the developer use to create the service instance?

A)

B)

C)

A.

Option A

B.

Option B

C.

Option C

Full Access
Question # 55

A Digital Developer suspects a logical error in a script.

Which action will help locate the error?

A.

Submit a support ticket to B2C Commerce.

B.

Check request logs for evidence ofthe logical error.

C.

Put breakpoints in the code, debug, and examine variable values.

D.

Print all values in the script node called before the current script.

Full Access
Question # 56

A developer uses hooks for an extension point. Which n true for running multiple hooks for an extension point?

A.

It is possible to register multiple modules to call for an extension point in a singlehooks.json file

B.

It is possible to control the order in which registered modules are called.

C.

If you call multiple modules, only the first hook called returns a value

Full Access
Question # 57

A developer has custom debug statements in a script, but the messages are not showing up in the

Storefront Toolkit Request Log.

Which step needs to be completed to get the messages to appear in the Request Log?

A.

In Global preferences, check the box for Enable custom logging in Request Log.

B.

In Site Preferences, check the box for Enable custom Logging in Request Log

C.

In Custom Log Settings, check the DEBUG box for Select Log Levels Written to Files.

D.

In custom Log Settings, activate the loggin category at DEBUG level.

Full Access
Question # 58

Given the following conditions:

Site export file with a copy of the Storefront data for a custom site

Sandbox with the custom site code, but no Storefront data

Requirement for a working copy of SFRA for development reference

A developer is assigned the following Business manager tasks:

A) Import the custom Site using Site Import/Export

B) Import the SFRA Demo Sites using Site Import/Export

C) Rebuild the custom Site search indexes

In what sequence should the developer perform the tasks, so that the custom Site displays the products as intended?

A.

Task A, then C, then B

B.

Task B, then C, then A

C.

Task A, then B, then C

D.

Task B, then A, then C

Full Access
Question # 59

A client has three different sites with three locales. Two of the sites share a library and one site has a private library.

What does the shared library allowin this context?

A.

Sharing content slots between sites

B.

Sharing content assets among locales

C.

A Sharing content assets between sites

D.

Sharing content slots among locales

Full Access
Question # 60

A developer needs to perform the same additional checks before completing multiple routes in a custom controller, in orderto 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.

Define a new middleware function and use it in the existing routes.

B.

Append a new function to all the existing routes with the server module.

C.

Replace the existing routes by creating a controller in separate new cartridge.

D.

Use the superModule property in the existing routes to extend their functionality.

Full Access