Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Shannon Gray
Jul 11, 2012
  5276
(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 CMS Developer Tools for macOS

Running Optimizely CMS on macOS presents unique challenges, as the platform was traditionally primarily designed for Windows environments. However,...

Tomek Juranek | Mar 15, 2025

Removing a Segment from the URL in Optimizely CMS 12 using Partial Routing

Problem Statement In Optimizely CMS 12, dynamically generated pages inherit URL segments from their container pages. However, in certain cases, som...

Adnan Zameer | Mar 14, 2025 |

Optimizely Configured Commerce and Spire CMS - Figuring out Handlers

I recently entered the world of Optimizely Configured Commerce and Spire CMS. Intriguing, interesting and challenging at the same time, especially...

Ritu Madan | Mar 12, 2025

Another console app for calling the Optimizely CMS REST API

Introducing a Spectre.Console.Cli app for exploring an Optimizely SaaS CMS instance and to source code control definitions.

Johan Kronberg | Mar 11, 2025 |

Extending UrlResolver to Generate Lowercase Links in Optimizely CMS 12

When working with Optimizely CMS 12, URL consistency is crucial for SEO and usability. By default, Optimizely does not enforce lowercase URLs, whic...

Santiago Morla | Mar 7, 2025 |

Optimizing Experiences with Optimizely: Custom Audience Criteria for Mobile Visitors

In today’s mobile-first world, delivering personalized experiences to visitors using mobile devices is crucial for maximizing engagement and...

Nenad Nicevski | Mar 5, 2025 |