• Resolved jasmeetsingh

    (@jasmeetsingh)


    I want to show custom data in cart and checkout page… If I am able to get Set default value in every product edit page separately my issues will be solved. Please let me know if its possible..

    Lets say I want to show that cooking time of this dish is 20 min..

    I wanna show this on cart checkout and also on email. I am not able to find the option. If this plugin provide per product default value to the field then I will set text default value as 20 mins and will disable its editing. This will show in checkout and emails also. I hope it makes sense.

    • This topic was modified 5 years, 8 months ago by jasmeetsingh.
    • This topic was modified 5 years, 8 months ago by jasmeetsingh.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,

    you can use hidden field input, where you can set static value but it’s PRO feature.

    Thread Starter jasmeetsingh

    (@jasmeetsingh)

    Is it possible for per product?
    If yes then can u send me a demo link and link to buy pro product. I would like to use that..

    Main thing is I NEED TO SET DEFAULT VALUE PER PRODUCT..

    And if its possible by doing some simple code then let me know.

    • This reply was modified 5 years, 8 months ago by jasmeetsingh.

    If this is for a static value for each product then you can use a custom field instead. It is built into WordPress and can be tied into WooCommerce products because they are just posts.

    It can be set in each product under the Custom fields box. You would have to use the Add New Custom Field: to create the field and then set it after you create it. If you don’t see it under a product then you need to change the Screen options to show Custom Fields.

    To programmatically retrieve it you could use the following:

    global $post;
    $custom_field_name = get_post_meta($post->ID,"custom_field_name",true)

    You could also use get_post_custom_values(), get_post_custom() or get_post_meta() if there is more than one value for the custom field you specify or you want to reference more than one custom field in a single script.

    For detailed information:
    https://www.ads-software.com/support/article/custom-fields/
    https://developer.www.ads-software.com/reference/functions/get_post_meta/

    HOWEVER
    If you are looking to programmatically bind a custom value to a product as it is being configured then PPOM hidden fields are your best bet and you would need the PRO version.

    • This reply was modified 5 years, 8 months ago by brozra. Reason: spelling error
    • This reply was modified 5 years, 8 months ago by brozra. Reason: removal of recommendation

    Thanks @brozra for sharing more details.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Set default value per product’ is closed to new replies.