Fix product quantity logic for CartFormHandler

Created on 30 May 2022, over 2 years ago
Updated 22 December 2023, 11 months ago

Problem/Motivation

After installing a module on the project that doesn't have "quantity" field in add-to-cart form -> on submit we have an error "No quantity or item id found".


"message":"Caught exception when trying to add item to reservation cart. Message was: No quantity or item id found"

Steps to reproduce

  1. Install the module ( and example of this module - Commerce product reservation simple ) on the project that doesn't have "quantity" field in add-to-cart form
  2. Create a product and variation that available for purchase
  3. Click "Reserve in store" in add-to-cart form of the product

Proposed resolution

Refactor ajaxCallback and submitForm methods to have compatibility with add-to-cart forms without "quantity" field.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇵🇱Poland ever-c0de Gdańsk 🇵🇱 🇺🇦 🇪🇺

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024