Vulnerability in EPiServer.Forms

Try our conversational search powered by Generative AI!

Shannon Gray
Jul 11, 2012
(3 votes)

How Do I Implement Custom Sale Types For Visitor Groups Or Users Associated With An Organization?

This is Part 2 in a 3-part series on understanding and extending tiered pricing in EPiCommerce. In Part 1, we covered how tiered pricing works and hinted at how to extend it. In this post, we’ll go over the mechanics of implementing custom sale types so that your site can have more customized pricing.


How do you extend the EPiCommerce pricing engine with custom sale types? The pricing engine compares custom sale types and their associated sale codes implemented in Commerce manager with session variables set on your customer site. It does this to determine whether the current customer browsing the site matches the customer target information (sale code) for that custom sale type. This is done for each SKU that uses that custom sale type.


More specifically, custom sale type implementation requires three things :

* A custom sale type in the ecf.catalog.config file

* A tiered price manually or programmatically added for the SKU in the catalog / Commerce Manager

* A session variable set in memory during a user's session on the site.


Once the config file is updated, Commerce Manager will display the new sale type option to allow the addition/editing of tiered pricing for this new sale type in any SKU, bundle, or package. Next, manually or programmatically, you’ll need to add a tiered price for one or more skus which use this new sale type with the sale code that reflects the sale code the user must match to have access to this price. Somewhere in your site, you need to set a session variable with the same name as the custom sale type in the config file and the applicable sale code for the current user.


An example of a sale type would be Organization; an example of an organization sale code for a particular customer would be “Acme Corporation”. In this example, a session variable called “Organization” would be added to the customer site session and the value of that session variable would be set to the name of the organization the current user is associated with – here, “Acme Corporation”. If a SKU has a tiered price for the sale type Organization where the sale code is Acme Corporation, and its lower than the other prices that are applicable for the currently-browsing-customer in this example, the Acme Corporation tiered price will be returned when calling the StoreHelper.GetSalePrice() method (which returns the EPiCommerce pricing engine price). The session variable doesn’t have to be present if it doesn’t apply to the current customer.


As a bonus, EPiCommerce has a way to let you display your own user control in Commerce Manager when configuring the sale code property of your custom sale type. You can use this to display only valid values in a dropdown box, for example.


Here are some examples of how this could be used :
* You could have an organization sale type which allows you to specify a price for customers associated with an organization
* You could specify a sale type where a price can be setup for users associated with a particular visitor group
* Other properties of a customer, including information from sources outside of the EPiCommerce customer data model, could be used to create a custom sale type

Jul 11, 2012


Please login to comment.
Latest blogs
Join the Work Smarter Webinar: Working with the Power of Configured Commerce (B2B) Customer Segmentation December 7th

Join this webinar and learn about customer segmentation – how to best utilize it, how to use personalization to differentiate segmentation and how...

Karen McDougall | Dec 1, 2023

Getting Started with Optimizely SaaS Core and Next.js Integration: Creating Content Pages

The blog post discusses the creation of additional page types with Next.js and Optimizely SaaS Core. It provides a step-by-step guide on how to...

Francisco Quintanilla | Dec 1, 2023 | Syndicated blog

Stop Managing Humans in Your CMS

Too many times, a content management system becomes a people management system. Meaning, an organization uses the CMS to manage all the information...

Deane Barker | Nov 30, 2023

A day in the life of an Optimizely Developer - Optimizely CMS 12: The advantages and considerations when exploring an upgrade

GRAHAM CARR - LEAD .NET DEVELOPER, 28 Nov 2023 In 2022, Optimizely released CMS 12 as part of its ongoing evolution of the platform to help provide...

Graham Carr | Nov 28, 2023