';
echo "
";
echo sprintf('
%s
', esc_attr('woo-feed-variation-option-title'), esc_html__('CUSTOM FIELDS by CTX Feed', 'woo-feed'));
echo "
";
echo '
';
foreach ($custom_fields as $field_Key => $custom_field) {
if (isset($custom_field_settings[$field_Key]) && 'enable' === $custom_field_settings[$field_Key] && in_array($custom_field[2], ['text', 'date'])) {
$custom_field_id = sprintf('woo_feed_%s_var[%d]', strtolower($field_Key), $variation->ID);
$custom_field_label = isset($custom_field[0]) ? $custom_field[0] : '';
$custom_field_description = sprintf('Set Variation %s here.', $custom_field_label);
//identifier meta value for old and new version users
if (metadata_exists('post', $variation->ID, 'woo_feed_' . strtolower($field_Key) . '_var')) {
$custom_field_key = sprintf('woo_feed_%s_var', strtolower($field_Key));
} else {
$custom_field_key = sprintf('woo_feed_identifier_%s_var', strtolower($field_Key));
}
$custom_field_value = esc_attr(get_post_meta($variation->ID, $custom_field_key, true));
if (strpos($custom_field_id, 'availability_date')) {
woocommerce_wp_text_input(
array(
'id' => "woo_feed_availability_date_var{$loop}",
'name' => "woo_feed_availability_date_var[{$loop}]",
'placeholder' => '',
'label' => __('Availability Date', 'woo-feed'),
'type' => 'date',
'desc_tip' => true,
'description' => __('Set availability date for backorder products.', 'woo-feed'),
'value' => esc_attr($custom_field_value),
'wrapper_class' => 'form-row form-row-full',
)
);
} else {
woocommerce_wp_text_input(
array(
'id' => $custom_field_id,
'value' => $custom_field_value,
'placeholder' => esc_html($custom_field_label),
'label' => esc_html($custom_field_label),
'desc_tip' => true,
'description' => esc_html($custom_field_description),
'wrapper_class' => 'form-row form-row-full',
)
);
}
}
}
echo '