Specific promotion type

My site sells soap, and we want to offer our customers a “Buy X bars, get 1 free” deal, where “X” can be any combination of different individual soaps a customer might purchase.

That alone is pretty straightforward to accomplish with CS-Cart’s promotion system (via the “number of products exceeds” condition), but what makes it trickier is that my site also sells gift sets with multiple bars of soap, and the bars in those gift sets also qualify for the promotion. Thus, a 6-bar gift set, for example, would count as 6 bars towards the promotion. So I can’t just count the number of items purchased, as each item contributes differently toward the promotion.

So, my question is how to handle this in CS-Cart?

My vision is this:

  1. Create a feature (effetively, a custom field) for all my products called “bar count”.
  2. Specify in my catalog the “bar count” value for any given product (e.g., “1” for individual bars of soap, and “3”, “4”, “6”, etc. for gift sets based on the number of bars they contatin).
  3. Calculate the sum of the (bar count x quantity) for all items in the cart.
  4. Grant promotions to customers based on that calculated sum (e.g., grant a free bar once they’ve bought 6 bars, then another when they’ve bought 12, then another when they’ve bought 18, etc.)

    So, is this straightforward to accomplish? As far as I can tell, it requires some PHP programming to create a new type of of promotion condition like “sum of feature exceeds” (augmenting the already-established “spent money” or “period of validity”, etc.). Is this something I need to request from the CS-Cart developers themselves? Or am I overlooking an easier solution?

    Thanks ahead of time for your input!