ExamGecko
Question list
Search
Search

Question 65 - Certified B2B Commerce Developer discussion

Report
Export

When a user buys 10 units of product B, the user wants 1 unit of Product A to be automatically added to the cart. How can this requirement be fulfilled?

A.
Override the AllowCheckout method in ccrz.cc_api_CartExtension
Answers
A.
Override the AllowCheckout method in ccrz.cc_api_CartExtension
B.
Override the prepareForSave method in ccrz.cc_api_CartExtension
Answers
B.
Override the prepareForSave method in ccrz.cc_api_CartExtension
C.
Override the preprocess method in ccrz.cc_api_CartExtension
Answers
C.
Override the preprocess method in ccrz.cc_api_CartExtension
D.
Override the prepareToAdd method in ccrz.cc_api_CartExtension
Answers
D.
Override the prepareToAdd method in ccrz.cc_api_CartExtension
Suggested answer: D

Explanation:

To automatically add 1 unit of Product A to the cart when a user buys 10 units of Product B, the requirement can be fulfilled by overriding the prepareToAdd method in ccrz.cc_api_CartExtension. This method is responsible for preparing the cart line items before they are added to the cart. By overriding this method, the user can check the quantity and product ID of the cart line items and add an additional cart line item for Product A if the condition is met. Salesforce

Reference:B2B Commerce and D2C Commerce Developer Guide,API Classes,cc_api_CartExtension Class

asked 23/09/2024
Joel Hernandez
41 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first