Last active
September 4, 2018 15:26
SF_10.1, SF_10.2 - https://docs.sitefinity.com/tutorial-run-custom-code-when-a-product-is-added-to-wish-list
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Telerik.Sitefinity.Abstractions; | |
using Telerik.Sitefinity.Modules.Ecommerce.Events; | |
using Telerik.Sitefinity.Services; | |
namespace SitefinityWebApp | |
{ | |
public class Global : System.Web.HttpApplication | |
{ | |
protected void Application_Start(object sender, EventArgs e) | |
{ | |
Bootstrapper.Initialized += new EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>(Bootstrapper_Initialized); | |
} | |
private void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs e) | |
{ | |
if (e.CommandName == "Bootstrapped") | |
{ | |
EventHub.Subscribe<ProductAddedToWishlistEvent>(OnProductAddedToWishlist); | |
EventHub.Subscribe<ProductInWishlistPurchasedEvent>(OnProductInWishlistPurchased); | |
} | |
} | |
private void OnProductInWishlistPurchased(ProductInWishlistPurchasedEvent @event) | |
{ | |
//do custom logic like send email here | |
//@event.ProductId; | |
//@event.ProductVariationIds; | |
//@event.WishlistId; | |
} | |
private void OnProductAddedToWishlist(ProductAddedToWishlistEvent @event) | |
{ | |
//do custom logic like send email here | |
//@event.ProductId; | |
//@event.ProductVariationIds; | |
//@event.WishlistId; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment