Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* add to your theme or child theme functions.php file to create a new field on the vendor add-edit product form */
- add_action( 'wcv_product_options_general_product_data', 'wcv_custom_product_msrp_price_field' );
- function wcv_custom_product_msrp_price_field () {
- WCVendors_Pro_Form_Helper::input( array(
- 'post_id' => $post_id,
- 'id' => '_wcv_custom_product_msrp_price',
- 'label' => __( 'MSRP Price', 'wcvendors-pro' ),
- 'placeholder' => __( 'MSRP Price', 'wcvendors-pro' ),
- 'desc_tip' => 'true',
- 'description' => __( 'Please specify MSRP Price', 'wcvendors-pro' ),
- )
- );
- }
- /* add to your theme or child theme functions.php to display the field entry on the product page for customer view */
- add_action('woocommerce_before_add_to_cart_form', 'wcv_custom_product_msrp_price_display');
- function wcv_custom_product_msrp_price_display() {
- $output = get_post_meta(get_the_ID(), '_wcv_custom_product_msrp_price',true );
- echo '<p>'.'Retail Price: ' . $output . '</p>';
- }
Add Comment
Please, Sign In to add comment