Custom width, height variant

Is it possible to have a custom width and height variant and have the cart update the product price?

Commerce requires each unique product to be, well, a unique product. With its own name, sku, price, stock, etc. So if you have a flexible product in different sizes, Commerce needs to have a unique product for each of those options.

Depending on the type of product you’re building, and the different sizes you offer, that could be a ton of products, in which case it would be better to create a custom add to cart snippet that takes in the width and height, does a calculation for the price, and dynamically creates (and checks for existing products) the Commerce product record. That way you don’t have to manually create all unique products up-front.

Keep in mind that the way products are represented in Commerce don’t necessarily have to match your front-end catalog.

For some types of products that consist of different parts (e.g., a car for which you can select the color, type of engine, and extra options), it could also be really interesting to build a configurator that results in a bundle product being created that lists each option with its own price. I’m actually working on a client project for something just like that, and have been given permission to share some of that when the project is over so will have more to share about that in the future :slight_smile:

Thanks Mark, It’s for a custom art frame store. They want customers to be able to enter a custom width and height for a frame. I’m gonna have to think about this one!

@lonzob It could be pretty straight-forward if you think about how you buy frames kits. You just need to break the product into lengths, so 8", 10", 20", etc. Then have something that calculates if a frame is 8x20 it needs 1x8" set and 1x20" set with each set being two sides (assuming they are all parallel frames).

The checkout might take some manipulation to get it to display how you want so that people can’t alter their quantities unevenly though.