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
Microsoft announces Natural language to SQL

Finally, Microsoft launches "Natural language to SQL," after it has been available for several months in Optimizely CMS!

Tomas Hensrud Gulla | May 23, 2024 | Syndicated blog

Five easy ways to start personalizing your content right now

If you clicked on this article, you already know that getting the right message to the right person at the right time helps drive conversions and...

Kara Andersen | May 23, 2024

ExtendedCms.TinyMceEnhancements – serwer side webp support

Today I will introduce another small feature of TinyMceEnhancements plugin. The functionality is used to automatically detect whether a browser...

Grzegorz Wiecheć | May 22, 2024 | Syndicated blog

Azure AI Language– Detect Healthcare Content in Optimizely CMS

In this blog post, I showcase how the Azure AI Language service's Text Analytics for health feature can be used to detect healthcare content within...

Anil Patel | May 22, 2024 | Syndicated blog