Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUG: When you enter a value using the cart quantity field, it breaks.…

… This is because the setquantity url is not formed properly in the ecommerce.js file.

fixes #76
  • Loading branch information...
commit 845cf913ef2c351a4b4646d1ca95a44d1f2716ae 1 parent d85c7b0
@jedateach jedateach authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 javascript/ecommerce.js
View
8 javascript/ecommerce.js
@@ -11,7 +11,13 @@ jQuery(document).ready(
setQuantityLink = jQuery(setQuantityLink).get(0);
if(! this.value) this.value = 0;
else this.value = this.value.replace(/[^0-9]+/g, '');
- var url = jQuery('base').attr('href') + setQuantityLink.value + '?quantity=' + this.value;
+ var url = jQuery('base').attr('href') + setQuantityLink.value;
+ var parts = url.split("?");
+ if(parts.length > 1){
+ url += '&quantity=' + this.value;
+ }else{
+ url += '?quantity=' + this.value;
+ }
jQuery.getJSON(url, null, setChanges);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.