Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a shippable product variant type. Now the default "Weight" has been added. Since I only have one flat rate shipping rate, I don't want to do any caculation based on weight etc. This is why I would like to remove the "Weight" field. As @bojanz told me this is not possible. He suggested making the filed optional. Since the field is locked, I can't configure that either.
What could we improve here?
Comments
Comment #2
mengi CreditAttribution: mengi commentedI agree with making this field optional or even being able to remove it as a lot of times shipping is a flat rate.
Comment #3
joachim CreditAttribution: joachim at Torchbox commentedIt's possible to hide the weight field in the form display options, but I don't know what the consequences of that would be -- would Shipping complain at some point in checkout when it doesn't find a value there?
Comment #4
matolog CreditAttribution: matolog commentedinterested too.
Comment #5
steveoriolCan we not set up a default value for this field ?
Comment #6
steveoriolHere is what I have done for the moment and seems to work, in my case the type of product are tickets that weigh 10 grams each. so I hid the "weight" field and modify the following configuration file after exporting it (admin/config/development/configuration/single/export), modified and re-importing (admin/config/development/configuration/single/import):
File: field.field.commerce_product_variation.ticket.weight.yml (ticket are your product type)
change:
default_value: { }
by:
It works, but I do not know for how long ...
Comment #7
willeaton CreditAttribution: willeaton commentedThis doesn't work for existing products but is great for new products. I think I'm going to have to override the entity form, set a value of 0 and hide it.
UPDATE: couldnt do a form alter, I hid the field in the product variation form display panel. This removed the field from the form and didnt throw any errors.
Comment #8
mglamanClosing as a duplicate for #3062282: Allow individual variations to be non-shippable. There the feature request is more laid out, and the field does not need to be configurable and will allow variations to opt-out.
Comment #9
bojanz CreditAttribution: bojanz at Centarro commentedI am not sure it's the same request. People here have shippable variations, they just don't find the Weight field useful.
It does seem like there's a potential conflict with the other issue, though. Let's keep it open until we have a more definitive answer.
Comment #10
mglamanTrue. Should this issue cover "we want to ship, but weight is not part of our data model" and the other issue "we have items which are not shippable, so we will omit the weight."
I wonder if we can find a happy medium where products are flagged as shippable, can or cannot have a weight and a way to opt-out of being shippable per variation.
Comment #11
jastraat CreditAttribution: jastraat at Technivant commentedWe would also like the option of having a product variation that is shippable without a required weight.
Comment #12
jastraat CreditAttribution: jastraat at Technivant commentedDuplicated due to a site 5xx error
Comment #13
tancJust come across this issue as we're configuring shippable products but the client uses a flat-rate (their own courier) and weight is not a factor for them.
Comment #14
danharper CreditAttribution: danharper at hrpr commentedI'm have a similar use case to others, I'm using flat rate but not using weight in the calculations as the customer doesn't have that information.
It would be useful to set default value to 0.
Comment #15
UriDrupal CreditAttribution: UriDrupal commentedExperiencing the same similar case. There's a fixed rater of 2 prices, I don't need to calculate shipping costs based on Price, so having weight on a product variation is superfluous. Is there a way to turn it off?