Well, "move after Description" has proven to be quite tricky for two reasons:
1.- ID of the Description element includes current user language (same for Title).
Solution: In Variable Data block, 'destination' value must be like this:
For Description: 'destination': 'description[<?php echo osc_current_user_locale(); ?>]'
For Title: 'destination': 'title[<?php echo osc_current_user_locale(); ?>]'
2.- In the previous code, moved custom fields were being placed before (above) some element, but usually the element after Description is "Price" and it might exist or not depending on the settings for the chosen category.
Solution: To add a new field 'position' (with value 'before' or 'after'). That requires to modify the whole code:
<?php
function custom_move_custom_field() {
$section = Rewrite::newInstance()->get_section();
if ($section == 'item_add' || $section == 'item_edit') { ?>
<script type="text/javascript">
// Variable data, change values here only
var customFieldsToMove = {
0 : { 'cfIdentifier' : 'art_der_anzeige', 'destination': 'select_1', 'position': 'before' },
1 : { 'cfIdentifier' : 'tuev_1', 'destination': 'description[<?php echo osc_current_user_locale(); ?>]', 'position': 'after'}
};
// End Variable data
$(document).ajaxComplete(function(event, xhr, settings) {
if (typeof settings['data'] == 'undefined' || settings['data'].indexOf('hook=item_') == -1) return; // No Category
for(var i in customFieldsToMove) {
elementId = customFieldsToMove[i]['destination'];
if ($("label[for='" + elementId + "']").length) {
var destinationElement = $("label[for='" + elementId + "']").parent('div');
} else {
var destinationElement = $(":input[id='" + elementId + "']").parent('div');
}
moveCustomField(customFieldsToMove[i]['cfIdentifier'], destinationElement, customFieldsToMove[i]['position']);
}
});
function moveCustomField(customFieldIdentifier, destinationElement, position) {
var movedId = 'moved_custom_field_' + customFieldIdentifier;
var toMoveLabel = $("label[for='meta_" + customFieldIdentifier + "']");
if (toMoveLabel.length && !$('#' + movedId).html()) {
if (position == 'before') {
$("<div></div>").attr('id', movedId).insertBefore(destinationElement);
} else {
$("<div></div>").attr('id', movedId).insertAfter(destinationElement);
}
if (destinationElement.prop('id').indexOf('meta_') == -1) {
toMoveLabel.parent('.meta').find('*').each(function() {
$(this).copyCSS($(this));
});
}
$('#' + movedId).append(toMoveLabel.parent('.meta'));
$("<div></div>").attr('class', 'clear').css('padding-bottom', '10px').appendTo($('#' + movedId));
} else {
$('#' + movedId).remove();
}
}
$.fn.copyCSS = function (source) {
var dom = $(source).get(0);
var dest = {};
var style, prop;
if (window.getComputedStyle) {
var camelize = function (a, b) {
return b.toUpperCase();
};
if (style == window.getComputedStyle(dom, null)) {
var camel, val;
if (style.length) {
for (var i = 0, l = style.length; i < l; i++) {
prop = style[i];
camel = prop.replace(/\-([a-z])/, camelize);
val = style.getPropertyValue(prop);
dest[camel] = val;
}
} else {
for (prop in style) {
camel = prop.replace(/\-([a-z])/, camelize);
val = style.getPropertyValue(prop) || style[prop];
dest[camel] = val;
}
}
return this.css(dest);
}
}
if (style = dom.currentStyle) {
for (prop in style) {
dest[prop] = style[prop];
}
return this.css(dest);
}
if (style == dom.style) {
for (prop in style) {
if (typeof style[prop] != 'function') {
dest[prop] = style[prop];
}
}
}
return this.css(dest);
};
</script>
<?php }
}
osc_add_hook('footer', 'custom_move_custom_field', 1);
function custom_remove_moved_custom_field() { ?>
<script type="text/javascript">
$("div [id^='moved_custom_field']").remove();
</script>
<?php }
osc_add_hook('item_form', 'custom_remove_moved_custom_field', 6);
?>
So, this is what will do the trick for what you want:
[X] : { 'cfIdentifier' : '[custom field identifier]', 'destination': 'description[<?php echo osc_current_user_locale(); ?>]', 'position': 'after'}
And if you're already moving other custom fields, remember to add , 'position': 'before' to them
Regards