use of org.broadleafcommerce.core.catalog.domain.SkuMediaXref in project BroadleafCommerce by BroadleafCommerce.
the class SkuSiteMapGenerator method constructImageURLs.
protected void constructImageURLs(SiteMapBuilder siteMapBuilder, SiteMapURLWrapper siteMapUrl, Sku sku) {
for (SkuMediaXref skuMediaXref : sku.getSkuMediaXref().values()) {
SiteMapImageWrapper siteMapImage = new SiteMapImageWrapper();
siteMapImage.setLoc(BroadleafSitemapUtils.generateImageUrl(siteMapBuilder, skuMediaXref.getMedia()));
siteMapUrl.addImage(siteMapImage);
}
}
use of org.broadleafcommerce.core.catalog.domain.SkuMediaXref in project BroadleafCommerce by BroadleafCommerce.
the class SeoDefaultPropertyServiceImpl method getImage.
@Override
public String getImage(Product product) {
Sku defaultSku = product.getDefaultSku();
Map<String, SkuMediaXref> mediaXrefs = defaultSku.getSkuMediaXref();
SkuMediaXref primaryMediaXref = mediaXrefs.get("primary");
if (primaryMediaXref != null) {
Media primaryMedia = primaryMediaXref.getMedia();
return urlResolver.getSiteBaseUrl() + primaryMedia.getUrl();
}
return null;
}
Aggregations