Finished product feature values
This commit is contained in:
@@ -1,157 +1,175 @@
|
||||
<div class="form-container">
|
||||
<form method="POST" action="{url path="/admin/product/$ID/update-attributes-and-features"}" id="attribute_form">
|
||||
|
||||
<input type="hidden" name="product_id" value="{$product_id}" />
|
||||
<input type="hidden" name="current_tab" value="attributes" />
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<form method="POST" class="clearfix" action="{url path="/admin/product/$ID/set-product-template"}" id="product_template_form">
|
||||
|
||||
{include
|
||||
file="includes/inner-form-toolbar.html"
|
||||
hide_submit_buttons=false
|
||||
close_url="{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}"
|
||||
}
|
||||
<input type="hidden" name="product_id" value="{$product_id}" />
|
||||
<input type="hidden" name="current_tab" value="attributes" />
|
||||
|
||||
<div class="alert alert-info">
|
||||
{intl l="To use features or attributes on this product, please select a product template. You can define product templates in the Configuration section of the administration."}
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="well">
|
||||
<p>{intl l="To use features or attributes on this product, please select a product template. You can define product templates in the Configuration section of the administration."}</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<label for="template_id" class="control-label">
|
||||
{intl l='Product template'} :
|
||||
</label>
|
||||
<label for="template_id" class="control-label">
|
||||
{intl l='Current product template'} :
|
||||
</label>
|
||||
|
||||
<div class="input-group">
|
||||
<select required="required" name="template_id" id="template_id" class="form-control">
|
||||
<option value="">{intl l='Select a product template...'}</option>
|
||||
{loop name="product_template_select" type="template"}
|
||||
<option value="{$ID}" {if $TEMPLATE == $ID}selected="selected"{/if}>{$NAME}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
<div class="input-group">
|
||||
<select required="required" name="template_id" id="template_id" class="form-control">
|
||||
<option value="0">{intl l='Do not use a product template'}</option>
|
||||
{loop name="product_template_select" type="template"}
|
||||
<option value="{$ID}" {if $TEMPLATE == $ID}selected="selected"{/if}>{$NAME}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
<span class="input-group-btn" id="apply_template_button">
|
||||
<button class="btn btn-default btn-primary action-btn" type="button">{intl l="Apply this template"}</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{ifloop rel="product_template"}
|
||||
|
||||
{* -- Begin attributes management ------------------------------- *}
|
||||
|
||||
<div class="row">
|
||||
{loop name="product_template" type="template" id={$TEMPLATE|default:0}}{/loop}
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<p class="title title-without-tabs">{intl l='Product Attributes'}</p>
|
||||
<span class="input-group-btn" id="apply_template_button">
|
||||
<button class="btn btn-default btn-primary action-btn" type="submit">{intl l="Apply this template"}</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* -- End attributes management ---------------------------------- *}
|
||||
{* Check if a product template is defined *}
|
||||
|
||||
{* -- Begin features management ---------------------------------- *}
|
||||
{loop name="product_template" type="template" id={$TEMPLATE|default:0}}{/loop}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
{ifloop rel="product_template"}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p class="title title-without-tabs">{intl l='Product Attributes and Features'}</p>
|
||||
|
||||
<p class="title title-without-tabs">{intl l='Product Features'}</p>
|
||||
<p>{intl l='Enter here product features'}</p>
|
||||
<form method="POST" action="{url path="/admin/product/$ID/update-attributes-and-features"}" id="attribute_form">
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-condensed table-left-aligned">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl l='Feature Name'}</th>
|
||||
<th>{intl l='Feature value for this product'}</th>
|
||||
<input type="hidden" name="product_id" value="{$product_id}" />
|
||||
<input type="hidden" name="current_tab" value="attributes" />
|
||||
|
||||
{module_include location='product_features_table_header'}
|
||||
{include
|
||||
file="includes/inner-form-toolbar.html"
|
||||
hide_submit_buttons=false
|
||||
close_url="{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}"
|
||||
}
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{loop name="product-features" type="feature" order="manual" product="$product_id" backend_context="1" lang="$edit_language_id"}
|
||||
<tr>
|
||||
<td>{$TITLE}</td>
|
||||
{* -- Begin attributes management ------------------------------- *}
|
||||
|
||||
<td>
|
||||
{* Multiple values *}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<p class="title title-without-tabs">{intl l='Product Attributes'}</p>
|
||||
|
||||
{ifloop rel="product-features-av"}
|
||||
<div class="alert alert-danger">Please code me baby, oh yeah ! Code me NOW !</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{loop name="free-text-value" exclude_free_text="true" type="feature_value" product=$product_id feature=$ID backend_context="1" lang="$edit_language_id"}
|
||||
value={$FEATURE_AV_ID}: {$TITLE}<br />
|
||||
{/loop}
|
||||
{* -- Begin features management ---------------------------------- *}
|
||||
|
||||
{capture "select_options"}
|
||||
{loop name="product-features-av" type="feature-availability" feature=$ID order="manual" backend_context="1" lang="$edit_language_id"}
|
||||
<option value="{$ID}">{$TITLE}</option>
|
||||
{$options_count = $LOOP_COUNT} {* LOOP_COUNT is only available inside the loop ! *}
|
||||
{/loop}
|
||||
{/capture}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<p class="title title-without-tabs">{intl l='Product Features'}</p>
|
||||
|
||||
<div class="input-form">
|
||||
<select multiple="multiple" name="feature_value[{$ID}][]" id="feature_value_{$ID}" size="{$options_count}" class="form-control">
|
||||
{$smarty.capture.select_options nofilter}
|
||||
</select>
|
||||
</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-condensed table-left-aligned">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl l='Feature Name'}</th>
|
||||
<th>{intl l='Feature value for this product'}</th>
|
||||
|
||||
<span class="help-block text-right">
|
||||
{intl l='Use ctrl+clic to select more than one value. You can also <a href="#" class="clear_feature_value" data-id="%id">clear selected values</a>.' id=$ID}
|
||||
</span>
|
||||
{module_include location='product_features_table_header'}
|
||||
|
||||
{/ifloop}
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
{* Free feature *}
|
||||
<tbody>
|
||||
{loop name="product-features" type="feature" order="manual" product="$product_id" backend_context="1" lang="$edit_language_id"}
|
||||
<tr>
|
||||
<td>{$TITLE}</td>
|
||||
|
||||
{elseloop rel="product-features-av"}
|
||||
{* Get the free text value *}
|
||||
<td>
|
||||
{* Multiple values *}
|
||||
|
||||
{loop name="free-text-value" exclude_feature_availability="1" type="feature_value" product=$product_id feature=$ID backend_context="1" lang="$edit_language_id"}
|
||||
{$feature_value=$FREE_TEXT_VALUE}
|
||||
{/loop}
|
||||
{ifloop rel="product-features-av"}
|
||||
|
||||
<input type="text" id="feature_text_value_{$ID}" name="feature_text_value[{$ID}]" title="{intl l='Enter here the feature value as free text'}" placeholder="{intl l='Feature value'}" class="form-control" value="{$feature_value|default:''}">
|
||||
{/elseloop}
|
||||
</td>
|
||||
{* load all selected values in an array to speed up things a little *}
|
||||
|
||||
{module_include location='product_features_table_row'}
|
||||
{$selected = array()}
|
||||
|
||||
</tr>
|
||||
{/loop}
|
||||
{loop name="free-text-value" exclude_free_text="true" type="feature_value" product=$product_id feature=$ID backend_context="1" lang="$edit_language_id"}
|
||||
{$selected[] = $FEATURE_AV_ID}
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="product-features"}
|
||||
<tr>
|
||||
<td>
|
||||
<div class="alert alert-info">
|
||||
{intl l="This product contains no features"}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/elseloop}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{capture "select_options"}
|
||||
{loop name="product-features-av" type="feature-availability" feature=$ID order="manual" backend_context="1" lang="$edit_language_id"}
|
||||
<option value="{$ID}" {if in_array($ID, $selected)}selected="selected"{/if}>{$TITLE}</option>
|
||||
|
||||
{* -- End features management ------------------------------- *}
|
||||
</div>
|
||||
{/ifloop}
|
||||
{$options_count = $LOOP_COUNT} {* LOOP_COUNT is only available inside the loop ! *}
|
||||
{/loop}
|
||||
{/capture}
|
||||
|
||||
{elseloop rel="product_template"}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="input-form">
|
||||
<select multiple="multiple" name="feature_value[{$ID}][]" id="feature_value_{$ID}" size="{$options_count}" class="form-control">
|
||||
{$smarty.capture.select_options nofilter}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-info">
|
||||
{intl l="This product is not attached to any product template. If you want to use features or attributes on this product, please select the proper template. You can define product templates in the Configuration section."}
|
||||
</div>
|
||||
</div>
|
||||
<span class="help-block text-right">
|
||||
{intl l='Use ctrl+clic to select more than one value. You can also <a href="#" class="clear_feature_value" data-id="%id">clear selected values</a>.' id=$ID}
|
||||
</span>
|
||||
{/ifloop}
|
||||
|
||||
{* Free text *}
|
||||
|
||||
{elseloop rel="product-features-av"}
|
||||
{* Get the free text value *}
|
||||
|
||||
{loop name="free-text-value" exclude_feature_availability="1" type="feature_value" product=$product_id feature=$ID backend_context="1" lang="$edit_language_id"}
|
||||
{$feature_value=$FREE_TEXT_VALUE}
|
||||
{/loop}
|
||||
|
||||
<input type="text" id="feature_text_value_{$ID}" name="feature_text_value[{$ID}]" title="{intl l='Enter here the feature value as free text'}" placeholder="{intl l='Feature value'}" class="form-control" value="{$feature_value|default:''}">
|
||||
{/elseloop}
|
||||
</td>
|
||||
|
||||
{module_include location='product_features_table_row'}
|
||||
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="product-features"}
|
||||
<tr>
|
||||
<td>
|
||||
<div class="alert alert-info">
|
||||
{intl l="This product contains no features"}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/elseloop}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{/elseloop}
|
||||
</div>
|
||||
{/ifloop}
|
||||
|
||||
</form>
|
||||
</div>
|
||||
{elseloop rel="product_template"}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p></p> {* bouuuuuh ! *}
|
||||
<div class="alert alert-info">
|
||||
{intl l="This product is not attached to any product template. If you want to use features or attributes on this product, please select the proper template. You can define product templates in the Configuration section."}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/elseloop}
|
||||
</div>
|
||||
@@ -17,7 +17,7 @@
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/product' product_id={$product_d}}" />
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='locale'}
|
||||
|
||||
Reference in New Issue
Block a user