Sitefinity 5.0 Ecommerce Features Explained

Sitefinity 5.0 Ecommerce Features Explained

March 07, 2012 0 Comments

The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.

In this blog post, I will explain how to create a digital download, how the pre-processing hook works and review the update we made to product variations adding support for multilingual variations.

Digital Downloads

Below are the steps you would follow when creating a digital download in the Sitefinity backend.

Step 1) Create a Product Type and assign the type as a “Downloadable product”. You can add fields for this product type such as the artist, author, ISBN, manufacturer, number of pages, etc…

clip_image002a

Step 2) Create a product based on the product type just created.

clip_image003

Add a new product and select the “File to Download” button. Select the file from their local computer or use a file which has already been uploaded and attach it to the product.
clip_image004

clip_image005

Once completed, the file is then saved into the system folder library and attached to the product.

Customer download

Upon successful purchase by the customer, the customer can go to their My Account page to download the digital file.

clip_image007

Pre-Processing Hook

The Pre-Processing hook provides the ability for a developer to cancel an order based on a custom order processing rule. You can create a custom rule to cancel the order if the order did pass certain pre-defined rules. For example, you may want to check the inventory quantity from an ERP system before you communicate with the payment gateway. The OrderValidator class allows you the ability to show a Friendly Error Message on why an order did not go through.

(The pre-processing hook compliments our post-processing hook which was released in version 4.4. With the post-processing hook, a call can be made to a CRM or ERP system transmitting the successful order information automatically into a 3rd party system.)

Documentation article(s) / Extension sample(s):

Add a Global.asax file then add the code below in a cs file

Protected void Application_Start(object sender, EventArgs e) 
{ 
Bootstrapper.Initialized += new EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>(Bootstrapper_Initialized); 
} 
void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs e) 
{ 
if (e.CommandName == "Bootstrapped") 
{ 
EcommerceEvents.PreProcessOrder += new EcommerceEvents.OnPreProcessOrder(EcommerceEvents_PreProcessOrder); 
} 
} 
OrderValidator EcommerceEvents_PreProcessOrder(Guid cartOrderId, CheckoutState checkoutState, Customer customer) 
{ 
bool isOrderValid = DateTime.Now.Second % 2 == 0; 
OrderValidator orderValidator = new OrderValidator 
{ 
IsOrderValid = isOrderValid, 
StatusMessage = "Order failed because of my custom rule" 
}; 
return orderValidator; 
} 
 

Multilingual Variations

If the site is multilingual then the attributes/values can also be shown another languages.

Follow the steps below to create a multilingual variation:

Step 1) Administration->Settings, click the Languages on the left nav.

clip_image009

Step 2) Go to Ecommerce->Attributes

clip_image010

Step 3) View the attributes

clip_image012

Click “ES” adding the Spanish version, then enter the Spanish name for the Attribute:

clip_image014

Then add the values in the second language:

clip_image016

clip_image018

Once you’ve translated the attributes/values then you can view the product and the variations on the store front.

Here is a screen shot in English

clip_image020

Here is the screen shot in Spanish
clip_image022

(The pages, product, templates all need to be translated)

progress-logo

The Progress Guys

View all posts from The Progress Guys on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.

Comments
Comments are disabled in preview mode.
Topics
 
 
Latest Stories in
Your Inbox
Subscribe
More From Progress
d12fcc0bdb669b804e7f71198c9619a7
5 Questions Automakers Should Ask to Improve Asset Uptime
Download Whitepaper
 
SF_MQ_WCM
2018 Gartner Magic Quadrant Web Content Management (WCM)
Download Whitepaper
 
What-Serverless-Means-For-Enterprice-Apps-Kinvey
What Serverless Means for Enterprise Apps
Watch Webinar