(Enterprise)

Enable guest browsing and shopping for the Aurora starter store

In the Aurora starter store, we can enable guest browsing and shopping for B2B customers. The steps involve enabling the related policies in the Organization Administration Console and modifying a store configuration file. We can then verify that guest browsing and shopping are enabled by browsing the store catalog and placing an order as a guest customer.


Procedure

  1. Open the Organization Administration Console.

  2. Click Access Management > Find Organizations.

  3. Find the organization that owns the store for which we are enabling guest and browsing and shopping. For an extended site, select the organization that owns the extended site store.

  4. Select the check box beside the organization.

  5. Click Policy Subscription.

  6. Enable guest browsing: Important: By default, guest browsing is enabled for the Aurora starter store. Complete the following substeps only if guest browsing is disabled.

    1. In the Available policy groups section, select store_name GuestCatalogEnabledPolicyGroup, where store_name is the name of your published store. For example, if the store name is AuroraB2B, select AuroraB2B GuestCatalogEnabledPolicyGroup.

    2. Click Add, and then click OK.

    3. Do one of the following things:

      • If we are also enabling guest shopping, complete the next step.

      • If we are enabling only guest browsing, complete these steps:

        1. Stop the WebSphere Commerce server.

        2. Start the WebSphere Commerce server.

        3. Go to step 10.

  7. Enable guest shopping for the local store.

    1. In the Available policy groups section, select store_name GuestShoppingEnabledPolicyGroup, where store_name is the name of your published store. For example, if the store name is AuroraB2B, select AuroraB2B GuestShoppingEnabledPolicyGroup.

    2. Click Add, and then click OK.

    3. Stop the WebSphere Commerce server.

    4. Go to the following directory:

    5. Back up the struts-config-ext.xmlconfiguration file (if we are using WebSphere Commerce Version 9.0.0.x), or the struts-wcs-stores-custom.xml file if we are using Version 9.0.1+.

    6. Open the configuration file in an editor.

    7. Find the section in the file containing the line path="/QuickOrderView" (for Version 9.0.0.x), or name="QuickOrderView" if we are using Version 9.0.1+.

    8. For the lines labeled 1 and 2 in the following code snippet, change the authenticate property value for the store from 1 to 0, as shown. The store ID is 10001 in the following example. For Version 9.0.0.x:

        <action path="/QuickOrderView" type="com.ibm.commerce.struts.BaseAction">
           <set-property property="credentialsAccepted" value="10001:P"/>
         1 <set-property property="authenticate" value="10001:0"/>
        </action>
        <action path="/AjaxOrderItemDisplayView" type="com.ibm.commerce.struts.BaseAction">
           <set-property property="https" value="10001:1"/>
           <set-property property="credentialsAccepted" value="10001:P"/>
         2 <set-property property="authenticate" value="10001:0"/>
        </action>

      For Version 9.0.1+:

        <action class="com.ibm.commerce.struts.v2.BaseAction" name="QuickOrderView">
        <param name="https">10151:1,10701:1,10801:1</param>
        <param name="authenticate">10151:1,10701:1,10801:1</param>
        <param name="credentialsAccepted">10001:P,10651:P,10701:P,10801:P</param>
        </action>
        
        <action class="com.ibm.commerce.struts.v2.BaseAction" name="AjaxOrderItemDisplayView">
        <param name="https">10001:1,10651:1,10701:1,10801:1</param>
        <param name="authenticate">10701:1,10801:1</param>
        <param name="credentialsAccepted">10001:P,10651:P,10701:P,10801:P</param>
        </action>

    9. Find the section in the file containing the line path="/AjaxRESTOrderItemAdd" (version 9.0.0.x), or name="/AjaxRESTOrderItemAdd" (Version 9.0.1+).

    10. For each of the lines that are labeled 1 to 8 in the following code snippet, change the authenticate property value for the store from 1 to 0, as shown. The store ID is 10001 in this example. For Version 9.0.0.x installations:

        <action parameter="orderlist.addOrderItem" path="/AjaxRESTOrderItemAdd" type="com.ibm.commerce.struts.AjaxRESTAction">
         1 <set-property property="authenticate" value="10001:0"/>
           <set-property property="https" value="10001:1"/>
        </action>
        <action parameter="orderlist.addOrderItem" path="/RESTOrderItemAdd" type="com.ibm.commerce.struts.RESTAction">
         2 <set-property property="authenticate" value="10001:0"/>
           <set-property property="https" value="10001:1"/>
        </action>
        ...
        <action parameter="orderlist.calculateOrder" path="/AjaxRESTOrderCalculate" type="com.ibm.commerce.struts.AjaxRESTAction">
         3 <set-property property="authenticate" value="10001:0"/>
           <set-property property="https" value="10001:1"/>
        </action>
        <action parameter="orderlist.calculateOrder" path="/RESTOrderCalculate" type="com.ibm.commerce.struts.RESTAction">
         4 <set-property property="authenticate" value="10001:0"/>
           <set-property property="https" value="10001:1"/>
        </action>
        <action parameter="orderlist.addConfigurationToCart" path="/AjaxRESTOrderAddConfigurationToCart" type="com.ibm.commerce.struts.AjaxRESTAction">
         5 <set-property property="authenticate" value="10001:0"/>
            <set-property property="https" value="10001:1"/
        </action>
        <action parameter="orderlist.addConfigurationToCart" path="/RESTOrderAddConfigurationToCart" type="com.ibm.commerce.struts.RESTAction">
         6 <set-property property="authenticate" value="10001:0"/>
            <set-property property="https" value="10001:1"/>
        </action>
        <action parameter="orderlist.addPreConfigurationToCart" path="/AjaxRESTOrderAddPreConfigurationToCart" type="com.ibm.commerce.struts.AjaxRESTAction">
         7 <set-property property="authenticate" value="10001:0"/>
            <set-property property="https" value="10001:1"/>
        </action>
        <action parameter="orderlist.addPreConfigurationToCart" path="/RESTOrderAddPreConfigurationToCart" type="com.ibm.commerce.struts.RESTAction">
         8 <set-property property="authenticate" value="10001:0"/>
            <set-property property="https" value="10001:1"/>
        </action>

      For Version 9.0.1+ installations, use the following XML:

        action class="com.ibm.commerce.struts.v2.AjaxRESTAction" name="AjaxRESTOrderItemAdd">
        <param name="authenticate">0:0</param>
        <param name="https">0:1</param>
        <param name="parameter">orderlist.addOrderItem</param>
        </action>
        <action class="com.ibm.commerce.struts.v2.RESTAction" name="RESTOrderItemAdd">
        <param name="authenticate">0:0</param>
        <param name="https">0:1</param>
        <param name="parameter">orderlist.addOrderItem</param>
        </action>
        <action class="com.ibm.commerce.struts.v2.AjaxRESTAction" name="AjaxRESTOrderCalculate">
        <param name="authenticate">0:0</param>
        <param name="https">0:1</param>
        <param name="parameter">orderlist.calculateOrder</param>
        </action>
        <action class="com.ibm.commerce.struts.v2.RESTAction" name="RESTOrderCalculate">
        <param name="authenticate">0:0</param>
        <param name="https">0:1</param>
        <param name="parameter">orderlist.calculateOrder</param>
        </action>
        <action class="com.ibm.commerce.struts.v2.AjaxRESTAction" name="AjaxRESTOrderAddConfigurationToCart">
        <param name="authenticate">0:0</param>
        <param name="parameter">orderlist.addConfigurationToCart</param>
        </action>
        <action class="com.ibm.commerce.struts.v2.RESTAction" name="RESTOrderAddConfigurationToCart">
        <param name="authenticate">0:0</param>
        <param name="parameter">orderlist.addConfigurationToCart</param>
        </action>
        <action class="com.ibm.commerce.struts.v2.AjaxRESTAction" name="AjaxRESTOrderAddPreConfigurationToCart">
        <param name="authenticate">0:0</param>
        <param name="parameter">orderlist.addPreConfigurationToCart</param>
        </action>
        <action class="com.ibm.commerce.struts.v2.RESTAction" name="RESTOrderAddPreConfigurationToCart">
        <param name="authenticate">0:0</param>
        <param name="parameter">orderlist.addPreConfigurationToCart</param>
        </action> 

    11. Save the file.

    12. (AIX) (Windows) Deploy the store assets.

    13. Start the WebSphere Commerce server.

  8. Enable guest shopping for remote stores.

    1. In the Available policy groups section, select store_name GuestShoppingEnabledPolicyGroup, where store_name is the name of your published store. For example, if the store name is AuroraB2B, select AuroraB2B GuestShoppingEnabledPolicyGroup.

    2. Click Add, and then click OK.

    3. Stop the WebSphere Commerce server.

    4. Back up the WCStore_Server_dir/crs-web/WEB-INF/spring/storedir/views-ext.xml configuration file.

    5. Open the views-ext.xml file in an editor.

    6. Find the associated bean definitions for the specific store we want to enable guest browsing and shopping for by finding the associated entries:

        <bean id="QuickOrderView/storedir"
            class="com.ibm.commerce.store.mvc.view.spring.StoreInternalResourceView">

    7. Change the authenticate property value for the store from 1 to 0, as shown in this example:

        <bean id="QuickOrderView/AuroraB2BStorefrontAssetStore"
            class="com.ibm.commerce.store.mvc.view.spring.StoreInternalResourceView">
          <property name="url"
            value="/ShoppingArea/OrderCreationSection/QuickOrderSubsection/QuickOrderForm.jsp"/>  
          <property name="credentialsAccepted" value="P"/>
          <property name="authenticate" value="0"/>
        </bean>
        <bean id="AjaxOrderItemDisplayView/AuroraB2BStorefrontAssetStore"
          class="com.ibm.commerce.store.mvc.view.spring.StoreInternalResourceView">
          <property name="url" value="/ShoppingArea/ShopcartSection/OrderItemDisplay.jsp"/>
          <property name="https" value="1"/>
          <property name="credentialsAccepted" value="P"/>
          <property name="authenticate" value="0"/>
          <property name="generic"value="1"/>
        </bean>

    8. Save the file.

    9. Back up the WCStore_Server_dir/crs-web/WEB-INF/spring/storedir/controllers-ext.xml configuration file.

    10. Open the controllers-ext.xml file in an editor.

    11. Find the associated bean definitions for the specific store we want to enable guest browsing and shopping for by finding the associated entries:

         <bean id="orderCalculate/storedir"
          class="com.ibm.commerce.store.mvc.controller.spring.RESTActionController">

    12. Change the authenticate property value for the store from 1 to 0, as shown in this example:

        <bean id="orderCalculate/AuroraB2BStorefrontAssetStore" 
          class="com.ibm.commerce.store.mvc.controller.spring.RESTActionController">
          <property name="authenticate" value="0"/>
          <property name="https" value="1"/>
          <property name="parameter" value="orderlist.calculateOrder"/>
        </bean>
        <bean id="ajaxRESTOrderCalculate/AuroraB2BStorefrontAssetStore"
          class="com.ibm.commerce.store.mvc.controller.spring.AjaxRESTActionController">
          <property name="authenticate" value="0"/>
          <property name="https" value="1"/>
          <property name="parameter" value="orderlist.calculateOrder"/>
         </bean>
        <bean id="ajaxOrderItemAdd/AuroraB2BStorefrontAssetStore"
          class="com.ibm.commerce.store.mvc.controller.spring.AjaxRESTActionController">
          <property name="authenticate" value="0"/>
          <property name="parameter" value="orderlist.addOrderItem"/>
          <property name="https" value="1"/>
        </bean>

    13. Save the file.

    14. Deploy the store assets.

    15. Start the Store server.

  9. To enable customer service representatives to browse and shop on behalf of guests, update your CustomerServiceNavigation_UI.jspf file.

    1. Stop the WebSphere Commerce server.

    2. Open the following file in an editor:

      • (Developer) workspace_dir/Stores/WebContent/Widgets_701/com.ibm.commerce.store.widgets.csr.CustomerServiceNavigation/CustomerServiceNavigation_UI.jspf

    3. Comment out the following condition:

        <c:if test="${env_b2bStore != 'true'}">
                  CSR cannot shop as guest user in B2B Store
                  <li>
                         <a href="#" onClick = "javascript:registeredCustomersJS.createGuestUser()" 
                           class="link" id="createGuestUser"><wcst:message key="MA_SHOP_AS_GUEST" bundle="${widgetText}"/></a>
                  </li>
        </c:if>

    4. Save and close the file.

    5. (AIX) (Windows) Deploy the store assets.

    6. Start the WebSphere Commerce server.

    7. Verify that a customer service representative can browse and shop on behalf of a guest.

  10. Verify that guest browsing, or guest shopping, or both, are enabled.

    1. Open the Aurora starter store in a browser but do not sign in.

    2. To verify that guest browsing is enabled, ensure that we can browse the store catalog and view products and their prices from the store's default contract.

    3. To verify that guest shopping is enabled, ensure that we can add items to the current order and check out.


Related tasks
Disable guest browsing and shopping for the Aurora starter store
Accessing sample organizations and user accounts to try out Aurora B2B capabilities


Related reference
Sample workflow for B2B organization administration and approvals