Commit bb481435 authored by Matt Glaman's avatar Matt Glaman

Merge pull request #142 from mglaman/2061473-allow-spinner-disable

Issue #2061473: Make spinner JS configurable so module plays nicely w…
parents b2e3545c eb126f66
......@@ -134,10 +134,12 @@ function commerce_kickstart_product_ui_library() {
*/
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';
// Add quantity spinner widget & read more link.
if (!variable_get('commerce_kickstart_product_ui_spinner_disable', FALSE)) {
$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';
}
// Rename add-to-cart form fields label (quantity).
$form['quantity']['#title'] = t('Enter Quantity');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment