Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It doesn't work with Commerce Kickstart because, Kickstart use a javascript widget to display quantity on the product page.
To fix we have three options (thanks to @mglaman)
1) Use variable_set in a custom mofule
<?php
variable_set('commerce_kickstart_product_ui_spinner_disable', TRUE);
?>
2) Use a form_alter in a custom module
<?php
function MYMODULE_form_commerce_cart_add_to_cart_form_alter(&$form, &$form_state, $form_id) {
$form['#attached']['js'] = array():
}
?>
3) Updated settings.php
<?php
$conf['commerce_kickstart_product_ui_spinner_disable'] = TRUE;
?>
Comments
Comment #1
guy_schneerson CreditAttribution: guy_schneerson commentedthanks @heyyo for reporting will try and look into it
Comment #2
guy_schneerson CreditAttribution: guy_schneerson commentedThis is an Issue with the "Commerce Kickstart Product UI" module that comes with Kickstart 2.
This module adds a spinner JS and provides no configuration to control it, so it can not be turned off.
I don't think we can resolve it from our end as the two modules are modifying the same form element.
I will raise an Issue on kickstart but not sure if this is something they are willing to work on.
The only other option is for a user to disable the "Commerce Kickstart Product UI" module but this will disable all of the nice funky functionality on the product page.
optionally patching up the module by removing/commenting out the following lines
if anyone is interested can provide a patch
Comment #3
mglamanI've put up a patch in #2061473: Make spinner JS configurable so module plays nicely with other modules to allow disabling via variable_set('commerce_kickstart_product_ui_spinner_disable', TRUE);
Other solution, which can be implemented: (don't copy verbatim, enough to get one started.)
Comment #4
guy_schneerson CreditAttribution: guy_schneerson commentedThanks mglaman
Will mark as fixed, as I am not sure if this module should take it on itself to disable the jquery, although a config screen would be nice.
The project page has a link to this issue and updated the issue summary with your solution.
Comment #5
mglamanI'd like a config page, too. However there currently isn't one. I'd like to add one in which controls this setting and a few more :) figure a way to fix is better than no options at all for the moment.
Comment #6
guy_schneerson CreditAttribution: guy_schneerson commented@mglaman That's cool + I can add it to a Commerce decimal quantities config screen , but I think adding it to the settings.php is a viable solution even if you can't code.