update multicurrencies functionality on global level

This commit is contained in:
dwindown
2025-08-25 19:55:38 +07:00
parent 38b6b5cddb
commit ccb2b1aea1
21 changed files with 1240 additions and 476 deletions

View File

@@ -14,11 +14,12 @@
// This is a string path like: data['variation']['fields']['my_field']
$field_ref = "data['{$section_name}']['fields']['{$field_name}']";
?>
<wpcfto_codemirror
:fields='<?php echo esc_attr($field_ref); ?>'
:field_label='<?php echo esc_attr($field_label); ?>'
:field_name="'<?php echo esc_js($field_name); ?>'"
:field_id="'<?php echo esc_js($field_id); ?>'"
:field_value="'<?php echo esc_js($field_value); ?>'"
@wpcfto-get-value="$set(<?php echo $field_ref; ?>, 'value', $event)"
></wpcfto_codemirror>

View File

@@ -25,4 +25,4 @@ $field = "data['{$section_name}']['fields']['{$field_name}']";
<input type="hidden"
name="<?php echo esc_attr($field_name); ?>"
v-bind:id="'<?php echo esc_attr($field_id); ?>'"
v-model="JSON.stringify(<?php echo esc_attr(wp_unslash($field_value)); ?>)" />
:value="JSON.stringify(<?php echo esc_attr(wp_unslash($field_value)); ?>)" />

View File

@@ -13,18 +13,13 @@
?>
<wpcfto_multiselect v-bind:fields="<?php echo esc_attr($field); ?>"
v-bind:field_label="<?php echo esc_attr($field_label); ?>"
v-bind:field_name="'<?php echo esc_attr($field_name); ?>'"
v-bind:field_id="'<?php echo esc_attr($field_id); ?>'"
v-bind:field_value="<?php echo esc_attr($field_value); ?>"
v-bind:field_options="<?php echo esc_attr($field); ?>['options']"
v-bind:field_data='<?php echo str_replace("'", "", json_encode($field_data)); ?>'
@wpcfto-get-value="$set(<?php echo esc_attr($field) ?>, 'value', $event)">
</wpcfto_multiselect>
<input type="hidden"
:style="{'width' : '100%'}"
name="<?php echo esc_attr($field_name); ?>"
v-bind:id="'<?php echo esc_attr($field_id); ?>'"
v-model="JSON.stringify(<?php echo esc_attr(wp_unslash($field_value)); ?>)"/>
<wpcfto_multiselect
v-bind:fields='<?php echo wp_json_encode($field); ?>'
v-bind:field_label='<?php echo wp_json_encode($field_label); ?>'
v-bind:field_name='<?php echo wp_json_encode($field_name); ?>'
v-bind:field_id='<?php echo wp_json_encode($field_id); ?>'
v-bind:field_value='<?php echo wp_json_encode($field_value); ?>'
v-bind:field_options='<?php echo wp_json_encode(isset($field['options']) ? $field['options'] : []); ?>'
v-bind:field_data='<?php echo wp_json_encode($field_data); ?>'
@wpcfto-get-value="$set(<?php echo json_encode($field_name); ?>, 'value', $event)">
</wpcfto_multiselect>

View File

@@ -15,18 +15,13 @@ wp_enqueue_script('my-super-component', STM_WPCFTO_URL . '/metaboxes/general_com
?>
<wpcfto_repeater v-bind:fields="<?php echo esc_attr($field); ?>"
v-bind:parent_repeater="'parent'"
v-bind:field_label="<?php echo esc_attr($field_label); ?>"
v-bind:field_name="'<?php echo esc_attr($field_name); ?>'"
v-bind:field_id="'<?php echo esc_attr($field_id); ?>'"
v-bind:field_value="<?php echo esc_attr($field_value); ?>"
v-bind:field_data='<?php echo str_replace("'", "", json_encode($field_data)); ?>'
@wpcfto-get-value="$set(<?php echo esc_attr($field) ?>, 'value', $event)">
</wpcfto_repeater>
<input type="hidden"
:style="{'width' : '100%'}"
name="<?php echo esc_attr($field_name); ?>"
v-bind:id="'<?php echo esc_attr($field_id); ?>'"
v-model="JSON.stringify(<?php echo esc_attr(wp_unslash($field_value)); ?>)" />
<wpcfto_repeater
v-bind:fields="<?php echo esc_attr($field); ?>"
v-bind:parent_repeater="'parent'"
v-bind:field_label="<?php echo esc_attr($field_label); ?>"
v-bind:field_name="'<?php echo esc_attr($field_name); ?>'"
v-bind:field_id="'<?php echo esc_attr($field_id); ?>'"
v-bind:field_value="<?php echo esc_attr($field_value); ?>"
v-bind:field_data='<?php echo str_replace("'", "", json_encode($field_data)); ?>'
@wpcfto-get-value="$set(<?php echo esc_attr($field) ?>, 'value', $event)"
></wpcfto_repeater>