- Issue created by @vitaliyb98
This module provides the hook commerce_product_limits_form_commerce_order_item_add_to_cart_form_alter
, which works correctly with the default Add to Cart form. However, if you're using the commerce_variation_cart_form module, the form IDs will differ (e.g., commerce_order_item_variation_cart_form_form_commerce_product_variation_1). As a result, this hook will not be triggered for those forms.
I propose replacing commerce_product_limits_form_commerce_order_item_add_to_cart_form_alter with a general hook_form_alter(), and checking the form object instance using AddToCartFormInterface. This approach ensures compatibility with all Add to Cart forms, including those provided by the commerce_variation_cart_form module.
Active
1.0
Code