Fix optValue notice

This commit is contained in:
Michael RICOIS 2017-06-30 17:47:53 +02:00
parent d5fe385ec8
commit 204bb6313a

View File

@ -8,20 +8,29 @@
{foreach item=optGroup from=$optGroupList}
<h4 class="{$optGroup['reference']}">{$optGroup['name']}</h4>
{if $optGroup['type'] == 'text'}
{foreach item=optImpact from=$optImpactList[$optGroup['id_product_configurator_opt_group']]}
{assign var="optValue" value=""}
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']][0]}
{/if}
{foreach item=optImpact from=$optImpactList[$optGroup['id_product_configurator_opt_group']]}
<input type="text" class="configurator-opt"
name="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}" placeholder="{$optImpact['name']}"
value="{$optValue}"/>
{/foreach}
{elseif $optGroup['type'] == 'textarea'}
{assign var="optValue" value=""}
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']][0]}
{/if}
<textarea class="configurator-opt" name="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}"
placeholder="{$optImpact['name']}" rows="3" cols="50">
{$optValue}
</textarea>
{elseif $optGroup['type'] == 'date'}
{assign var="optValue" value=""}
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']][0]}
{/if}
<input type="date" class="configurator-opt-datepicker"
name="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}"
value="{if $optValue eq ''}{$smarty.now|date_format:"%d %B %Y"}{else}{$optValue}{/if}" />
@ -29,13 +38,17 @@
<input type="file" class="configurator-opt-file" name="files"
data-field="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}"
data-url="/configurator/upload/{$id_product}/{$optGroup['reference']}"/>
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']][0])}
{assign var="optValue" value=""}
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']][0]}
{/if}
<span id="response-optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}">{$optValue}</span>
<input type="hidden" name="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}" value="{$optValue}"/>
{elseif $optGroup['type'] == 'radio'}
{assign var="optValue" value=array()}
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]}
{/if}
{foreach item=optImpact from=$optImpactList[$optGroup['id_product_configurator_opt_group']]}
<label>
<input type="radio" data-url="./?controller=product&impactprice=1&ajax=1" class="configurator-opt-click"
@ -45,7 +58,10 @@
</label>
{/foreach}
{elseif $optGroup['type'] == 'checkbox'}
{assign var="optValue" value=array()}
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]}
{/if}
{foreach item=optImpact from=$optImpactList[$optGroup['id_product_configurator_opt_group']]}
<label>
<input type="checkbox" data-url="./?controller=product&impactprice=1&ajax=1" class="configurator-opt-click"
@ -55,14 +71,20 @@
</label>
{/foreach}
{elseif $optGroup['type'] == 'select'}
{assign var="optValue" value=array()}
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]}
{/if}
<select class="configurator-opt-change" data-url="./?controller=product&impactprice=1&ajax=1" name="optgroup-{$optGroup['id_configurator_opt_group']}">
{foreach item=optImpact from=$optImpactList[$optGroup['id_product_configurator_opt_group']]}
<option value="{$optImpact['id_configurator_opt']}"{if in_array($optImpact['id_configurator_opt'],$optValue)} selected{/if}>{$optImpact['name']}</option>
<option value="{$optImpact['id_configurator_opt']}"{if in_array($optImpact['id_configurator_opt'], $optValue)} selected{/if}>{$optImpact['name']}</option>
{/foreach}
</select>
{elseif $optGroup['type'] == 'hidden'}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]['value'][0]}
{assign var="optValue" value=""}
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']][0]}
{/if}
<input type="hidden" name="optgroup-{$optGroup['id_configurator_opt_group']}" value="{$optValue}" />
{/if}
{/foreach}