Our Goal
We're creating a book product. It comes in a variety of sizes (ex. 5x5, 8x8, 10x10) with 20 pages included. We're using the size as an attribute field. Customers can order a standard book, or add additional pages up to 100 total pages. Additional pages are priced /page and /size; for example 5x5 = $1.00/page, 8x8 = $1.50/page etc. The "Add to Cart" section should look something like this:
===========================
BOOK
- Size [5x5]
- Pages [ enter amount ]
Total: $75.00 [Add to Cart]
===========================
The simplest solution would be to add a pricing option with its own quantity field, except that functionality doesn't seem to be available.
I've considered the following:
- Commerce Option I: Creating a pricing attributes option (select list or radio button styles as a slider). The only caveat is the admin on adjusting pricing for 4000 options (50 books with 80 page options each) is a usability nightmare.
- Commerce Option II: Creating a pricing attributes integer field (acting as a quantity field) and using Rules to do the math and adjust the pricing. Unfortunately the variables and math did not seem to be available to Rules.
- Commerce Product Bundle: Creating a pages product variation and using page size as an attribute field. That would allow us to leverage the quantity field in the bundle's add to cart display. The problem in this case is two fold:
- Having to create 3 product variations, then having to create at least 2 products (book and book/pages bundle; 3 if you have different papers or page pricing needs to vary) each time you add a new book to your collection. This very quickly creates something close to an administrative hell for the shop owner.
- Commerce Product Bundle is still in Alpha, and has been for 2 years. No commits have been made in over a year. The module, even though it often works well, is buggy and doesn't play well with Commerce Option; which we leverage quite substantially.
- Custom Line Item: Using Randy Fay's "custom line item custom discount technique" leveraging an integer field and rules. I added an integer field to the product variation for cost per page. Then created an integer field which needed to be exposed to the customer. Using the combination of both I attempted to create a rule which calculated the additional price based on the product of the those fields. It does not appear that this is possible using Rules.
Conclusion, and request for additional brain power
I've gone around multiple circles trying to figure this one out and am about to go completely bonkers. Perhaps I'm missing something completely simple, or I'm approaching this problem from the wrong angle. Has anyone been able to do something similar? How did you achieve it?