After logged in, User cart will also gets persisted. If user contains any old shopping cart (order in incomplete state), these shopping carts are loaded into user's session.
After log in, the PricingModelHolder component is reinitialized to cache all the promotions the the persistent user has accumulated during pervious sessions.
Profile.transient property is used to check user logged in.
Create User Profile :
- Extends Commerce Profile Form Handler (atg.userprofile.ProfileFormHandler)
- Extends UserProfile.xml (User Repository)
- Profile Groups and segment can be created to target specific group.
ACC is used to create user groups such as Anonymous user, Members, Admin etc.
Create Custom Profile Formhandler extending B2CProfileFormHandler. B2CProfileFormHandler extends CommerceProfileFormHandler, Injects CommerceProfileTools to perform commerce profile related activity. B2CProfileFormHandler handles user related activity. Like : login, logout, registration etc. It also contains "editValue" map to holds properties like shippingAddress.
ATG Consumer Commerce users do not have a price list functionality available by default. To add price list functionality, you should:
<item-descriptor name="user" default="true" sub-type-property="userType">
<table name="dcs_user" type="auxiliary" id-column-name="user_id">
<property category-resource="categoryCommerceContract"
name="priceList"
item-type="priceList"
display-name-resource="priceList"
column-name="price_list"
repository="/atg/commerce/pricing/priceLists/PriceLists"/>
</table>
</item-descriptor>
</gsa-template>
preCalculators=\
calculators/ItemPriceListCalculator,\
calculators/ConfigurableItemPriceListCalculator
When an item is priced, the pricing calculators will use the price lists defined here to determine what price to use.
========================================================================
========================================================================
========================================================================
Along with User details, User profile also contains :
activePromotion
usedPromotions
inactivePromotions
Create Custom Profile Formhandler extending B2CProfileFormHandler. B2CProfileFormHandler extends CommerceProfileFormHandler, Injects CommerceProfileTools to perform commerce profile related activity. B2CProfileFormHandler handles user related activity. Like : login, logout, registration etc. It also contains "editValue" map to holds properties like shippingAddress.
ProfileTools :
Profile Tools provides api to retrieve commerce related property like shipping address, billing address, credit card information. Also provide method to add, modify, delete or retrieve these properties.
Pricing :
- Add the following code to /atg/userprofiling/userProfile.xml in your localconfig:
<item-descriptor name="user" default="true" sub-type-property="userType">
<table name="dcs_user" type="auxiliary" id-column-name="user_id">
<property category-resource="categoryCommerceContract"
name="priceList"
item-type="priceList"
display-name-resource="priceList"
column-name="price_list"
repository="/atg/commerce/pricing/priceLists/PriceLists"/>
</table>
</item-descriptor>
</gsa-template>
- Add a price_list column to dcs_user table.
- Configure the ItemPricingEngine to use the appropriate precalculator. There are price list-specific versions of each of the precalculators used by the ItemPricingEngine.
- ItemPriceListCalculator is the precalculator for list pricing.
- ConfigurableItemPriceListCalculator is the precalculator for configurable item pricing.
preCalculators=\
calculators/ItemPriceListCalculator,\
calculators/ConfigurableItemPriceListCalculator
When an item is priced, the pricing calculators will use the price lists defined here to determine what price to use.
========================================================================
Auto Login - Click here to Learn More
========================================================================
Handling Forgotten Passwords - Click here to Learn More
========================================================================
Along with User details, User profile also contains :
- Promotion :
activePromotion
usedPromotions
inactivePromotions
- Address Book :
Three attributes are defined as part of the address book:
billingAddress,
shippingAddress and
secondaryAddresses.
The billing and shipping address is a contactInfo and the secondary addresses are a map of contactInfo objects. It is intended that the billingAddress and shippingAddress attributes are for “default” address values for the user. The user can create nicknames for other addresses and store those as the key/value pairs in the secondaryAddresses map
- Credit Card :
- Gift list/ Wish List
- Current Location :
Current location can be retrieve using : /atg/userprofiling/Profile.currentLocation.
- Shopping Preferences :
No comments :
Post a Comment