Guest Account Type
The Guest type account is an account that exist in JDE, but is designated as the account to use for generic users. This is because JDE can be configured to work in different ways for different address numbers.
For example, items in JDE may be priced differently for different customers. Order creation may also differ. This generic JDE Address allow clients to assign a default functionality setting to generic users by maintaining a generic account. In our pricing example, this generic address would receive no discount or special pricing.
How are the Guest Accounts Identified?
The EASYCommerce application needs to be told how to identify these generic accounts. This is done in a configuration variable: $EP_Profile_AddressBook_Default_CashAndCarryAccounts. This value needs to correspond to an existing record in the JDE Address Book Master (F0101.ABAN8). If there is just one Guest Account, it must be stored in the configuration variable, surrounded by single quotes (‘[ABAN8]’).
How are the Guest Users Identified?
Users are usually as a record in the EPUsers table which is associated to a parent address. Users of this type must exist under a parent address and inherit information from the parent address such as currency, billing addresses, shipping addresses, etc. This information about the user that is either specific to the user (first name, last name) or inherited from the parent address is stored in user session variables upon login. These user session variables are accessible by the site while the user navigates to easily retrieve user info.
Guest users are different because if you are not logged in, the site is not aware of any user information and so there are no user session variables to reference. However, the lack of information is what the site uses to mean the user is a guest. The logic to decide if the user is a guest is performed in a EASYProcess Process called “IsGuest” (PRC-10000681). This checks if the UserId from the user session variables is blank and if so, the user is a guest.
Multiple Guest Accounts
The configuration variable that stores the Guest Account Number can take a comma separated list in order to store multiple Guest Account Numbers. Because the configuration variable ($EP_Profile_AddressBook_Default_CashAndCarryAccounts) which stores the guest accounts list is used in SQL queries, it must have the following format:
As Base EASYCommerce functionality, there is just one JDE Address Number that is designated as the “Guest Account”. The configuration variable that stores the account number is a comma separated list, but only the first in the list is active (used as the one to price and place orders with). The others in the list will still be considered Guest Accounts and as such will be excluded from the JDE Account Type category.
More active Guest Accounts could be added if needed, but with multiple active Guest Accounts each time a Guest checks out, logic will need to be added to decide which account to use. This might be desired functionality if different active guest accounts should be used depending on the guest’s country or other entered info. This would be custom work, but the guest account type structure supports this once the addition logic is built.
The logic to decide which Guest Account to use is performed in a EASYProcess Process called “SelectActiveGuestAccount” (PRC-10000666). If additional logic were to be added to support multiple Guest Accounts, the change would be made in this process.
Guest Checkout (Process Flow)
Browsing the Site and User Session Variables
When guests checkout, they are not logged in as EASYCommerce users, but they still have a SessionId and the shopping cart is assigned to that value. Here is an example of a guest’s shopping cart as seen in the EC_ShoppingCart_Header and EC_ShoppingCart tables.
Everywhere on the site, if the user session variable for the UserId is blank, this is used to determine that the user is a guest. This is because a logged in user would not be allowed to have a blank UserId. Upon login the user session variables are set to be equal to the values from the EPUser’s table for the user that has logged in. If a login doesn’t occur, these variables remain blank.
The guest user can see the prices of items and add items to the cart. Whenever pricing is needed and a JDE business function (BSFN) is run to get the advanced pricing, it needs a JDE Account Number. This is when the Active Guest Account is used (retrieved by the “SelectActiveGuestAccount” EASYProcess Process PRC-10000666). The Guest Account is an ERPAddressNumber (ABAN8) that exists in JDE. This is a generic address in JDE that has generic rules for pricing and order creation set up. EASYCommerce flags this ERPAddressNumber as the Guest Account and so when a guest user needs an ERPAddressNumber to perform actions against JDE, this is used.
Guest User Creation
After the user adds all the desired items to the cart and chooses to proceed to checkout, they will be prompted to do one of the following: login as an existing EASYCommerce user, create an EASYCommerce user, or continue as a guest. In order to continue as a guest, the user must enter a name and an email. This is the only information we have about the guest at this point and we use it to create database records related to the guest.
As shown before, a guest has a shopping cart database record, but we only have the session id. Now, we save the other information into a table (EC_Guest_Temp) as well as the session id so we know which cart belongs to which guest users. We also update the shopping cart header with the given email address.
Checkout (Field Entry)
When arriving at the checkout page, logic is run before the page loads to decide if the user should be prompted to enter billing and shipping address information. This logic is determined by EASYProcess Process called “IsGuest” (PRC-10000681).
When the user submits their order, values from the page are saved, such as the user’s Billing and Shipping information which will be saved to the EC_ShoppingCart_Addresses table. The entries are tied to the shopping cart CartId. This is how they are related back to the guest user.
This table is reserved for addresses associated with shopping carts and orders which will be created from those carts. Addresses are only stored in this table when the information stored in JDE for the Billing and Shipping addresses will not be used and instead the user will type in the addresses for Billing and Shipping (Drop Ship and Drop Bill).
As the order creation processes continue, at one point all the information about the user is collected. Again, the EASYProcess Process called “IsGuest” (PRC-10000681) decides whether the user is a guest. If so, the limited guest user information is used instead of user session variables. The ECOrderHeader table values saved will then contain all the information needed to submit an order to JDE. The order will use the Guest Account JDE ERPNumber and the user entered Billing and Shipping addresses will also be sent to JDE as the override addresses (drop ship and drop bill).
Order Creation Cleanup
As will all orders created, after the order is successfully created, all the table records no longer needed are deleted. For guests, this mainly includes the following table records:
Guest User Creation Feature
The Guest checkout feature can be configured to create guest users with the GuestName and GuestEmail the user must enter to proceed to checkout.
This feature is driven by the following two configuration variables:
This might be a desired feature for the administrators of the site in order to give some visibility into the guest users using the site.
If the JDE option is chosen a user can be created in JDE as a Who’s Who’s record under the selected active guest account (JDE Address Number-ABAN8). The Who’s Who record is created with a JDE business function (BSFN) and the email is added with another BSFN. Here are the used BSFN names:
If the EPUsers option is selected, a EASYCommerce user is created in the EPUsers table and will be visible in the Account home list of EASYCommer users. The UserId assigned will be equal to the email entered by the guest user.