How to apply Agreements in iStore
Agreements can be applied at the line level only after the item is added to the Cart, that’s the standard functionality in iStore. Additionally the end user will need to the Agreement code, just as they need to know the Promotion Code to apply it on the Order. This is one of the drawback one of our esteemed client failed to comprehend.
To workaround this gap, we added the following query to ibeCScpAddItem.jsp
SELECT agreement_id, a.price_list_id FROM oe_agreements_vl a, qp_list_lines_v c where a.sold_to_org_id = ” + v_accountId + ” AND SYSDATE BETWEEN NVL(a.START_DATE_ACTIVE,SYSDATE-1) AND NVL(a.end_DATE_ACTIVE ,SYSDATE+1) and product_attr_value = ‘” + v_item_id + “‘ and list_header_id = a.price_list_id ;
And called the following method to apply the agreementId to the active cart
One of the drawbacks that the client had to accept with this workaround was the fact the item had to be present in the PriceList associated to the store, it cannot merely be part of an agreement.