Started price tab

This commit is contained in:
franck
2013-09-23 00:57:03 +02:00
parent 22f3f49f79
commit 8781721512
12 changed files with 431 additions and 133 deletions

View File

@@ -81,7 +81,40 @@
{/if}
</p>
<div class="alert alert-danger">Please code me baby, oh yeah ! Code me NOW !</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='Attribute Name'}</th>
{module_include location='product_attributes_table_header'}
</tr>
</thead>
<tbody>
{loop name="product-attributes" type="attribute" order="manual" product=$product_id backend_context="1" lang="$edit_language_id"}
<tr>
<td>{$ID}</td>
<td>{$TITLE}</td>
{module_include location='product_features_table_row'}
</tr>
{/loop}
{elseloop rel="product-attributes"}
<tr>
<td colspan="2">
<div class="alert alert-info">
{intl l="This product template does not contains any features"}
</div>
</td>
</tr>
{/elseloop}
</tbody>
</table>
</div>
</div>
</div>
</div>
@@ -111,7 +144,8 @@
<table class="table table-striped table-condensed table-left-aligned">
<thead>
<tr>
<th>{intl l='Feature Name'}</th>
<th>{intl l='ID'}</th>
<th>{intl l='Feature Name'}</th>
<th>{intl l='Feature value for this product'}</th>
{module_include location='product_features_table_header'}
@@ -122,6 +156,8 @@
<tbody>
{loop name="product-features" type="feature" order="manual" product=$product_id backend_context="1" lang="$edit_language_id"}
<tr>
<td>{$ID}</td>
<td>{$TITLE}</td>
<td>
@@ -176,7 +212,7 @@
{elseloop rel="product-features"}
<tr>
<td colspan="2">
<td colspan="3">
<div class="alert alert-info">
{intl l="This product template does not contains any features"}
</div>

View File

@@ -1,75 +0,0 @@
{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}

View File

@@ -9,21 +9,19 @@ Parameters:
*}
<div class="row inner-toolbar">
<div class="col-md-6 inner-actions">
{* Display the top form toolbar, with edition flags, and save buttons *}
<div class="col-md-6 inner-actions">
<ul class="nav nav-pills">
{loop name="lang_list" type="lang"}
<li {if $ID == $edit_language_id}class="active"{/if}>
<a href="{url path={$page_url|default:$current_url} edit_language_id=$ID}" title="{intl l="Edit information in %lng" lng=$TITLE}">
<a href="{url path={$page_url|default:$current_url} edit_language_id=$ID}" title="{intl l='Edit information in %lng' lng=$TITLE}">
<img src="{image file="../assets/img/flags/{$CODE}.gif"}" alt="{intl l=$TITLE}" />
</a>
</li>
{/loop}
</ul>
</div>
</div>
<div class="col-md-6 inner-actions">
<div class="col-md-6 inner-actions">
{if $hide_submit_buttons != true}
<button type="submit" name="save_mode" value="stay" class="btn btn-default btn-success" title="{intl l='Save'}">{intl l='Save'} <span class="glyphicon glyphicon-ok"></span></button>
<button type="submit" name="save_mode" value="close" class="btn btn-default btn-info" title="{intl l='Save and close'}">{intl l='Save and close'} <span class="glyphicon glyphicon-remove"></span></button>
@@ -31,5 +29,5 @@ Parameters:
{if ! empty($close_url)}
<a href="{$close_url}" class="btn btn-default">{intl l='Close'} <span class="glyphicon glyphicon-remove"></span></a>
{/if}
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,197 @@
<div class="form-container">
{form name="thelia.admin.product.details.modification"}
<form method="POST" action="{url path='/admin/products/details/save'}" {form_enctype form=$form} class="clearfix">
{include
file = "includes/inner-form-toolbar.html"
hide_submit_buttons = false
page_url = "{url path='/admin/products/update' product_id=$ID}"
close_url = "{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}"
}
{* Be sure to get the product ID, even if the form could not be validated *}
<input type="hidden" name="product_id" value="{$product_id}" />
<input type="hidden" name="current_tab" value="details" />
{form_hidden_fields form=$form}
{form_field form=$form field='id'}
<input type="hidden" name="{$name}" value="{$value}" />
{/form_field}
{form_field form=$form field='success_url'}
<input type="hidden" name="{$name}" value="{url path='/admin/categories' category_id=$DEFAULT_CATEGORY}" />
{/form_field}
{loop type="currency" name="product-currency" id=$edit_currency_id backend_context="1"}
{$currency_symbol = $SYMBOL}
{$currency_name = $NAME}
{form_field form=$form field='currency'}
<input type="hidden" name="{$name}" value="{$ID}" />
{/form_field}
{/loop}
<div class="row">
<div class="col-md-12">
<ul class="nav nav-pills">
<li class="disabled"><a href="#">{intl l='Edit prices in:'}</a></li>
{loop name="currency_list" type="currency"}
<li {if $ID == $edit_currency_id}class="active"{/if}>
<a href="{url noamp=1 path='/admin/products/update' edit_currency_id=$ID product_id=$product_id current_tab='details'}" title="{intl l='Edit prices in %curr' curr=$NAME}">
{$SYMBOL}
</a>
</li>
{/loop}
</ul>
</div>
</div>
<div class="row">
{* -- Pricing ------------------------------------------------------- *}
<div class="col-md-4">
<p class="title title-without-tabs">{intl l='Pricing'}</p>
<p></p> <!-- LAME !!! FIXME -->
{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>
<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 price'}">
<span class="input-group-addon">{$currency_symbol}</span>
</div>
</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>
{/form_field}
{form_field form=$form field='price_with_tax'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<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 price'}">
<span class="input-group-addon">{$currency_symbol}</span>
</div>
</div>
{/form_field}
{module_include location='product_details_pricing_form'}
</div>
{* -- Promotion ------------------------------------------------- *}
<div class="col-md-4">
<p class="title title-without-tabs">{intl l='Promotion'}</p>
{form_field form=$form field='sale_price'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<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 price'}">
<span class="input-group-addon">{$currency_symbol}</span>
</div>
</div>
{/form_field}
{form_field form=$form field='onsale'}
<div class="form-group {if $error}has-error{/if}">
<div class="checkbox">
<label>
<input type="checkbox" id="{$label_attr.for}" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}>
{$label}
</label>
</div>
</div>
{/form_field}
{form_field form=$form field='isnew'}
<div class="form-group {if $error}has-error{/if}">
<div class="checkbox">
<label>
<input type="checkbox" id="{$label_attr.for}" name="{$name}" value="1" {if $value != 0}checked="checked"{/if}>
{$label}
</label>
</div>
</div>
{/form_field}
{module_include location='product_details_promotion_form'}
</div>
{* -- Shipping -------------------------------------------------- *}
<div class="col-md-4">
<p class="title title-without-tabs">{intl l='Shipping'}</p>
{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="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>
{/form_field}
<p class="title title-without-tabs">{intl l='Quantity'}</p>
{form_field form=$form field='quantity'}
<div class="form-group {if $error}has-error{/if}">
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
<div class="form-group">
<input type="text" id="{$label_attr.for}" required="required" name="{$name}" class="form-control" value="{$value}" title="{$label}" placeholder="{intl l='Current quantity'}">
</div>
</div>
{/form_field}
{module_include location='product_details_shipping_form'}
</div>
</div>
{/form}
{* -- Attribute combinations -------------------------------------------- *}
<div class="row">
<div class="col-md-12">
<p class="title title-without-tabs">{intl l='Attribute Combinations'}</p>
<div class="alert alert-info">
{intl l="This product has no attribute combination"}
</div>
</div> {* com *}
</div> {* row *}
</div>

View File

@@ -48,7 +48,7 @@
</li>
<li>
<a href="#price" data-toggle="tab">{intl l="Prices"}</a>
<a href="#details" data-toggle="tab">{intl l="Details"}</a>
</li>
<li><a href="#attributes"
@@ -73,6 +73,10 @@
{include file="includes/product-general-tab.html"}
</div>
<div class="tab-pane fade" id="details">
{include file="includes/product-details-tab.html"}
</div>
<div class="tab-pane fade" id="attributes">
<div class="text-center"><span class="loading">{intl l="Please wait, loading"}</span></div>
</div>