It would be good to fill all currently empty Quantity values as "1" by default. Because it does function as "1" is inside at the moment.

Keeping all quantity values empty and forcing customers to think that they have to fill "1" inside quantity value before pressing "Add to cart" button is not so user friendly.

Comments

devad created an issue. See original summary.

devad’s picture

Issue summary: View changes
devad’s picture

Title: Add "Default quantity value" option » Fill all quantity values as "1" by default
Issue summary: View changes
scoff’s picture

Is it harder than adding value=1 to basic_cart.js?
I'm asking because it's not been done so far and it's really not easy to fix this without hacking the code (like using your theme or module js).

var dynamic_input = '<label for="edit-quantity" class="js-form-required form-required '+ drupalSettings.basic_cart.label_class
 +'">'+quantity_label+'</label> <input type="text" ----->value="1"<----- class="quantity_dynamic_text form-text required '+drupalSettings.basic_cart.textfield_class
+'" id="'+dynamic_id+'">';
ivnish’s picture

Hi devad! Bug exists in last dev-version? Can you check it?

In my cart Quantity=1 by default.

karthikeyan-manivasagam, are you fix this earlier?

scoff’s picture

StatusFileSize
new7.67 KB

The bug is still there. Quantity field is empty in an Add to cart with quantity widget. Cart works fine even if the field left empty before clicking on Add to cart, but it's unintuitive.

Add to cart with quantity

ivnish’s picture

Category: Feature request » Bug report
ivnish’s picture

StatusFileSize
new931 bytes
ivnish’s picture

Status: Active » Needs review
scoff’s picture

Patch #8 works fine, thank you. I had to copy it to "js" folder to apply.

ivnish’s picture

Sorry. I make patch with PHPStorm. I recreate it soon.

ivnish’s picture

StatusFileSize
new712 bytes
ivnish’s picture

StatusFileSize
new712 bytes
ivnish’s picture

  • itcrowd72 authored 5ccc9ee on 8.x-6.x
    Issue #2908008 by itcrowd72, scoff: Fill all quantity values as "1" by...
karthikeyan-manivasagam’s picture

Status: Needs review » Fixed

Thank you all

Status: Fixed » Closed (fixed)

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