';
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 ] && 'text' === $custom_field[2] ) {
$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 ) );
}
woocommerce_wp_text_input(
array(
'id' => $custom_field_id,
'value' => esc_attr( get_post_meta( $variation->ID, $custom_field_key, true ) ),
'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 '