WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Cant get custom fields to display on product short description page! (1 post)

  1. theaccessorywarehouse
    Member
    Posted 8 months ago #

    I've tried absolutely everything to get the custom fields I added on my product edit page to display on the product short description page. I've set a custom template using the short-description under woocommerce to no avail. I've tried what everyone has posted on their sites to display post meta. I've tried the wordpress custom fields get post meta. I just cant get anything to work. Shown below is one of the custom fields I've set. I'm trying to get it to show on the product description as a unordered list. If someone can tell me how to do this using the info below and tell me where to put it I'd appreciate it. I need this weeks ago. Thanks....

    // Display Fields
    add_action( 'woocommerce_product_options_general_product_data', 'woo_add_custom_general_fields' );
    // Save Fields
    add_action( 'woocommerce_process_product_meta',

    'woo_add_custom_general_fields_save' );

    function woo_add_custom_general_fields() {
    global $woocommerce, $post;

    echo '<div class="options_group">';

    // Text Field
    woocommerce_wp_text_input(
    array(
    'id' => '_manufacturertext_field',
    'label' => __( 'Manufacturer', 'woocommerce' ),
    'placeholder' => '',
    'desc_tip' => 'true',
    'description' => __( 'manufacturer', 'woocommerce' )
    )
    );
    echo '</div>';
    }
    function woo_add_custom_general_fields_save( $post_id ){

    // Text Field
    $woocommerce_text_field = $_POST['_manufacturertext_field'];
    if( !empty( $woocommerce_text_field ) )
    update_post_meta( $post_id, '_manufacturertext_field', esc_attr( $woocommerce_text_field ) );
    }

    http://wordpress.org/plugins/woocommerce/

Reply

You must log in to post.

About this Plugin

About this Topic

  • RSS feed for this topic
  • Started 8 months ago by theaccessorywarehouse
  • This topic is not resolved
  • WordPress version: 3.7.1