The Remove button does not remove the order item which has a required field

Created on 9 December 2024, 9 days ago

The Remove button in order item (shown from view cart-form) does not remove the order item which has a required field (order item - taken as form field from the view)

Hi, I have my Drupal Commerce website, where I have some fields (order-item fields which gather other info about my order) shown on the checkout page which is the cart-form view basically. I have shown those order item fields as form fields, so the user can fill those on the checkout page

Moreover, I have also added the remove button from the view (cart-form) which is working fine, but when I make a field from order item type as required, then when I click on the remove button on the checkout page, it says the field is required - which should not be the case, it should immediately remove the order item even if it has required order item fields.

How can you reproduce the issue (if it is not clear)

  • Just hide the product variation field (as it was a requirement from the client),
  • add two or three extra order-item fields,
  • Install the views_entity_form_field module, so we can directly edit/add data into the order item fields from the /cart-form
  • visit the /admin/structure/views/view/commerce_cart_form view, where you can add the fields shown to the user, before placing order, make sure to add those order item fields you have created as form field. Also add the remove button
  • Add some products to the cart, and visit /cart to see your fields (added from the view cart-form)
  • Try to remove some order items, it will work fine
  • Now go to your order item fields and make one of these fields required, the back to /cart, and try to click on the remove button, it won't delete the order-item
💬 Support request
Status

Active

Version

2.40

Component

DrupalCommerce.org

Created by

🇵🇰Pakistan masood ahmad

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024