Advanced Integrations/Customizations
The following provides a summary of the different points in the code that Shipped extends or customizes behavior. Manual integration of these code changes may be necessary when dealing with an existing codebase.
SFRA
- Templates
All changes within templates are denoted by the following starting and ending comments:- Shipped Widget
- cart/cart.isml and checkout/checkout.isml: Shipped Widget is added to the UI via inclusion of include/shippedWidget.isml.
- Checkout Order Summary
- checkout/orderTotalSummary.isml: A Shipped Line Item is added to the Order Summary section of the checkout page.
- Shipped Widget
- Controllers
In most cases, developer customization should not be necessary for Controller extensions.- Cart.js: In the case of a checkout placement for the Shipped Suite widget, “Show” is prepended to remove any Shipped line items.
- Checkout.js: “Begin” is prepended to ensure the correct Shipped line items are present.
- CheckoutServices.js: “PlaceOrder” is appended to enqueue the order for processing by Shipped Sync Orders job.
- Models
All changes within models are denoted by the following starting and ending comments:
// SHIPPED EXTENSION START
// SHIPPED EXTENSION END- totals.js:
- getOrderLevelDiscountTotal(lineItemContainer): Method has been overwritten to prevent Shipped order price adjustments from appearing as discounts.
- totals(lineItemContainer): Method has been extended to add a new order total attribute representing Shipped fees (shippedTotal).
- Client-side Javascript
- checkout/summary.js:
- updateTotals(totals): Method has been extended to show/hide the new Shipped fees line item in the checkout Order Summary.
- checkout/checkout.js:
- summaryHelpers variable has been replaced with the above-mentioned summary.js.
- updateCheckoutView has been duplicated in order to utilize the new summaryHelpers variable.
- checkout.js:
- File has been duplicated in order to utilize the new above-mentioned checkout/checkout.js file
- checkout/summary.js:
- totals.js:
SiteGenesis
- Templates
All changes within templates are denoted by the following starting and ending comments: <!-- SHIPPED EXTENSION END →
Or the following comments if within Javascript code:
// SHIPPED EXTENSION START
// SHIPPED EXTENSION END- Shipped Widget
- checkout/cart/cart.isml and checkout/shipping/singleshipping.isml: Shipped Widget is added to the UI via inclusion of include/shippedWidget.isml.
- Checkout Order Summary
- components/order/ordertotals.isml: A Shipped Line Item is added to the Order Summary section. The Shipped fee is removed from the Discount line item.
- Shipped Widget
- Controllers
All changes within controllers are denoted by the following starting and ending comments:
// SHIPPED EXTENSION START
// SHIPPED EXTENSION END- Cart.js: In the case of a checkout placement for the Shipped Suite widget, show() is prepended to remove any Shipped line items.
- COShipping.js: start() is prepended to ensure the correct Shipped line items are present.
- COSummary.js: submit() is appended to enqueue the order for processing by Shipped Sync Orders job.
Updated almost 2 years ago