Customer tags may be created and used to store any information about a customer. In a B2B scenario they can be used to store customer privilege information in order to modify the behaviour of the storefront application for the B2B buyers based on their roles.
After a standard Business or Enterprise installation of KonaKart, a number of B2B specific customer tags are available that are used by the storefront without having to apply any customisations. These are:
B2B_CAN_CHANGE_ADDRESS - If set to false the change address links are all disabled, not allowing the buyer to create a new address or modify an existing one.
B2B_VIEW_PARENT_ORDERS - When set to true the buyer can view orders placed by his parent in the hierarchical customer structure.
B2B_VIEW_CHILD_ORDERS - When set to true the buyer can view orders placed by his direct children in the hierarchical customer structure.
B2B_VIEW_SIBLING_ORDERS - When set to true the buyer can view orders placed by his siblings in the hierarchical customer structure.
B2B_ORDER_LIMIT - Before allowing the buyer to checkout, a validation of the order is made to ensure that it doesn’t exceed the amount set for the order limit.
B2B_AGGREGATE_ORDER_LIMIT - The aggregate order limit is the maximum total order value that can be submitted in a period of time. For example, if a corporate buyer can only buy a total of $10,000 / month, this should be set to 10000. Before allowing the buyer to checkout, a validation of the order is made to ensure that the order amount, when added to the running total (kept in the B2B_AGGREGATE_ORDER_TOTAL tag), doesn’t exceed the amount set for the aggregate order limit.
B2B_AGGREGATE_ORDER_TOTAL - This tag contains the current total of the orders submitted by the buyer since the last reset, which could for example be at the start of every month. It is added to the total of the current order being processed to determine whether the aggregate total is below or above the aggregate order limit.
Every time an order changes state to Payment Received, the value of this tag is increased by the value of the order. The calculation is performed in the OrderIntegrationMgr in a method called updateCustomerTags() . By default this method is commented out, so in order to use the aggregate order limit functionality, you must uncomment it and recompile the OrderIntegrationMgr .
A batch called ResetAggregateOrderTotalCustomerTag is available to reset the value of all B2B_AGGREGATE_ORDER_TOTAL tags to zero. This batch should be scheduled to run weekly or monthly etc. depending on the time period desired.
B2B_CATALOG_KEY - When set to the key of a valid catalog, it is used to determine the products and their prices displayed to the buyer. The catalog will be used when the buyer logs in and the default catalog (or no catalog) is reverted back to when the buyer logs out. The key of the default catalog can be defined in the "Default Catalog Key" configuration variable under Configuration>>Store Configuration using the Admin App.
B2B_ORDERS_NEED_APPROVAL - When set to true and a buyer submits an order, the order is saved and set to a "Waiting for Approval" state.
B2B_CAN_APPROVE_ORDERS - When set to true, the buyer can approve orders of other buyers. Typically B2B_VIEW_CHILD_ORDERS would also be set to true so that the buyer can see orders of other buyers lower in the customer hierarchy.
The above screen shot shows how a manager can approve or deny approval of an order and leave a comment.