Feature Pack 5 or later

Modifying the Aurora starter store to show the day-of-month scheduling option

Feature Pack 5 or later In this step, you modify the Aurora starter store JSP and JavaScript files to accept the frequency and the day-of-month parameters for the scheduled recurring order. In particular, you modify the checkout page to accept the details that are required for the day-of-month schedule type.

Procedure

  1. Modify the checkout page JSP to include the Every Month schedule option with a day-of-month selection box.
    1. In the Enterprise Explorer view, expand Stores > WebContent > Aurora > ShoppingArea > CheckoutSection.
    2. Open the RecurringOrderCheckoutDisplay.jsp file.
    3. Locate the following code:
      <c:when test="${actualInterval == RecurringOrderFrequency6 && actualIntervalUOM == RecurringOrderFrequencyUOM6}">
      	<c:set var="interval" value="6"/>
      </c:when>
      Add the following code immediately after the code that you located:
      <c:when test="${actualInterval == RecurringOrderFrequency1 && actualIntervalUOM == RecurringOrderFrequencyMonthUOM}">
      	<c:set var="interval" value="30"/>
      </c:when>
    4. Locate the following code <select> element with id="ScheduleOrderFrequency" which lists the frequency options available when scheduling a recurring order: Modify it from
      <select class="drop_down" name="ScheduleOrderFrequency" id="ScheduleOrderFrequency" onchange="this.blur();">
      to
      <select class="drop_down" name="ScheduleOrderFrequency" id="ScheduleOrderFrequency" onchange="this.blur();displayDayOfMonth();">
    5. Add the following code after the last option of the <select> element with id="ScheduleOrderFrequency" to display the Every Month option:
      <option value="30" <c:if test="${interval == 30}">selected="selected"</c:if>><fmt:message key="SCHEDULE_ORDER_INTERVAL_7" bundle="${storeText}"/></option>
      
    6. Locate the following code:
      <c:when test="${interval == 6}">
      	<c:out value='${RecurringOrderFrequencyText6}'/>
      </c:when>
      Add the following code immediately after the code you located:
      <c:when test="${interval == 30}">
      	<fmt:message key="SCHEDULE_ORDER_INTERVAL_7" bundle="${storeText}"/>
      </c:when>
    7. Save the changes.
  2. Modify the JavaScript used in the checkout JSP.
    1. In the Enterprise Explorer view, expand Stores > WebContent > Aurora > javascript > CheckoutArea.
    2. Open the CheckoutHelper.js file.
    3. Locate the following code in prepareOrderSchedule method:
      dojo.cookie(key1, t);
      dojo.cookie(key2, interval);
      Add the following code after the code you located:
      if(interval == "30"){
        var key3 = "WC_ScheduleOrder_" +   
        document.getElementById("orderIdToSchedule").value + 
        "_dayOfMonth";
        var dayOfMonth = dojo.byId("DayOfMonth").value;
        dojo.cookie(key3, dayOfMonth);
      
        var key4 = "WC_ScheduleOrder_" +
      document.getElementById("orderIdToSchedule").value +
      "_duration";
        var duration = dojo.byId("Duration").value;
        dojo.cookie(key4, duration);
      }
    4. Locate the following code in scheduleOrder method:
      else if(dojo.cookie("WC_ScheduleOrder_" + orderId + "_interval") == '6'){
      params["fulfillmentInterval"] = '4';
      params["fulfillmentIntervalUOM"] = 'WEE';
      }
      Add the following code after the code you located:
      else if(dojo.cookie("WC_ScheduleOrder_" + orderId + "_interval") == '30'){
      params["fulfillmentInterval"]='1';
      params["fulfillmentIntervalUOM"] = 'MON';
      params["dayOfMonth"]=dojo.cookie("WC_ScheduleOrder_" + orderId + "_dayOfMonth");
      params["scheduleType"] = 'dayOfMonth';
      if(dojo.cookie("WC_ScheduleOrder_" + orderId + "_duration") != '0'){
      params["timePeriod"]=dojo.cookie("WC_ScheduleOrder_" + orderId + "_duration");
      params["timePeriodUOM"]='MON';
      }
      }
    5. Save the changes.
  3. Copy and replace RecurringOrderCheckoutDisplayExt.jsp file from temp\Madisons\ShoppingArea\CheckoutSection to Stores\Aurora\ShoppingArea\CheckoutSection
  4. Add the new text in the storetext_v2.properties file.
    1. In the Enterprise Explorer view, expand Stores > Java Resources:src > Aurora.
    2. Open the storetext_v2.properties file.
    3. Add the following properties to the end of the file:
      SCHEDULE_ORDER_INTERVAL_7 = Every Month
      SCHEDULE_ORDER_DAY_OF_MONTH = Day of Month
      SCHEDULE_ORDER_DURATION = Duration
      SCHEDULE_ORDER_X_MONTHS = {0} Months

Results

The following screen captures show the result of the customization.

Add the day of month schedule support on the Shipping and Billing page.

Screen capture that shows a recurring order with a frequency selection of Every Month. Selecting Every Month results in a Day of Month option available to customers.
Display the details of the selected day-of-month scheduling on the Order Summary page

Screen capture that shows a recurring order that is scheduled starting on 2012-07-13, on the first day of every month for three months.