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

guy_schneerson’s picture

thanks @heyyo for reporting will try and look into it

guy_schneerson’s picture

Title: Compatibility with Kickstart » Compatibility with Commerce Kickstart 2

This 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

<?php
function commerce_kickstart_product_ui_form_alter(&$form, &$form_state, $form_id) {
  if (strstr($form_id, 'commerce_cart_add_to_cart_form')) {
    // Add quantity spinner widget & read more link
//    $form['#attached']['library'][] = array('commerce_kickstart_product_ui', 'jquery_expander');
//    $form['#attached']['library'][] = array('commerce_kickstart_product_ui', 'jquery_ui_spinner');
//    $form['#attached']['js'][] = drupal_get_path('module', 'commerce_kickstart_product_ui') . '/commerce_kickstart_product_ui.js';
?>

if anyone is interested can provide a patch

mglaman’s picture

Issue summary: View changes

I'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.)

function hook_form_commerce_cart_add_to_cart_form_alter(&$form, &$form_state, $form_id) {
  $form['#attached']['js'] = array():
}
guy_schneerson’s picture

Issue summary: View changes
Status: Active » Fixed

Thanks 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.

mglaman’s picture

I'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.

guy_schneerson’s picture

@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.

Status: Fixed » Closed (fixed)

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