Opencart-2.1.0.2 自定义字段排序顺序问题与注册页面



我已经安装了打开购物车版本2.1.0.2

我从管理员部分添加了一个名为电话号码的自定义字段,并将sort-order 6分配给此字段。

当我检查注册页面时,我看不到此字段,但是当我更改sort order to 5 or 7时,此字段可见。我不确定为什么对于排序顺序 6,此字段未显示在注册页面上。

在注册字段中,javascript 中缺少一个条件sort order in custom filed

条件 : 当data-sort等于form-group lenght

register.tpl文件中使用以下方法更新代码。 533 号线。

<script type="text/javascript"><!--
// Sort the custom fields
    $('#account .form-group[data-sort]').detach().each(function() {
        if ($(this).attr('data-sort') >= 0 && $(this).attr('data-sort') <= $('#account .form-group').length) {
            $('#account .form-group').eq($(this).attr('data-sort')).before(this);
        }
        if ($(this).attr('data-sort') > $('#account .form-group').length) {
            $('#account .form-group:last').after(this);
        }
        if ($(this).attr('data-sort') == $('#account .form-group').length) {
            $('#account .form-group:last').after(this);
        }
        if ($(this).attr('data-sort') < -$('#account .form-group').length) {
            $('#account .form-group:first').before(this);
        }
    });
    $('#address .form-group[data-sort]').detach().each(function() {
        if ($(this).attr('data-sort') >= 0 && $(this).attr('data-sort') <= $('#address .form-group').length) {
            $('#address .form-group').eq($(this).attr('data-sort')).before(this);
        }
        if ($(this).attr('data-sort') > $('#address .form-group').length) {
            $('#address .form-group:last').after(this);
        }
        if ($(this).attr('data-sort') == $('#address .form-group').length) {
            $('#address .form-group:last').after(this);
        }
        if ($(this).attr('data-sort') < -$('#address .form-group').length) {
            $('#address .form-group:first').before(this);
        }
    });
</script>

最新更新