There is a business requirement that a 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)

Suggested Answer: B
Get Premium CCM-101 Questions
as Interactive Web-Based Practice Test or PDF
Real Exam Format
Detailed Explanations
Instant Access
Get Your Practice Test
33 comments · newest first
NY
Nydia
11 months ago
Not sure about Option C, it feels a bit convoluted.
GR
Graciela
11 months ago
I agree with Harris, A seems straightforward.
CH
Charlie
12 months ago
Wait, can you really call a hook like that? Seems off.
AM
Amie
12 months ago
I think Option B is better, it handles errors more gracefully.
HA
Harris
1 year ago
Option A looks solid, it directly calls the function.
DA
Dacia
1 year ago
If I recall correctly, we might need to use the `require` statement to include the base cartridge before calling the function, but I’m not 100% sure.
FR
Frank
1 year ago
I’m a bit confused about the differences between the options. I feel like I need to review how to properly call functions from different cartridges.
LI
Lizbeth
1 year ago
I remember practicing a similar question about invoking hooks in custom cartridges. I think it might involve using the correct syntax for the hook.
TA
Tammara
1 year ago
I think we need to ensure that the custom controller properly references the calculateTax function, but I'm not entirely sure how to structure that call.
CU
Curt
1 year ago
This is a good test of our understanding of the SFRA framework. I'll need to double-check my knowledge, but I'm feeling confident I can figure this out.
SH
Shad
1 year ago
Based on the code snippets, I think Option B is the way to go. It looks like the most straightforward way to invoke the calculateTax function.
RA
Raina
1 year ago
I'm a bit confused by the wording of the question. Can someone clarify what the "dw, order calculateTex hook" is exactly?
TU
Tula
1 year ago
Okay, I think I've got a handle on this. Let me walk through the options and see which one makes the most sense.
PA
Page
1 year ago
Hmm, this looks like a tricky one. I'll need to carefully review the code snippets and think through the different options.
PE
Peggie
1 year ago
I'm a bit confused here. Do we need to throw an error or continue the flow run? I'll have to double-check the details.
VI
Vicente
2 years ago
Options A and C both look good, but I'm feeling a bit taxed trying to decide. Maybe I need to calculate the pros and cons of each.
OM
Omer
2 years ago
Hmm, I wonder if the calculateTax() function accepts any special parameters. Better double-check the documentation!
LY
Lynette
2 years ago
Option A seems a bit overkill. Why create a new module when we can just call the existing calculateTax() function?
WI
Willie
2 years ago
User 3: Let's go with Option B then, it seems like the simpler solution.
LA
Lauran
2 years ago
User Comment: I agree, we should just call the existing function.
TR
Trinidad
2 years ago
Option A seems like a lot of extra work.
ME
Melodie
2 years ago
I'm not sure about Option B. Doesn't that involve creating a new hook instead of using the existing one?
EV
Evangelina
2 years ago
Yes, Option A seems like the right way to implement the call without creating a new hook.
LE
Leonora
2 years ago
I think Option A would be better since it directly calls the existing calculateTax hook.
PA
Patria
2 years ago
Option B involves creating a new hook, so it might not be the best choice.
FR
France
2 years ago
Option C looks like the way to go. Invoking the calculateTax() function from the custom controller seems straightforward.
JO
Jovita
2 years ago
Let's go with Option C then.
IS
Isadora
2 years ago
I agree, invoking the calculateTax() function from the custom controller seems like the right approach.
TA
Tashia
2 years ago
Yeah, it looks like the most straightforward way to implement the call.
JE
Jeannetta
2 years ago
I think Option C is the best choice.
TY
Ty
2 years ago
That's a good point, but I still think Option A is the most straightforward solution for this requirement.
RI
Rikki
2 years ago
I disagree, I believe Option B is the best choice because it provides a more efficient way to invoke the calculateTax function.
TY
Ty
2 years ago
I think the developer can implement the call by using Option A.