Controllers are server-side scripts that handle storefront requests. Controllers manage the flow of data in your application, and create ViewModels to process each storefront request as a route and generate an appropriate response. For example, in a storefront application, clicking a category menu item or entering a search term triggers a controller that renders a page.
To support the Salesforce Payments functionality in SiteGenesis, you add or modify the following controllers to modify Checkout, Cart, Mini-Cart, and Product Detail Pages.
Controller Modifications
Cart.js
–Controller that adds and removes products
and coupons in the cart. Also provides functions for the continue shopping button and minicart.paymentHelpers
script from plugin_commercepayments
COBilling.js
–Controller for the billing logic. It’s used by
both the single shipping and the multishipping functionality and is responsible for payment
method selection and entering a billing address.
COSsummary.js
–Controller that implements the last step of
the checkout. A successful handling of billing address and payment method selection leads to
this controller. It provides the customer with a last overview of the basket before confirming
the final order creation.