Support » Plugin: WooCommerce » Predefine Custom Tab field values in the backend?

  • Hi,

    I have been working recently with WooCommerce.
    Is there a way to predefine the input fields of the Custom Tab in the backend with a default value?

    If the admin creates a new product that should be already preset in the Custom tab in the input field value that can be changed and saved using the “Update” button.

    This should be predefine the value in the input field, but it does’n work:
    <?php if( isset($custom_tab_options['cost']) ? @$custom_tab_options['cost'] : (@$custom_tab_options['cost'] = '15') ); ?>

    <p class="form-field">
    						<?php woocommerce_wp_checkbox( array( 'id' => 'custom_tab_enabled', 'label' => __('Versicherung für Cityflitzer aktivieren?', 'woothemes')  ) ); ?>
    <div class="options_group custom_tab_options">
    						<p class="form-field">
    							<label><?php _e('Versicherungsname:', 'woothemes'); ?> </label>
    							<input type="text" size="5" name="custom_tab_title" value="Cityflitzer"
    								placeholder="<?php _e('Versicherungsname eintragen', 'woothemes'); ?>" />
    						<p class="form-field">
    							<label><?php _e('EUR:', 'woothemes'); ?> </label> <input
    								type="number" size="5" name="cost" value="<strong><?php
    								if( isset($custom_tab_options['cost']) ? @$custom_tab_options['cost'] : (@$custom_tab_options['cost'] = '15') ); ?></strong>"
    								placeholder="<?php _e('Kosten eintragen', 'woothemes'); ?>" />

  • The topic ‘Predefine Custom Tab field values in the backend?’ is closed to new replies.