Finished product multiple categories attachment
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
</select>
|
||||
|
||||
<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>
|
||||
<button class="btn btn-default btn-primary action-btn" type="submit">{intl l="Apply"}</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -43,9 +43,6 @@
|
||||
|
||||
{* Check if a product template is defined *}
|
||||
|
||||
{loop name="product_template" type="template" id={$TEMPLATE|default:0}}{/loop}
|
||||
|
||||
{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>
|
||||
@@ -70,10 +67,18 @@
|
||||
<div class="form-group">
|
||||
<p class="title title-without-tabs">{intl l='Product Attributes'}</p>
|
||||
|
||||
<p>{intl
|
||||
l="You can change attributes and their positions in <a href=\"%tpl_mgmt_url\" target=\"tpl_window\">the template configuration page</a>."
|
||||
<p>
|
||||
{if $TEMPLATE}
|
||||
{intl
|
||||
l="You can change template attributes and their positions in <a href=\"%tpl_mgmt_url\" target=\"tpl_window\">the template configuration page</a>."
|
||||
tpl_mgmt_url={url path='/admin/configuration/templates/update' template_id=$TEMPLATE}
|
||||
}
|
||||
}
|
||||
{else}
|
||||
{intl
|
||||
l="You can change attributes and their positions in <a href=\"%tpl_mgmt_url\" target=\"tpl_window\">the attributes configuration page</a>."
|
||||
tpl_mgmt_url={url path='/admin/configuration/attributes'}
|
||||
}
|
||||
{/if}
|
||||
</p>
|
||||
|
||||
<div class="alert alert-danger">Please code me baby, oh yeah ! Code me NOW !</div>
|
||||
@@ -88,10 +93,18 @@
|
||||
<div class="form-group">
|
||||
<p class="title title-without-tabs">{intl l='Product Features'}</p>
|
||||
|
||||
<p>{intl
|
||||
l="You can change feature products and their positions in <a href=\"%tpl_mgmt_url\" target=\"tpl_window\">the template configuration page</a>."
|
||||
tpl_mgmt_url={url path='/admin/configuration/templates/update' template_id=$TEMPLATE}
|
||||
}
|
||||
<p>
|
||||
{if $TEMPLATE}
|
||||
{intl
|
||||
l="You can change templates features and their positions in <a href=\"%tpl_mgmt_url\" target=\"tpl_window\">the template configuration page</a>."
|
||||
tpl_mgmt_url={url path='/admin/configuration/templates/update' template_id=$TEMPLATE}
|
||||
}
|
||||
{else}
|
||||
{intl
|
||||
l="You can change feature and their positions in <a href=\"%tpl_mgmt_url\" target=\"tpl_window\">the features configuration page</a>."
|
||||
tpl_mgmt_url={url path='/admin/configuration/features'}
|
||||
}
|
||||
{/if}
|
||||
</p>
|
||||
|
||||
<div class="table-responsive">
|
||||
@@ -139,7 +152,7 @@
|
||||
</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}
|
||||
{intl l='Use Ctrl+click 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}
|
||||
|
||||
@@ -179,18 +192,7 @@
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{/ifloop}
|
||||
|
||||
{elseloop rel="product_template"}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<p></p> {* <---- FIXME Lame ! *}
|
||||
<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>
|
||||
{/loop}
|
||||
|
||||
|
||||
75
templates/admin/default/ajax/product-prices-tab.html
Normal file
75
templates/admin/default/ajax/product-prices-tab.html
Normal file
@@ -0,0 +1,75 @@
|
||||
{loop name="product_edit" type="product" visible="*" id=$product_id backend_context="1" lang=$edit_language_id}
|
||||
<div class="form-container">
|
||||
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="panel-title">{intl l="Basic product information"}</div>
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
{form_field form=$form field='price'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
|
||||
{loop type="currency" name="default-currency" default_only="1" backend_context="1"}
|
||||
|
||||
<div class="input-group">
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="col-lg-2 form-control" value="{$value}" title="{$label}" placeholder="{intl l='Product price'}">
|
||||
<span class="input-group-addon">{$SYMBOL}</span>
|
||||
</div>
|
||||
<div class="help-block">{intl l='Enter here the product price in the default currency (%title)' title=$NAME}</div>
|
||||
|
||||
{form_field form=$form field='currency'}
|
||||
<input type="hidden" name="{$name}" value="{$ID}" />
|
||||
{/form_field}
|
||||
|
||||
{/loop}
|
||||
</div>
|
||||
{/form_field}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">
|
||||
{form_field form=$form field='tax_rule'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
|
||||
<div class="form-group">
|
||||
<select id="{$label_attr.for}" required="required" name="{$name}" class="form-control">
|
||||
<option value="">{intl l="Select a tax tule"}</option>
|
||||
{loop name="tax" type="tax-rule" backend_context="1"}
|
||||
<option value="{$ID}" {if $IS_DEFAULT}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="help-block">{intl l='Select here the tax applicable to this product'}</div>
|
||||
|
||||
</div>
|
||||
{/form_field}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4">
|
||||
Price w/tax
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{form_field form=$form field='weight'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{$label}: </label>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<div class="input-group">
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Product weight'}">
|
||||
<span class="input-group-addon">{intl l="Kg"}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="help-block">{intl l='Enter here the product weight, in Kilogrammes'}</div>
|
||||
</div>
|
||||
{/form_field}
|
||||
</div>
|
||||
</div>
|
||||
{/loop}
|
||||
@@ -9,228 +9,347 @@
|
||||
close_url = "{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}"
|
||||
}
|
||||
|
||||
{* -- Begin related content management -- *}
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<form method="POST" action="{url path='/admin/products/content/add'}" id="related_content_form">
|
||||
{* -- Begin related content management ------------------------------ *}
|
||||
|
||||
<p class="title title-without-tabs">{intl l='Related content'}</p>
|
||||
<p>{intl l='You can attach here some content to this product'}</p>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<form method="POST" action="{url path='/admin/products/content/add'}" id="related_content_form">
|
||||
|
||||
<input type="hidden" name="product_id" value="{$product_id}" />
|
||||
<input type="hidden" name="current_tab" value="related" />
|
||||
<p class="title title-without-tabs">{intl l='Related content'}</p>
|
||||
<p>{intl l='You can attach here some content to this product'}</p>
|
||||
|
||||
{ifloop rel="folders"}
|
||||
<div class="form-group">
|
||||
<select name="folder_id" id="folder_id" class="form-control">
|
||||
<option value="">{intl l='Select a folder...'}</option>
|
||||
{loop name="folders" type="folder-tree" folder="0" backend_context="1" lang="$edit_language_id"}
|
||||
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px">{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
<input type="hidden" name="product_id" value="{$product_id}" />
|
||||
<input type="hidden" name="current_tab" value="related" />
|
||||
|
||||
<span class="help-block">{intl l='Select a folder to get its content'}</span>
|
||||
</div>
|
||||
{ifloop rel="folders"}
|
||||
<div class="form-group">
|
||||
<select name="folder_id" id="folder_id" class="form-control">
|
||||
<option value="">{intl l='Select a folder...'}</option>
|
||||
{loop name="folders" type="folder-tree" folder="0" backend_context="1" lang="$edit_language_id"}
|
||||
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px">{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
<div id="content_selector" class="hide">
|
||||
<span class="help-block">{intl l='Select a folder to get its content'}</span>
|
||||
</div>
|
||||
|
||||
<div id="content_selector" class="hide">
|
||||
<div class="input-group">
|
||||
<select required="required" name="content_id" id="content_id" class="form-control">
|
||||
<option value="">{intl l='Select a folder content...'}</option>
|
||||
</select>
|
||||
<span class="input-group-btn" id="content_add_button">
|
||||
<button class="btn btn-default btn-primary action-btn" type="submit"><span class="glyphicon glyphicon-plus-sign"></span></button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<span class="help-block">{intl l='Select a content and click (+) to add it to this product'}</span>
|
||||
</div>
|
||||
|
||||
<div id="content_selector_empty" class="hide">
|
||||
<div class="alert alert-info">
|
||||
{intl l="No available content in this folder"}
|
||||
</div>
|
||||
</div>
|
||||
{/ifloop}
|
||||
|
||||
{elseloop rel="folders"}
|
||||
<div class="alert alert-info">{intl l="No folders found"}</div>
|
||||
{/elseloop}
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-condensed table-left-aligned">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl l='ID'}</th>
|
||||
|
||||
<th>{intl l='Content title'}</th>
|
||||
|
||||
<th class="text-center">{intl l='Position'}</th>
|
||||
|
||||
{module_include location='product_contents_table_header'}
|
||||
|
||||
<th class="actions">{intl l="Actions"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{loop name="assigned_contents" type="associated_content" product="$product_id" backend_context="1" lang="$edit_language_id"}
|
||||
<tr>
|
||||
<td>{$ID}</td>
|
||||
|
||||
<td>
|
||||
{$TITLE}
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
{admin_position_block
|
||||
permission="admin.products.edit"
|
||||
path={url path='/admin/product/update-content-position' product_id=$product_id current_tab="related"}
|
||||
url_parameter="content_id"
|
||||
in_place_edit_class="contentPositionChange"
|
||||
position=$POSITION
|
||||
id=$ID
|
||||
}
|
||||
</td>
|
||||
|
||||
{module_include location='product_contents_table_row'}
|
||||
|
||||
<td class="actions">
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.product.content.delete"}
|
||||
<a class="btn btn-default btn-xs delete-content" title="{intl l='Delete this content'}" href="#delete_content_dialog" data-id="{$ID}" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</a>
|
||||
{/loop}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="assigned_contents"}
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="alert alert-info">
|
||||
{intl l="This product contains no contents"}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/elseloop}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* -- End related content management -------------------------------- *}
|
||||
|
||||
{* -- Begin accessories management ---------------------------------- *}
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<form method="POST" action="{url path='/admin/products/accessory/add'}" id="accessory_form">
|
||||
|
||||
<p class="title title-without-tabs">{intl l='Product accessories'}</p>
|
||||
<p>{intl l='Define here this product\'s accessories'}</p>
|
||||
|
||||
<input type="hidden" name="product_id" value="{$product_id}" />
|
||||
<input type="hidden" name="current_tab" value="related" />
|
||||
|
||||
{ifloop rel="categories"}
|
||||
<div class="form-group">
|
||||
<select name="accessory_category_id" id="accessory_category_id" class="form-control">
|
||||
<option value="">{intl l='Select a category...'}</option>
|
||||
{loop name="categories" type="category-tree" category="0" backend_context="1" lang="$edit_language_id"}
|
||||
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px">{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
<span class="help-block">{intl l='Select a category to get its products'}</span>
|
||||
</div>
|
||||
|
||||
<div id="accessory_selector" class="hide">
|
||||
<div class="input-group">
|
||||
<select required="required" name="accessory_id" id="accessory_id" class="form-control">
|
||||
<option value="">{intl l='Select a product...'}</option>
|
||||
</select>
|
||||
<span class="input-group-btn" id="accessory_add_button">
|
||||
<button class="btn btn-default btn-primary action-btn" type="submit"><span class="glyphicon glyphicon-plus-sign"></span></button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<span class="help-block">{intl l='Select a product and click (+) to add it as an accessory'}</span>
|
||||
</div>
|
||||
|
||||
<div id="accessory_selector_empty" class="hide">
|
||||
<div class="alert alert-info">
|
||||
{intl l="No available product in this category"}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/ifloop}
|
||||
|
||||
{elseloop rel="categories"}
|
||||
<div class="alert alert-info">{intl l="No categories found"}</div>
|
||||
{/elseloop}
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-condensed table-left-aligned">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl l='ID'}</th>
|
||||
|
||||
<th>{intl l='Accessory title'}</th>
|
||||
|
||||
<th class="text-center">{intl l='Position'}</th>
|
||||
|
||||
{module_include location='product_accessories_table_header'}
|
||||
|
||||
<th class="actions">{intl l="Actions"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{loop name="assigned_accessories" order="accessory" type="accessory" product="$product_id" backend_context="1" lang="$edit_language_id"}
|
||||
<tr>
|
||||
<td>{$ID}</td>
|
||||
|
||||
<td>
|
||||
{$TITLE}
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
{admin_position_block
|
||||
permission="admin.products.edit"
|
||||
path={url path='/admin/product/update-accessory-position' product_id=$product_id current_tab="related"}
|
||||
url_parameter="accessory_id"
|
||||
in_place_edit_class="accessoryPositionChange"
|
||||
position=$POSITION
|
||||
id=$ID
|
||||
}
|
||||
</td>
|
||||
|
||||
{module_include location='product_accessories_table_row'}
|
||||
|
||||
<td class="actions">
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.product.accessory.delete"}
|
||||
<a class="btn btn-default btn-xs delete-accessory" title="{intl l='Delete this accessory'}" href="#delete_accessory_dialog" data-id="{$ID}" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</a>
|
||||
{/loop}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="assigned_accessories"}
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="alert alert-info">
|
||||
{intl l="This product contains no accessories"}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/elseloop}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* -- End accessories management ------------------------------------ *}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
{* -- Begin categories management ----------------------------------- *}
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<form method="POST" action="{url path='/admin/products/category/add'}" id="related_content_form">
|
||||
|
||||
<p class="title title-without-tabs">{intl l='Additional categories'}</p>
|
||||
<p>{intl l='A product could be attached to more than one category. Select here the additional categories for this product.'}
|
||||
{loop name="default_category" type="category" id=$DEFAULT_CATEGORY}
|
||||
{intl l='You can change the default category (%title) in the "General" tab.' title=$TITLE}
|
||||
{/loop}
|
||||
|
||||
{$exclude_from_tree = "-1"}
|
||||
{loop name="additional_categories" type="category" product=$product_id exclude=$DEFAULT_CATEGORY backend_context="1" lang="$edit_language_id"}
|
||||
{$exclude_from_tree = "$exclude_from_tree,$ID"}
|
||||
{/loop}
|
||||
|
||||
<input type="hidden" name="product_id" value="{$product_id}" />
|
||||
<input type="hidden" name="current_tab" value="related" />
|
||||
|
||||
{ifloop rel="categories"}
|
||||
<div class="input-group">
|
||||
<select required="required" name="content_id" id="content_id" class="form-control">
|
||||
<option value="">{intl l='Select a folder content...'}</option>
|
||||
|
||||
<select name="additional_category_id" id="accessory_category_id" class="form-control">
|
||||
<option value="">{intl l='Select a category...'}</option>
|
||||
{loop name="categories" type="category-tree" category="0" exclude=$exclude_from_tree backend_context="1" lang="$edit_language_id"}
|
||||
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px" {if $DEFAULT_CATEGORY==$ID}disabled="disabled"{/if}>
|
||||
{$TITLE} {if $DEFAULT_CATEGORY==$ID}{intl l=' (default)'}{/if}
|
||||
</option>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
<span class="input-group-btn" id="content_add_button">
|
||||
<button class="btn btn-default btn-primary action-btn" type="submit"><span class="glyphicon glyphicon-plus-sign"></span></button>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<span class="help-block">{intl l='Select a category and click (+) to add it to the additional category list'}</span>
|
||||
{/ifloop}
|
||||
|
||||
<span class="help-block">{intl l='Select a content and click (+) to add it to this product'}</span>
|
||||
</div>
|
||||
{elseloop rel="categories"}
|
||||
<div class="alert alert-info">{intl l="No categories found"}</div>
|
||||
{/elseloop}
|
||||
|
||||
<div id="content_selector_empty" class="hide">
|
||||
<div class="alert alert-info">
|
||||
{intl l="No available content in this folder"}
|
||||
</div>
|
||||
</div>
|
||||
{/ifloop}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{elseloop rel="folders"}
|
||||
<div class="alert alert-info">{intl l="No folders found"}</div>
|
||||
{/elseloop}
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-condensed table-left-aligned">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl l='ID'}</th>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
<th>{intl l='Category title'}</th>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-condensed table-left-aligned">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl l='ID'}</th>
|
||||
{module_include location='product_categories_table_header'}
|
||||
|
||||
<th>{intl l='Content title'}</th>
|
||||
<th class="actions">{intl l="Actions"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
{module_include location='product_contents_table_header'}
|
||||
<tbody>
|
||||
{loop name="additional_categories" type="category" product=$product_id exclude=$DEFAULT_CATEGORY backend_context="1" lang="$edit_language_id"}
|
||||
<tr>
|
||||
<td>{$ID}</td>
|
||||
|
||||
<th class="actions">{intl l="Actions"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<td>
|
||||
{$TITLE}
|
||||
</td>
|
||||
|
||||
<tbody>
|
||||
{loop name="assigned_contents" type="associated_content" product="$product_id" backend_context="1" lang="$edit_language_id"}
|
||||
<tr>
|
||||
<td>{$ID}</td>
|
||||
{module_include location='product_categories_table_row'}
|
||||
|
||||
<td>
|
||||
{$TITLE}
|
||||
</td>
|
||||
|
||||
{module_include location='product_contents_table_row'}
|
||||
|
||||
<td class="actions">
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.product.content.delete"}
|
||||
<a class="btn btn-default btn-xs delete-content" title="{intl l='Delete this content'}" href="#delete_content_dialog" data-id="{$ID}" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</a>
|
||||
{/loop}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="assigned_contents"}
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<div class="alert alert-info">
|
||||
{intl l="This product contains no contents"}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/elseloop}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* -- End related content management ---- *}
|
||||
|
||||
{* -- Begin accessories management ------ *}
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<form method="POST" action="{url path='/admin/products/accessory/add'}" id="accessory_form">
|
||||
|
||||
<p class="title title-without-tabs">{intl l='Product accessories'}</p>
|
||||
<p>{intl l='Define here this product\'s accessories'}</p>
|
||||
|
||||
<input type="hidden" name="product_id" value="{$product_id}" />
|
||||
<input type="hidden" name="current_tab" value="related" />
|
||||
|
||||
{ifloop rel="categories"}
|
||||
<div class="form-group">
|
||||
<select name="accessory_category_id" id="accessory_category_id" class="form-control">
|
||||
<option value="">{intl l='Select a category...'}</option>
|
||||
{loop name="categories" type="category-tree" category="0" backend_context="1" lang="$edit_language_id"}
|
||||
<option value="{$ID}" style="padding-left: {3 + $LEVEL * 20}px">{$TITLE}</option>
|
||||
<td class="actions">
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.product.category.delete"}
|
||||
<a class="btn btn-default btn-xs delete-category" title="{intl l='Remove the product from this category'}" href="#delete_category_dialog" data-id="{$ID}" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</a>
|
||||
{/loop}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
</select>
|
||||
|
||||
<span class="help-block">{intl l='Select a category to get its products'}</span>
|
||||
</div>
|
||||
|
||||
<div id="accessory_selector" class="hide">
|
||||
<div class="input-group">
|
||||
<select required="required" name="accessory_id" id="accessory_id" class="form-control">
|
||||
<option value="">{intl l='Select a product...'}</option>
|
||||
</select>
|
||||
<span class="input-group-btn" id="accessory_add_button">
|
||||
<button class="btn btn-default btn-primary action-btn" type="submit"><span class="glyphicon glyphicon-plus-sign"></span></button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<span class="help-block">{intl l='Select a product and click (+) to add it as an accessory'}</span>
|
||||
</div>
|
||||
|
||||
<div id="accessory_selector_empty" class="hide">
|
||||
<div class="alert alert-info">
|
||||
{intl l="No available product in this category"}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/ifloop}
|
||||
|
||||
{elseloop rel="categories"}
|
||||
<div class="alert alert-info">{intl l="No categories found"}</div>
|
||||
{/elseloop}
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-condensed table-left-aligned">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl l='ID'}</th>
|
||||
|
||||
<th>{intl l='Accessory title'}</th>
|
||||
|
||||
<th class="text-center">{intl l='Position'}</th>
|
||||
|
||||
{module_include location='product_accessories_table_header'}
|
||||
|
||||
<th class="actions">{intl l="Actions"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{loop name="assigned_accessories" order="accessory" type="accessory" product="$product_id" backend_context="1" lang="$edit_language_id"}
|
||||
<tr>
|
||||
<td>{$ID}</td>
|
||||
|
||||
<td>
|
||||
{$TITLE}
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
{admin_position_block
|
||||
permission="admin.products.edit"
|
||||
path={url path='/admin/product/update-accessory-position' product_id=$product_id current_tab="related"}
|
||||
url_parameter="accessory_id"
|
||||
in_place_edit_class="accessoryPositionChange"
|
||||
position=$POSITION
|
||||
id=$ID
|
||||
}
|
||||
</td>
|
||||
|
||||
{module_include location='product_accessories_table_row'}
|
||||
|
||||
<td class="actions">
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.configuration.product.accessory.delete"}
|
||||
<a class="btn btn-default btn-xs delete-accessory" title="{intl l='Delete this accessory'}" href="#delete_accessory_dialog" data-id="{$ID}" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</a>
|
||||
{/loop}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="assigned_accessories"}
|
||||
<tr>
|
||||
<td colspan="4">
|
||||
<div class="alert alert-info">
|
||||
{intl l="This product contains no accessories"}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/elseloop}
|
||||
</tbody>
|
||||
</table>
|
||||
{elseloop rel="additional_categories"}
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<div class="alert alert-info">
|
||||
{intl l="This product doesn't belong to any additional category."}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/elseloop}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{* -- End categories management ------------------------------------- *}
|
||||
</div>
|
||||
|
||||
{* -- End accessories management -------- *}
|
||||
|
||||
</div>
|
||||
|
||||
{* Delete related content confirmation dialog *}
|
||||
@@ -275,6 +394,26 @@
|
||||
form_content = {$smarty.capture.delete_accessory_dialog nofilter}
|
||||
}
|
||||
|
||||
{* Delete category confirmation dialog *}
|
||||
|
||||
{capture "delete_category_dialog"}
|
||||
<input type="hidden" name="product_id" value="{$product_id}" />
|
||||
<input type="hidden" name="additional_category_id" id="additional_category_delete_id" value="" />
|
||||
|
||||
<input type="hidden" name="current_tab" value="related" />
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
file = "includes/generic-confirm-dialog.html"
|
||||
|
||||
dialog_id = "delete_category_dialog"
|
||||
dialog_title = {intl l="Remove from category"}
|
||||
dialog_message = {intl l="Do you really want to remove the product from this category ?"}
|
||||
|
||||
form_action = {url path='/admin/products/category/delete'}
|
||||
form_content = {$smarty.capture.delete_category_dialog nofilter}
|
||||
}
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
@@ -290,6 +429,11 @@ $(function() {
|
||||
$('#accessory_category_delete_id').val($('#accessory_category_id').val());
|
||||
});
|
||||
|
||||
// Set proper content ID in accessory delete from
|
||||
$('a.delete-category').click(function(ev) {
|
||||
$('#additional_category_delete_id').val($(this).data('id'));
|
||||
});
|
||||
|
||||
|
||||
// Load content on folder selection
|
||||
$('#folder_id').change(function(event) {
|
||||
@@ -387,12 +531,30 @@ $(function() {
|
||||
}
|
||||
});
|
||||
|
||||
$('.contentPositionChange').editable({
|
||||
type : 'text',
|
||||
title : '{intl l="Enter new content position"}',
|
||||
mode : 'popup',
|
||||
inputclass : 'input-mini',
|
||||
placement : 'left',
|
||||
success : function(response, newValue) {
|
||||
// The URL template
|
||||
var url = "{url noamp='1' path='/admin/product/update-content-position' content_id='__ID__' position='__POS__' product_id=$product_id current_tab='related' }";
|
||||
|
||||
// Perform subtitutions
|
||||
url = url.replace('__ID__', $(this).data('id')).replace('__POS__', newValue);
|
||||
|
||||
// Reload the page
|
||||
location.href = url;
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize folder (id={$folder_id}) select value
|
||||
{if $folder_id != 0}
|
||||
$('#folder_id').val("{$folder_id}").change();
|
||||
{/if}
|
||||
|
||||
// Initialize folder (id={$folder_id}) select value
|
||||
// Initialize accessory category id (id={$accessory_category_id}) select value
|
||||
{if $accessory_category_id != 0}
|
||||
$('#accessory_category_id').val("{$accessory_category_id}").change();
|
||||
{/if}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="form-group">
|
||||
{ifloop rel="free_attributes"}
|
||||
<form action="{url path='/admin/configuration/templates/attributes/add'}">
|
||||
<form method="POST" action="{url path='/admin/configuration/templates/attributes/add'}">
|
||||
|
||||
<input type="hidden" name="template_id" value="{$template_id}" />
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="form-group">
|
||||
{ifloop rel="free_features"}
|
||||
<form action="{url path='/admin/configuration/templates/features/add'}">
|
||||
<form method="POST" action="{url path='/admin/configuration/templates/features/add'}">
|
||||
|
||||
<input type="hidden" name="template_id" value="{$template_id}" />
|
||||
|
||||
|
||||
@@ -445,7 +445,7 @@
|
||||
{form_field form=$form field='title'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
|
||||
{loop type="lang" name="default-lang" default_only="1"}
|
||||
{loop type="lang" name="default-lang" default_only="1" backend_context="1"}
|
||||
<div class="input-group">
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Title'}">
|
||||
<span class="input-group-addon"><img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="$TITLE" /></span>
|
||||
@@ -463,6 +463,64 @@
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='price'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
|
||||
{loop type="currency" name="default-currency" default_only="1" backend_context="1"}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<div class="input-group">
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="col-lg-2 form-control" value="{$value}" title="{$label}" placeholder="{intl l='Product price'}">
|
||||
<span class="input-group-addon">{$SYMBOL}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="help-block">{intl l='Enter here the product price in the default currency (%title)' title=$NAME}</div>
|
||||
|
||||
{form_field form=$form field='currency'}
|
||||
<input type="hidden" name="{$name}" value="{$ID}" />
|
||||
{/form_field}
|
||||
|
||||
{/loop}
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='tax_rule'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
|
||||
<div class="form-group">
|
||||
<select id="{$label_attr.for}" required="required" name="{$name}" class="form-control">
|
||||
<option value="">{intl l="Select a tax tule"}</option>
|
||||
{loop name="tax" type="tax-rule" backend_context="1"}
|
||||
<option value="{$ID}" {if $IS_DEFAULT}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="help-block">{intl l='Select here the tax applicable to this product'}</div>
|
||||
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='weight'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{$label}: </label>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-4">
|
||||
<div class="input-group">
|
||||
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Product weight'}">
|
||||
<span class="input-group-addon">{intl l="Kg"}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="help-block">{intl l='Enter here the product weight, in Kilogrammes'}</div>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='visible'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<div class="checkbox">
|
||||
|
||||
@@ -31,5 +31,5 @@ $('#{$dialog_id}').on('hidden.bs.modal', function() {
|
||||
$("#{$dialog_id} .error").removeClass('error');
|
||||
|
||||
// Empty field values
|
||||
$("#{$dialog_id} input[type=text]").val('');
|
||||
$("#{$dialog_id} input[type=text], #{$dialog_id} select").val('');
|
||||
});
|
||||
@@ -1,4 +1,3 @@
|
||||
{loop name="product_edit" type="product" visible="*" id=$product_id backend_context="1" lang=$edit_language_id}
|
||||
<div class="form-container">
|
||||
|
||||
{form name="thelia.admin.product.modification"}
|
||||
@@ -110,5 +109,4 @@
|
||||
|
||||
</form>
|
||||
{/form}
|
||||
</div>
|
||||
{/loop}
|
||||
</div>
|
||||
@@ -1,4 +1,6 @@
|
||||
{* The standard description fields, used by many Thelia objects *}
|
||||
{*
|
||||
The standard description fields, used by many Thelia objects
|
||||
*}
|
||||
|
||||
{form_field form=$form field='title'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
|
||||
@@ -43,12 +43,12 @@
|
||||
<ul class="nav nav-tabs" id="tabbed-menu">
|
||||
<li>
|
||||
<a href="#general"
|
||||
data-href="{url path='/admin/products/general/tab' product_id=$product_id}"
|
||||
data-toggle="tab">{intl l="General description"}</a>
|
||||
{* data-href="{url path='/admin/products/general/tab' product_id=$product_id}" *}
|
||||
data-toggle="tab">{intl l="General"}</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#price" data-toggle="tab">{intl l="Price"}</a>
|
||||
<a href="#price" data-toggle="tab">{intl l="Prices"}</a>
|
||||
</li>
|
||||
|
||||
<li><a href="#attributes"
|
||||
@@ -70,7 +70,7 @@
|
||||
<div class="tab-content">
|
||||
|
||||
<div class="tab-pane fade" id="general">
|
||||
<div class="text-center"><span class="loading">{intl l="Please wait, loading"}</span></div>
|
||||
{include file="includes/product-general-tab.html"}
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="attributes">
|
||||
|
||||
Reference in New Issue
Block a user