Class ProductURLService

java.lang.Object
com.hybris.ymkt.common.product.ProductURLService

public class ProductURLService extends Object
Convenience service to generate the product URL and image URL.
  • Field Details

    • imagePrefix

      protected String imagePrefix
    • productService

      protected de.hybris.platform.product.ProductService productService
  • Constructor Details

    • ProductURLService

      public ProductURLService()
  • Method Details

    • getProductImageURL

      public Optional<String> getProductImageURL(ProductModel product)
      Provide the URL of the product image if available.
      Parameters:
      product - ProductModel to get image URL from.
      Returns:
      Optional image URL if the product has one.
    • getProductURL

      public String getProductURL(ProductModel product)
      Provide the URL of the product shop detail page.
      Parameters:
      product - ProductModel to get detail page URL from.
      Returns:
      URL accessible by web user.
    • getProductURL

      public String getProductURL(String productCode)
      Provide the URL of the product shop detail page.
      Parameters:
      productCode - ProductModel.getCode() to get detail page URL from.
      Returns:
      URL accessible by web user.
    • setImagePrefix

      public void setImagePrefix(String imagePrefix)
    • setNavPrefix

      public void setNavPrefix(String navPrefix)
    • setNavSuffix

      public void setNavSuffix(String navSuffix)
    • setProductService

      public void setProductService(de.hybris.platform.product.ProductService productService)