Worked on catalog

This commit is contained in:
Franck Allimant
2013-10-23 23:41:39 +02:00
parent ada32660fe
commit 0bd57b0a5a
46 changed files with 3483 additions and 3009 deletions

View File

@@ -135,12 +135,16 @@
<script src="{$asset_url}"></script>
{/javascripts}
{javascripts file='assets/js/bootstrap-switch/bootstrap-switch.js'}
<script src="{$asset_url}"></script>
{/javascripts}
{javascripts file='assets/js/bootstrap-switch/bootstrap-switch.js'}
<script src="{$asset_url}"></script>
{/javascripts}
{javascripts file='assets/js/jquery.typewatch.js'}
<script src="{$asset_url}"></script>
{/javascripts}
<script src="{url file='/tinymce/tinymce.min.js'}"></script>
<script>
tinymce.init({
selector: ".wysiwyg",
@@ -269,6 +273,49 @@ $(function() {
$('#combination_attributes option').prop('selected', 'selected');
});
// In details tab, process exchange rate usage checkbox changes
$('use_exchange_rate_box').change(function(ev) {
$('.')
});
// Automatic update of price fields: any change in the taxed (resp. untaxed) price
// will update the untaxed (resp. taxed) one
$('.automatic_price_field').typeWatch({
captureLength: 1,
callback: function () {
var tax_rule_id = $('#tax_rule_field').val();
if (tax_rule_id != "") {
var priceType = $(this).data('price-type');
var dest_field_id = $(this).data('rel-price');
var operation;
if (priceType == 'with-tax')
operation = 'from_tax';
else if (priceType == 'without-tax')
operation = 'to_tax';
else
operation = '';
$.ajax({
url : '{url path="/admin/product/calculate-price"}',
data : {
price : $(this).val(),
action : operation,
tax_rule_id : $('#tax_rule_field').val()
},
type : 'get',
dataType : 'json',
success : function(json) {
$('#' + dest_field_id).val(json.result);
}
});
}
}
});
});
</script>