Table of Contents

Class ProductImageService

Namespace
Dynamicweb.Ecommerce.Products
Assembly
Dynamicweb.Ecommerce.dll
public class ProductImageService
Inheritance
ProductImageService
Inherited Members

Methods

CheckPhysicalPath(string, bool)

public virtual string CheckPhysicalPath(string image, bool saveWildCards = false)

Parameters

image string
saveWildCards bool

Returns

string

CompileProductImagePath(string, Product)

Compiles product image path with replacing product related placeholders with product values

public virtual string? CompileProductImagePath(string image, Product product)

Parameters

image string

The image path

product Product

The product

Returns

string

Compiled image path.

CompileProductImagePath(string, string?, string?, string?, string?, string?, string?, string?)

Compiles product image path with replacing product related placeholders with product values

public virtual string? CompileProductImagePath(string image, string? productId, string? productNumber, string? productName, string? productPrimaryGroupId, string? productVariantId, string? productManufacturerName, string? variantOptionName)

Parameters

image string

Image pattern

productId string

Product id

productNumber string

Product number

productName string

Product name

productPrimaryGroupId string

Product primary group id

productVariantId string

Product variant id

productManufacturerName string

Product manufacturer name

variantOptionName string

variantOptionName

Returns

string

FileExists(string)

public virtual bool FileExists(string filePath)

Parameters

filePath string

Returns

bool

FindFilesByImagePattern(string, string?, bool, bool)

public virtual IEnumerable<string> FindFilesByImagePattern(string imageCompiled, string? imageFolder, bool searchSubfolders, bool onlyExisting)

Parameters

imageCompiled string
imageFolder string
searchSubfolders bool
onlyExisting bool

Returns

IEnumerable<string>

FixImagePath(string?)

public virtual string? FixImagePath(string? path)

Parameters

path string

Returns

string

GetAllDetailsGroups()

public virtual IEnumerable<DetailsGroup> GetAllDetailsGroups()

Returns

IEnumerable<DetailsGroup>

GetDefaultDetailImagePath(Product)

public virtual string? GetDefaultDetailImagePath(Product product)

Parameters

product Product

Returns

string

GetDefaultImageFromShop(Product, Shop)

public virtual string? GetDefaultImageFromShop(Product product, Shop shop)

Parameters

product Product
shop Shop

Returns

string

GetDefaultImageFromShop(Product, string?)

public virtual string? GetDefaultImageFromShop(Product product, string? groupId)

Parameters

product Product
groupId string

Returns

string

GetDefaultImagePath()

public virtual string? GetDefaultImagePath()

Returns

string

GetDetails(Product, string?)

public virtual IEnumerable<Detail> GetDetails(Product product, string? detailType)

Parameters

product Product
detailType string

Returns

IEnumerable<Detail>

GetImageFromProduct(Product)

Gets the primary image for the product

public virtual string? GetImageFromProduct(Product product)

Parameters

product Product

The product

Returns

string

The image path of existing image with following the hierarchy: image set on ImageSmall Property image set on ImageMedium Property image set on ImageLarge Property

GetImagePath(Product)

Gets the primary image for the product

public virtual string? GetImagePath(Product product)

Parameters

product Product

The product

Returns

string

The image path of existing image with following the hierarchy: default detail image set on ImageSmall Property image set on ImageMedium Property image set on ImageLarge Property image from shop pattern image from global pattern image from global setting for small default image image from global setting for medium default image image from global setting for large default image

GetImagePath(Product, string?)

Gets the primary image for the product

public virtual string? GetImagePath(Product product, string? groupId)

Parameters

product Product

The product

groupId string

The product group id

Returns

string

The image path of existing image with following the hierarchy: default detail image set on ImageSmall Property image set on ImageMedium Property image set on ImageLarge Property image from shop pattern image from global pattern image from global setting for small default image image from global setting for medium default image image from global setting for large default image

GetImagePath(Product, string?, List<Detail>?, bool)

Gets the primary image for the product

public virtual string? GetImagePath(Product product, string? groupId, List<Detail>? details, bool ignoreNoPictureSetting)

Parameters

product Product

The product

groupId string

The product group id

details List<Detail>
ignoreNoPictureSetting bool

Returns

string

The image path of existing image with following the hierarchy: default detail image set on ImageSmall Property image set on ImageMedium Property image set on ImageLarge Property image from shop pattern image from global pattern image from global setting for small default image image from global setting for medium default image image from global setting for large default image

GetImagePaths(IEnumerable<Product>, string?, bool)

public virtual Dictionary<ProductKey, string> GetImagePaths(IEnumerable<Product> products, string? groupId, bool ignoreNoPictureSetting)

Parameters

products IEnumerable<Product>
groupId string
ignoreNoPictureSetting bool

Returns

Dictionary<ProductKey, string>

GetImagePatternsDetails(Product, bool)

public virtual IEnumerable<Detail> GetImagePatternsDetails(Product product, bool fallbackDefaultImage = false)

Parameters

product Product
fallbackDefaultImage bool

Returns

IEnumerable<Detail>

GetImagePatternsDetails(Product, string?, bool)

public virtual IEnumerable<Detail> GetImagePatternsDetails(Product product, string? groupId, bool fallbackDefaultImage = false)

Parameters

product Product
groupId string
fallbackDefaultImage bool

Returns

IEnumerable<Detail>

GetImagePatternsDetailsGroup()

public virtual DetailsGroup GetImagePatternsDetailsGroup()

Returns

DetailsGroup

GetImagesFromPatterns(Product, Shop?)

public virtual IEnumerable<string> GetImagesFromPatterns(Product product, Shop? shop)

Parameters

product Product
shop Shop

Returns

IEnumerable<string>

GetImagesFromPatterns(Product, string?)

public virtual IEnumerable<string> GetImagesFromPatterns(Product product, string? groupId = null)

Parameters

product Product
groupId string

Returns

IEnumerable<string>

GetProductImage(string?, string)

public virtual string? GetProductImage(string? imagePath, string imageSize)

Parameters

imagePath string
imageSize string

Returns

string

IsUrl(string)

public virtual bool IsUrl(string path)

Parameters

path string

Returns

bool
To top