November Happy Hour will be moved to Thursday December 5th.

Shannon Gray
Jul 11, 2012
  5188
(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

Comments

Please login to comment.
Latest blogs
Optimizely SaaS CMS + Coveo Search Page

Short on time but need a listing feature with filters, pagination, and sorting? Create a fully functional Coveo-powered search page driven by data...

Damian Smutek | Nov 21, 2024 | Syndicated blog

Optimizely SaaS CMS DAM Picker (Interim)

Simplify your Optimizely SaaS CMS workflow with the Interim DAM Picker Chrome extension. Seamlessly integrate your DAM system, streamlining asset...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Optimizely CMS Roadmap

Explore Optimizely CMS's latest roadmap, packed with developer-focused updates. From SaaS speed to Visual Builder enhancements, developer tooling...

Andy Blyth | Nov 21, 2024 | Syndicated blog

Set Default Culture in Optimizely CMS 12

Take control over culture-specific operations like date and time formatting.

Tomas Hensrud Gulla | Nov 15, 2024 | Syndicated blog

I'm running Optimizely CMS on .NET 9!

It works 🎉

Tomas Hensrud Gulla | Nov 12, 2024 | Syndicated blog

Recraft's image generation with AI-Assistant for Optimizely

Recraft V3 model is outperforming all other models in the image generation space and we are happy to share: Recraft's new model is now available fo...

Luc Gosso (MVP) | Nov 8, 2024 | Syndicated blog