WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Additional product data info field (7 posts)

  1. lahoti
    Member
    Posted 1 year ago #

    I need additional product data field like weight or height. This is more like a info/ description field for each product variation.

    I can probably use a custom field but I want a field such that is different for each product variation.

    1. If there any hook to create such a field? IF not how in php (should I change wc-product.php?]
    2. If it can be created how can it be used in theme?

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

  2. tumateix
    Member
    Posted 1 year ago #

    I solve it with the custom fields, calling the post meta

    <?php echo get_post_meta($post->ID, "artist", true); ?>

  3. lahoti
    Member
    Posted 1 year ago #

    Ya but what if I have product variation? How to enter for each product variation

  4. tumateix
    Member
    Posted 1 year ago #

    I put them all with different psot-meta in my short description.

    An in each product, when I need to show this info I put the value in the custom file, if there is no value it will not show.

    Of course I have several values that apply to many item, like: author, date, year, origen, etc.

  5. lahoti
    Member
    Posted 1 year ago #

    but all product variation have the same code to display.. so how will i display custom field corresponding to Product variation A-1; and when it is A-2 show field corresponding to it

  6. tumateix
    Member
    Posted 1 year ago #

    <?php echo get_post_meta($post->ID, "A1", true); ?>

    <?php echo get_post_meta($post->ID, "A2", true); ?>

    <?php echo get_post_meta($post->ID, "A3", true); ?>

    <?php echo get_post_meta($post->ID, "A4", true); ?>

    and go on.

  7. lahoti
    Member
    Posted 1 year ago #

    no its not that simple (i thought i might do it buikding upon what you suggested)-
    I tried following
    - created custom field A_post_ID_for variation
    - WHen webpage is loaded php runs once using ID of parent post
    -- hence, when i change variation it doesnt help
    - tried to look at how price is changing and it seemed will have to modify too much php code in WC_product class..

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic