List agreementItems = delegator.findByAndCache("AgreementItemAndProductAppl", UtilMisc.toMap(
"productId", productId,
"agreementItemTypeId", "AGREEMENT_COMMISSION"));
// Try the first available virtual product if this is a variant product
if (agreementItems.size() == 0) {
List productAssocs = delegator.findByAndCache("ProductAssoc", UtilMisc.toMap(
"productIdTo", productId,
"productAssocTypeId", "PRODUCT_VARIANT"));
productAssocs = EntityUtil.filterByDate(productAssocs);
if (productAssocs.size() > 0) {
GenericEntity productAssoc = EntityUtil.getFirst(productAssocs);