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

  1. Templates
    All changes within templates are denoted by the following starting and ending comments:
    1. Shipped Widget
      • cart/cart.isml and checkout/checkout.isml: Shipped Widget is added to the UI via inclusion of include/shippedWidget.isml.
    2. Checkout Order Summary
      • checkout/orderTotalSummary.isml: A Shipped Line Item is added to the Order Summary section of the checkout page.
  2. Controllers
    In most cases, developer customization should not be necessary for Controller extensions.
    1. Cart.js: In the case of a checkout placement for the Shipped Suite widget, “Show” is prepended to remove any Shipped line items.
    2. Checkout.js: “Begin” is prepended to ensure the correct Shipped line items are present.
    3. CheckoutServices.js: “PlaceOrder” is appended to enqueue the order for processing by Shipped Sync Orders job.
  3. Models
    All changes within models are denoted by the following starting and ending comments:
    // SHIPPED EXTENSION START
    // SHIPPED EXTENSION END
    1. totals.js:
      1. getOrderLevelDiscountTotal(lineItemContainer): Method has been overwritten to prevent Shipped order price adjustments from appearing as discounts.
      2. totals(lineItemContainer): Method has been extended to add a new order total attribute representing Shipped fees (shippedTotal).
    2. Client-side Javascript
      1. checkout/summary.js:
        • updateTotals(totals): Method has been extended to show/hide the new Shipped fees line item in the checkout Order Summary.
      2. 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.
      3. checkout.js:
        • File has been duplicated in order to utilize the new above-mentioned checkout/checkout.js file

SiteGenesis

  1. 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
    1. Shipped Widget
      • checkout/cart/cart.isml and checkout/shipping/singleshipping.isml: Shipped Widget is added to the UI via inclusion of include/shippedWidget.isml.
    2. 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.
  2. Controllers
    All changes within controllers are denoted by the following starting and ending comments:
    // SHIPPED EXTENSION START
    // SHIPPED EXTENSION END
    1. Cart.js: In the case of a checkout placement for the Shipped Suite widget, show() is prepended to remove any Shipped line items.
    2. COShipping.js: start() is prepended to ensure the correct Shipped line items are present.
    3. COSummary.js: submit() is appended to enqueue the order for processing by Shipped Sync Orders job.