Search in sources :

Example 1 with ReadableProductOptionValue

use of com.salesmanager.shop.model.catalog.product.attribute.ReadableProductOptionValue in project shopizer by shopizer-ecommerce.

the class ReadableProductVariationMapper method optionValue.

private ReadableProductOptionValue optionValue(ProductOptionValue val, MerchantStore store, Language language) {
    ReadableProductOptionValue value = new ReadableProductOptionValue();
    value.setCode(val.getCode());
    value.setId(val.getId());
    ProductOptionValueDescription desc = optionValueDescription(val.getDescriptions(), language);
    if (desc != null) {
        value.setName(desc.getName());
    }
    return value;
}
Also used : ReadableProductOptionValue(com.salesmanager.shop.model.catalog.product.attribute.ReadableProductOptionValue) ProductOptionValueDescription(com.salesmanager.core.model.catalog.product.attribute.ProductOptionValueDescription)

Example 2 with ReadableProductOptionValue

use of com.salesmanager.shop.model.catalog.product.attribute.ReadableProductOptionValue in project shopizer by shopizer-ecommerce.

the class ReadableProductOptionSetMapper method optionValue.

private ReadableProductOptionValue optionValue(List<Long> ids, ProductOptionValue optionValue, MerchantStore store, Language language) {
    if (!ids.contains(optionValue.getId())) {
        ReadableProductOptionValue value = new ReadableProductOptionValue();
        value.setCode(optionValue.getCode());
        value.setId(optionValue.getId());
        ProductOptionValueDescription desc = optionValueDescription(optionValue.getDescriptions(), language);
        if (desc != null) {
            value.setName(desc.getName());
        }
        ids.add(optionValue.getId());
        return value;
    } else {
        return null;
    }
}
Also used : ReadableProductOptionValue(com.salesmanager.shop.model.catalog.product.attribute.ReadableProductOptionValue) ProductOptionValueDescription(com.salesmanager.core.model.catalog.product.attribute.ProductOptionValueDescription)

Aggregations

ProductOptionValueDescription (com.salesmanager.core.model.catalog.product.attribute.ProductOptionValueDescription)2 ReadableProductOptionValue (com.salesmanager.shop.model.catalog.product.attribute.ReadableProductOptionValue)2