An open API service indexing awesome lists of open source software.

https://github.com/geta/epi.commerce.extensions


https://github.com/geta/epi.commerce.extensions

commerce

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# Geta.EPi.Commerce.Extensions

* Master

![](http://tc.geta.no/app/rest/builds/buildType:(id:GetaPackages_EPiCommerceExtensions_00ci),branch:master/statusIcon)
[![Platform](https://img.shields.io/badge/Platform-.NET%204.6.1-blue.svg?style=flat)](https://msdn.microsoft.com/en-us/library/w0x726c2%28v=vs.110%29.aspx)
[![Platform](https://img.shields.io/badge/Episerver%20Commerce-%2011-orange.svg?style=flat)](http://world.episerver.com/commerce/)

## Description

Helpers and extension methods for Episerver Commerce.

```
Install-Package Geta.EPi.Commerce.Extensions
```

## Features

#### Extension methods for:
* **EPiServer.Commerce.Catalog.ContentTypes.IAssetContainer** - *get assets of Episerver's default group*
* **EPiServer.Commerce.Catalog.ContentTypes.BundleContent** - *gets all bundle entries for a bundle*
* **EPiServer.Commerce.Catalog.ContentTypes.EntryContentBase** - *gets the parent packages, bundles and categories*
* **EPiServer.Commerce.Order.ILineItem** - *gets Url, FullUrl and Thumbnailurl of an EPiServer.Commerce.Catalog.ContentTypes.EntryContentBase*
* **EPiServer.Commerce.Catalog.ContentTypes** - *gets the parent categories*
* **EPiServer.Commerce.Order.IOrderGroup** - *converts decimal to Mediachase.Commerce.Money*
* **EPiServer.Commerce.Catalog.ContentTypes.PackageContent** - *gets package entries for a package*
* **Mediachase.Commerce.Pricing.IPriceDetailService** - *saves the MSRP price*
* **Mediachase.Commerce.Pricing.IPriceService** - *gets the previous price and load the Msrp.*
* **EPiServer.Commerce.Catalog.ContentTypes.ProductContent** - *gets all variants/SKUs for a product*
* **EPiServer.Commerce.Catalog.ContentTypes.VariationContent** - *get the url and parent products*

## Examples

### Asset

```csharp
string image = variant.GetDefaultAsset();
IEnumerable images = variation.GetAssets();
```

### Bundle content

```csharp
IEnumerable GetBundleEntries(this BundleContent bundleContent);
IEnumerable GetBundleEntries(this BundleContent bundleContent, IRelationRepository relationRepository);
```

### Entry content

```csharp
IEnumerable GetPackages(this EntryContentBase entryContent);
IEnumerable GetPackages(this EntryContentBase entryContent, IRelationRepository relationRepository);

IEnumerable GetBundles(this EntryContentBase entryContent);
IEnumerable GetBundles(this EntryContentBase entryContent, IRelationRepository relationRepository);

IEnumerable GetParentCategories(this EntryContentBase entryContent);
IEnumerable GetParentCategories(this EntryContentBase entryContent, IRelationRepository relationRepository);
```

### LineItem

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

## Cart

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

### Node content

```csharp
IEnumerable GetParentCategories(this NodeContent nodeContent);
IEnumerable GetParentCategories(this NodeContent nodeContent, IRelationRepository relationRepository)
```

### Package content

```csharp
IEnumerable GetPackageEntries(this PackageContent packageContent);
IEnumerable GetPackageEntries(this PackageContent packageContent, IRelationRepository relationRepository);
```

### Price detail service

[MSRP](https://en.wikipedia.org/wiki/List_price) (list price/manufacturer's suggested retail price)

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

### Price service

[MSRP](https://en.wikipedia.org/wiki/List_price) (list price/manufacturer's suggested retail price)

```csharp
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

```csharp
IEnumerable GetVariations(this ProductContent productContent);
IEnumerable GetVariations(this ProductContent productContent, IRelationRepository relationRepository);
```

### VariantContent

```csharp
string url = variant.GetUrl();
IEnumerable GetProducts(this VariationContent variationContent, IRelationRepository relationRepository);
IEnumerable GetProducts(this VariationContent variationContent);
```

## Package maintainer
https://github.com/frederikvig