Last active
January 6, 2018 10:34
-
-
Save fervous/ce8059e2144f05b813c5932fbd1d3c6d to your computer and use it in GitHub Desktop.
wc vendors pro add new field for product form custom field add edit product
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* child theme functions.php */ | |
add_action( 'wcv_after_product_details', 'wcv_custom_product_condition_field' ); | |
function wcv_custom_product_condition_field () { | |
WCVendors_Pro_Form_Helper::input( array( | |
'type' => 'text', | |
'post_id' => $object_id, | |
'id' => 'wcv_custom_product_condition', | |
'label' => __( 'Product Condition', 'wcvendors-pro' ), | |
'placeholder' => __( 'Please specify if your product is NEW or USED', 'wcvendors-pro' ), | |
'desc_tip' => 'true', | |
'description' => __( 'Is your Product New or Used?', 'wcvendors-pro' ), | |
) ); | |
} | |
add_action('woocommerce_product_meta_start', 'wcv_product_condition', 2); | |
function wcv_product_condition() { | |
$output = get_post_meta(get_the_ID(), 'wcv_custom_product_condition', true ); | |
echo '<p>'.'Product Condition: ' . $output . '</p>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment