Geta / EPi.Commerce.Extensions

0 stars 2 forks source link
commerce

Geta.EPi.Commerce.Extensions

Description

Helpers and extension methods for Episerver Commerce.

Install-Package Geta.EPi.Commerce.Extensions

Features

Extension methods for:

Examples

Asset

string image = variant.GetDefaultAsset<IContentImage>();
IEnumerable<string> images = variation.GetAssets<IContentImage>();

Bundle content

IEnumerable<ContentReference> GetBundleEntries(this BundleContent bundleContent);
IEnumerable<ContentReference> GetBundleEntries(this BundleContent bundleContent, IRelationRepository relationRepository);

Entry content

IEnumerable<ContentReference> GetPackages(this EntryContentBase entryContent);
IEnumerable<ContentReference> GetPackages(this EntryContentBase entryContent, IRelationRepository relationRepository);

IEnumerable<ContentReference> GetBundles(this EntryContentBase entryContent);
IEnumerable<ContentReference> GetBundles(this EntryContentBase entryContent, IRelationRepository relationRepository);

IEnumerable<ContentReference> GetParentCategories(this EntryContentBase entryContent);
IEnumerable<ContentReference> GetParentCategories(this EntryContentBase entryContent, IRelationRepository relationRepository);

LineItem

string url = lineItem.GetUrl();
string fullUrl = lineItem.GetFullUrl();
string thumbnail = lineItem.GetThumbnailUrl();

Cart

void AddValidationIssues(this Dictionary<ILineItem, List<ValidationIssue>> issues, ILineItem lineItem, ValidationIssue issue);
bool HasItemBeenRemoved(this Dictionary<ILineItem, List<ValidationIssue>> issuesPerLineItem, ILineItem lineItem);

Node content

IEnumerable<ContentReference> GetParentCategories(this NodeContent nodeContent);
IEnumerable<ContentReference> GetParentCategories(this NodeContent nodeContent, IRelationRepository relationRepository)

Package content

IEnumerable<ContentReference> GetPackageEntries(this PackageContent packageContent);
IEnumerable<ContentReference> GetPackageEntries(this PackageContent packageContent, IRelationRepository relationRepository);

Price detail service

MSRP (list price/manufacturer's suggested retail price)

SaveMsrp(this IPriceDetailService priceDetailService, ContentReference contentLink, MarketId marketId, Currency currency, decimal amount);

Price service

MSRP (list price/manufacturer's suggested retail price)

IPriceValue LoadMsrp(this IPriceService priceService, ContentReference contentLink, MarketId marketId, Currency currency);

// Example usage: Was 1000 now only 800
IPriceValue GetPreviousPrice(this IPriceService priceService, ContentReference contentLink, MarketId marketId, Currency currency);

Product content

IEnumerable<ContentReference> GetVariations(this ProductContent productContent);
IEnumerable<ContentReference> GetVariations(this ProductContent productContent, IRelationRepository relationRepository);

VariantContent

string url = variant.GetUrl();
IEnumerable<ContentReference> GetProducts(this VariationContent variationContent, IRelationRepository relationRepository);
IEnumerable<ContentReference> GetProducts(this VariationContent variationContent);

Package maintainer

https://github.com/frederikvig