Add Payment / Receive Payment amount should not be zero

Created on 10 August 2024, 4 months ago
Updated 26 August 2024, 4 months ago

How can we add a constraint to Add Payment / Receive Payment form and check that the amount cannot be zero?

/admin/commerce/orders/{{ order id }}/payments/add
/admin/commerce/orders/{{ order id }}/payments/{{ payment id }}/operation/receive

Thanks!

💬 Support request
Status

Fixed

Version

2.39

Component

Payment

Created by

🇭🇰Hong Kong richard cheung

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

Comments & Activities

  • Issue created by @richard cheung
  • Status changed to Fixed 4 months ago
  • 🇮🇱Israel jsacksick

    You can use the hook_form_BASE_FORM_ID_alter() or hook_form_FORM_ID_alter() and alter the "amount" field, probably setting an #after_build or #process callback to the $form["payment"]["amount"] field.

    IF you use the first option, functon name would be YOUR_MODULE_commerce_payment_form_alter().

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024