master
Mark Moffat 2019-02-10 14:16:42 +10:30
parent 0ce3a16817
commit 52828cbd40
6 changed files with 36 additions and 8 deletions

View File

@ -757,9 +757,16 @@ function updateCartDiv(){
function getSelectedOptions(){ function getSelectedOptions(){
var options = {}; var options = {};
$('.product-opt').each(function(){ $('.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; return options;
} }

File diff suppressed because one or more lines are too long

View File

@ -51,9 +51,9 @@
( (
{{#each this.options}} {{#each this.options}}
{{#if @last}} {{#if @last}}
{{this}} {{@key}}: {{this}}
{{else}} {{else}}
{{this}} / {{@key}}: {{this}} /
{{/if}} {{/if}}
{{/each}} {{/each}}
) )

View File

@ -23,7 +23,14 @@
<a class="cart-link" href="/product/{{this.link}}">{{this.title}}</a> <a class="cart-link" href="/product/{{this.link}}">{{this.title}}</a>
</p> </p>
<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>
<p> <p>
<div class="form-group"> <div class="form-group">

View File

@ -22,7 +22,14 @@
<a class="cart-link" href="/product/{{this.link}}">{{this.title}}</a> <a class="cart-link" href="/product/{{this.link}}">{{this.title}}</a>
</p> </p>
<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>
<p> <p>
<div class="col s12 no-pad-left"> <div class="col s12 no-pad-left">

View File

@ -22,7 +22,14 @@
<a class="cart-link" href="/product/{{this.link}}">{{this.title}}</a> <a class="cart-link" href="/product/{{this.link}}">{{this.title}}</a>
</p> </p>
<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>
<p> <p>
<div class="col s12 no-pad-left"> <div class="col s12 no-pad-left">