Skip to content

Commit

Permalink
Fixes mrvautin#37
Browse files Browse the repository at this point in the history
  • Loading branch information
mrvautin committed Feb 10, 2019
1 parent 0ce3a16 commit 52828cb
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 8 deletions.
11 changes: 9 additions & 2 deletions public/javascripts/expressCart.js
Original file line number Diff line number Diff line change
Expand Up @@ -757,9 +757,16 @@ function updateCartDiv(){
function getSelectedOptions(){
var options = {};
$('.product-opt').each(function(){
options[$(this).attr('name')] = $(this).val();
if($(this).attr('name') === 'opt-'){
options[$(this).val().trim()] = $(this).prop('checked');
return;
}
var optionValue = $(this).val().trim();
if($(this).attr('type') === 'radio'){
optionValue = $('input[name="' + $(this).attr('name') + '"]:checked').val();
}
options[$(this).attr('name').substring(4, $(this).attr('name').length)] = optionValue;
});

return options;
}

Expand Down
2 changes: 1 addition & 1 deletion public/javascripts/expressCart.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions views/order.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
(
{{#each this.options}}
{{#if @last}}
{{this}}
{{@key}}: {{this}}
{{else}}
{{this}} /
{{@key}}: {{this}} /
{{/if}}
{{/each}}
)
Expand Down
9 changes: 8 additions & 1 deletion views/themes/Cloth/cart.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@
<a class="cart-link" href="/product/{{this.link}}">{{this.title}}</a>
</p>
<p>
&nbsp;{{#each this.options}} {{#if @last}} {{this}} {{else}} {{this}} / {{/if}} {{/each}}
&nbsp;
{{#each this.options}}
{{#if @last}}
{{@key}}: {{this}}
{{else}}
{{@key}}: {{this}} /
{{/if}}
{{/each}}
</p>
<p>
<div class="form-group">
Expand Down
9 changes: 8 additions & 1 deletion views/themes/Material/cart.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@
<a class="cart-link" href="/product/{{this.link}}">{{this.title}}</a>
</p>
<p>
&nbsp;{{#each this.options}} {{#if @last}} {{this}} {{else}} {{this}} / {{/if}} {{/each}}
&nbsp;
{{#each this.options}}
{{#if @last}}
{{@key}}: {{this}}
{{else}}
{{@key}}: {{this}} /
{{/if}}
{{/each}}
</p>
<p>
<div class="col s12 no-pad-left">
Expand Down
9 changes: 8 additions & 1 deletion views/themes/Mono/cart.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@
<a class="cart-link" href="/product/{{this.link}}">{{this.title}}</a>
</p>
<p>
&nbsp;{{#each this.options}} {{#if @last}} {{this}} {{else}} {{this}} / {{/if}} {{/each}}
&nbsp;
{{#each this.options}}
{{#if @last}}
{{@key}}: {{this}}
{{else}}
{{@key}}: {{this}} /
{{/if}}
{{/each}}
</p>
<p>
<div class="col s12 no-pad-left">
Expand Down

0 comments on commit 52828cb

Please sign in to comment.