Use Endless Aisle with the Storefront Reference Architecture

To use Endless Aisle with the Storefront Reference Architecture (SFRA), address the following SFRA code changes in your Endless Aisle code.

isml

In SFRA, these is no concept of different forms. Instead, you fetch the countries and states from a single form.

In countriesstatesjson.isml replace:

<isset name="countryname" 
value="${pdict.CurrentForms.customeraddress.country.options}" 
scope="pdict" />, <isset name="countryname" 
value="${pdict.CurrentForms.billingaddress.country.options}" 
scope="pdict" /> & <isset name="countryname" 
value="${pdict.CurrentForms.shippingaddress.country.options}" 
scope="pdict" />

with:

<isset name="countryname" 
value="${pdict.CurrentForms.address.country.options}" scope="pdict" />

In SFRA, states.stateUS and states.state is replaced with States.stateCode

In countires.isml replace:

<isif condition="${countryCode == 'US' && 
!empty(pdict.CurrentForms.states.stateUS.options)}">

with:

<isif condition="${countryCode.toUpperCase() == 'US'&& 
!empty(pdict.CurrentForms.states.stateCode.options)}">

Methods

In SFRA, the following methods are removed and replaced.

GetApplicableShippingMethods.ds

Replaced with

getApplicableShippingMethods in shippingHelpers.js. With this method, you must pass exact arguments. getApplicableShippingMethods(shipment, address).

UpdateShipmentShippingMethod.ds

Replaced with

selectShippingMethod in shippingHelpers.js. With this method, you must pass exact arguments. selectShippingMethod(shipment, shippingMEthodID, shippingMethods, address).

PrecalculateShippingMethod.ds

Replace with a combination of files from the totals.js model and the shippingMethod.js model.

Files

In SFRA, the following files are removed and their functions and methods replaced.

dw.ocapi.shop.basket.calculate is deprecated.

Replaced with dw.order.calculate which implements dw.ocapi.shop.basket.calculate.

ValidateCartForCheckout.ds

Replaced with validateBasket.js. This file contains validateBasket, a method that takes in arguments for basket and ValidateTax.

SetOrderStatus.ds

Replaced with the function placeOrder in checkoutHelpers.js. placeOrder calls OrderMgr.placeOrder and also sets the order status.

BASIC_CREDIT.js

Replaced with basic_credit.js. This file contains Authorize(), a function that takes exact arguments. Authorize(orderNo, PaymentInstrument, paymentProcessor).

EmaiModel.js

Replaced with sendConfirmationEmail(), a function in checkoutHelpers.js that takes inputs order and locale.

Utils.ds

Replaced with EAPaymentFulfilled.ds, a method that includes functions calculatePaymentInstrumentBalanceAmount, and removeExistingPaymentInstruments.

App_storefront_controllers

Replaced with calculate.js. calculate.js requires the same app_storefront_contollers configurations.

Storefront API Calls

pay through web is not supported with an SFRA implementation of Endless Aisle.