I have a product on my site (car keys) that requires 2 custom fields that would not affect pricing.
1. year and model of vehicle
2. image upload field for cutting of key
1. This field requires customers to input the year and model of the vehicle preferably by select list as it affects the specifics of the product that the customer does not need to be concerned about, but tells me what I product I need to send for those specific year and model of vehicle.
Although it is possible to create this as a product attribute, it would end up creating too many variations of products.
2. We offer key cutting service and require a field for customer to upload images of their key. The file field in product type and variation type allows the backend to upload the file, how can I add a field for the customer to upload on the front end?
Thanks.
Comments
Comment #2
bojanz commentedWhen the fields need to be selected by the customer, you put them on the order item, and expose them on the add to cart display.
See https://docs.drupalcommerce.org/commerce2/developer-guide/cart/quantity-... for how the add to cart display is customized.
Comment #3
99gs3 commentedbojanz thanks that suggestion works.
For the upload field, is it possible to provide an error message if the any of the variations that has the key cutting service attribute selected? I.e. required field?
Comment #4
bojanz commentedThat would be custom code on your end.