Skip to content

Component Name: orderConfirmationResources

Last Updated: 2025-09-29 Source Code: https://bitbucket.org/i2cinc/i2c.salesforce.metadata/src/STAGING/force-app/main/default/lwc/orderConfirmationResources

API Name: c-orderConfirmationResources Type: Display Component Target: lightningCommunity__Page, lightningCommunity__Default, lightning__AppPage, lightning__RecordPage, lightning__HomePage

Business Purpose

Displays post-purchase resources and information on order confirmation pages. Shows downloadable products with links, PAC information video if order contains membership or PAC products, and links to member resources. Conditional rendering based on order contents.

User Interface

  • Layout: Centered content sections
  • Key UI Elements: Product download table, resource links, YouTube video (conditional), support info
  • Responsive: Full-width on mobile, centered on desktop

Component Structure

Files

  • orderConfirmationResources.html - Template (67 lines)
  • orderConfirmationResources.js - Controller (148 lines)
  • orderConfirmationResources.js-meta.xml - Multi-target

JavaScript Controller

Properties (API)

@api accountType

  • Type: String
  • Default: 'Person'
  • Description: Account type for getUserInfo

@api orderName

  • Type: String
  • Description: Order number to load products

Tracked Properties

  • displayPacInfoAndVideo: Show PAC content?
  • displayDownloadableLinks: Show downloads?
  • downloadableProductsMap: Map of product name → download URL

Wire Adapters

@wire(getUserInfo, {"accountType":"$accountType"})

  • Loads current user and account
  • Triggers getProductsFromCurrentOrder() on success

Private Methods

getPacProductId()

  • Gets PAC contribution product ID
  • Called in connectedCallback

getProductsFromCurrentOrder()

  • Loads order items by order name
  • Populates downloadableProductsMap for products with IsDownloadableProduct__c=true
  • Calls fetchMembershipProducts() on success

fetchMembershipProducts()

  • Loads all membership product IDs
  • Calls checkIfItContainsMembershipProduct()

checkIfItContainsMembershipProduct()

  • Checks if order contains membership OR PAC product
  • Sets displayPacInfoAndVideo=true if either found

Computed Properties

displayPacInformationAndVideo

  • Returns displayPacInfoAndVideo flag
  • Returns displayDownloadableLinks flag

downloadableProductsList

  • Converts downloadableProductsMap to array for iteration

Dependencies

  • Apex: AccountController.getUserInfo(), ProductController.getMembershipProducts(), ProductController.getProductsFromCurrentOrder(), ProductController.getPacContributionProduct()
  • Static Resources: YouTube video embedded

Configuration

Component Meta XML

<targetConfigs>
    <targetConfig targets="lightningCommunity__Default">
        <property name="orderName" type="String"/>
    </targetConfig>
</targetConfigs>

Usage Examples

<c-order-confirmation-resources
    order-name={orderNumber}
    account-type="Person">
</c-order-confirmation-resources>

⚠️ Pre-Go-Live Concerns

HIGH

  • Commented console.log everywhere: Lines 40-46, 83-85, 103-105, 125-127
  • No error handling: All Apex calls just log errors, user sees nothing
  • No loading state: Component shows nothing while loading

MEDIUM

  • YouTube embed: Hardcoded YouTube URL (line 55-62) - should be configurable
  • Hardcoded links: Resource URLs hardcoded in template

LOW

  • Order name required: Component fails silently if orderName not provided

Maintenance Notes

Complexity: Medium Key Notes: - Shows conditional content based on order products - PAC video shows if order contains membership OR PAC product - Download links show if any product has IsDownloadableProduct__c=true - All error handling logs to console only (no user feedback) - Links to external AANP resources - YouTube video embedded for PAC information