Value of options

This commit is contained in:
Michael RICOIS 2017-07-24 15:41:20 +02:00
parent 9ed8ce6b35
commit c68083c0a3
3 changed files with 11 additions and 11 deletions

View File

@ -55,7 +55,7 @@ class ConfiguratorStorage extends ObjectModel
LEFT JOIN `'._DB_PREFIX_.'configurator_opt_lang` col LEFT JOIN `'._DB_PREFIX_.'configurator_opt_lang` col
ON (col.`id_configurator_opt` = pcoi.`id_configurator_opt` AND col.`id_lang` = '.(int)$context->language->id.') ON (col.`id_configurator_opt` = pcoi.`id_configurator_opt` AND col.`id_lang` = '.(int)$context->language->id.')
WHERE pcoi.`id_product` = '.(int)$id_product.' WHERE pcoi.`id_product` = '.(int)$id_product.'
ORDER BY co.`position` ASC'); ORDER BY pcoi.`id_product_configurator_opt_group`, co.`position` ASC');
return $result; return $result;
} }

View File

@ -12,7 +12,7 @@
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])} {if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']][0]} {assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']][0]}
{/if} {/if}
{foreach item=optImpact from=$optImpactList[$optGroup['id_product_configurator_opt_group']]} {foreach item=optImpact from=$optImpactList[$optGroup['id_configurator_opt_group']]}
<input type="text" class="configurator-opt" <input type="text" class="configurator-opt"
name="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}" placeholder="{$optImpact['name']}" name="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}" placeholder="{$optImpact['name']}"
value="{$optValue}"/> value="{$optValue}"/>
@ -49,7 +49,7 @@
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])} {if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]} {assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]}
{/if} {/if}
{foreach item=optImpact from=$optImpactList[$optGroup['id_product_configurator_opt_group']]} {foreach item=optImpact from=$optImpactList[$optGroup['id_configurator_opt_group']]}
<label> <label>
<input type="radio" data-url="./?controller=product&impactprice=1&ajax=1" class="configurator-opt-click" <input type="radio" data-url="./?controller=product&impactprice=1&ajax=1" class="configurator-opt-click"
name="optgroup-{$optGroup['id_configurator_opt_group']}" name="optgroup-{$optGroup['id_configurator_opt_group']}"
@ -62,7 +62,7 @@
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])} {if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]} {assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]}
{/if} {/if}
{foreach item=optImpact from=$optImpactList[$optGroup['id_product_configurator_opt_group']]} {foreach item=optImpact from=$optImpactList[$optGroup['id_configurator_opt_group']]}
<label> <label>
<input type="checkbox" data-url="./?controller=product&impactprice=1&ajax=1" class="configurator-opt-click" <input type="checkbox" data-url="./?controller=product&impactprice=1&ajax=1" class="configurator-opt-click"
name="optgroup-{$optGroup['id_configurator_opt_group']}[]" name="optgroup-{$optGroup['id_configurator_opt_group']}[]"
@ -76,7 +76,7 @@
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]} {assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]}
{/if} {/if}
<select class="configurator-opt-change" data-url="./?controller=product&impactprice=1&ajax=1" name="optgroup-{$optGroup['id_configurator_opt_group']}"> <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']]} {foreach item=optImpact from=$optImpactList[$optGroup['id_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} {/foreach}
</select> </select>
@ -91,7 +91,7 @@
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])} {if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]} {assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]}
{/if} {/if}
{foreach item=optImpact key=k from=$optImpactList[$optGroup['id_product_configurator_opt_group']]} {foreach item=optImpact key=k from=$optImpactList[$optGroup['id_configurator_opt_group']]}
<input type="text" name="optgroup-{$optGroup['id_configurator_opt_group']}[]" value="{if array_key_exists($k, $optValue)}{$optValue[$k]}{/if}" /> <input type="text" name="optgroup-{$optGroup['id_configurator_opt_group']}[]" value="{if array_key_exists($k, $optValue)}{$optValue[$k]}{/if}" />
{/foreach} {/foreach}
{/if} {/if}

View File

@ -20,7 +20,7 @@
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])} {if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']][0]} {assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']][0]}
{/if} {/if}
{foreach item=optImpact from=$optImpactList[$optGroup['id_product_configurator_opt_group']]} {foreach item=optImpact from=$optImpactList[$optGroup['id_configurator_opt_group']]}
<input type="text" class="configurator-opt" <input type="text" class="configurator-opt"
name="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}" placeholder="{$optGroup['name']}" value="{$optValue}"/> name="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}" placeholder="{$optGroup['name']}" value="{$optValue}"/>
<div class="valign-middle"> <div class="valign-middle">
@ -76,7 +76,7 @@
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])} {if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]} {assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]}
{/if} {/if}
{foreach item=optImpact from=$optImpactList[$optGroup['id_product_configurator_opt_group']]} {foreach item=optImpact from=$optImpactList[$optGroup['id_configurator_opt_group']]}
<li> <li>
<input type="radio" data-url="./?controller=product&impactprice=1&ajax=1" class="configurator-opt-click custom-input" <input type="radio" data-url="./?controller=product&impactprice=1&ajax=1" class="configurator-opt-click custom-input"
name="optgroup-{$optGroup['id_configurator_opt_group']}" name="optgroup-{$optGroup['id_configurator_opt_group']}"
@ -93,7 +93,7 @@
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])} {if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]} {assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]}
{/if} {/if}
{foreach item=optImpact from=$optImpactList[$optGroup['id_product_configurator_opt_group']]} {foreach item=optImpact from=$optImpactList[$optGroup['id_configurator_opt_group']]}
<li> <li>
<label for="group-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}">{$optImpact['name']}</label> <label for="group-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}">{$optImpact['name']}</label>
<input type="checkbox" data-url="./?controller=product&impactprice=1&ajax=1" <input type="checkbox" data-url="./?controller=product&impactprice=1&ajax=1"
@ -110,7 +110,7 @@
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]} {assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']]}
{/if} {/if}
<select class="configurator-opt-change" data-url="./?controller=product&impactprice=1&ajax=1" name="optgroup-{$optGroup['id_configurator_opt_group']}"> <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']]} {foreach item=optImpact from=$optImpactList[$optGroup['id_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} {/foreach}
</select> </select>
@ -126,7 +126,7 @@
{if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])} {if isset($optSelectedValues[$optGroup['id_configurator_opt_group']])}
{assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']][0]} {assign var="optValue" value=$optSelectedValues[$optGroup['id_configurator_opt_group']][0]}
{/if} {/if}
{foreach item=optImpact from=$optImpactList[$optGroup['id_product_configurator_opt_group']]} {foreach item=optImpact from=$optImpactList[$optGroup['id_configurator_opt_group']]}
<input type="text" class="configurator-opt" <input type="text" class="configurator-opt"
name="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}[]" placeholder="{l s="Saisissez la quantité souhaitée"}" name="optgroup-{$optGroup['id_configurator_opt_group']}-{$optImpact['id_configurator_opt']}[]" placeholder="{l s="Saisissez la quantité souhaitée"}"
value="{$optValue}" pattern="[0-9]{literal}{1,}{/literal}"/> value="{$optValue}" pattern="[0-9]{literal}{1,}{/literal}"/>