• I have built a site for appartment owners in a resort complex. I have created a selection field with advanced custom fields with a list a key number codes. Each user has a unique key code that is saved in the profile of the user. Once a user is logged in and they purchase a key from the store i want the ‘key code’ to auto populate in a field on the product page when they go to add the key to cart.

    i have created the field with rules:
    rule 1: post equal to product
    rule 2: post equal to ‘key’ category

    I can see the drop down list in the product page on the back end but its not showing when you view the product on the website as the logged in user.

    Can someone please tell me what other steps i need to do to have the ‘key code’ show on the product page for the user

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter VERTEXMEDIA

    (@vertexmedia)

    maybe an easier way to describe this is:
    I basically want to add 1 of of the fields in the users profile to auto populate in a box above the add to cart now button when they order a key.

    the field i want to add is a ‘key code’ that is one of the required ‘advanced custom fields’ in their profile for the particular user group when i add them as a new user.

    So when they go to the product in store it already has the key code showing on the product above the add-to-cart button. The reason i need to do this is each key is the same product but when they cut the keys on the shop each appartment has a different code for their key because the grooves in each key is different. The people that cut the keys need to know this code when they receive the order.

    The process i am asking help for works perfect in WPForms. All i do is add {user_meta key=”front_door_key”} in the ‘default value’ box as a smart tag and when you open the form up to send it already has the door key code populated in a text box. I want to do the same thing for woocommerce.

    Hope this makes sense.

    • This reply was modified 4 years, 7 months ago by VERTEXMEDIA.
    • This reply was modified 4 years, 7 months ago by VERTEXMEDIA.
    • This reply was modified 4 years, 7 months ago by VERTEXMEDIA.
    • This reply was modified 4 years, 7 months ago by VERTEXMEDIA.
    • This reply was modified 4 years, 7 months ago by VERTEXMEDIA.
    Moderator bcworkz

    (@bcworkz)

    I don’t know WooCommerce that well, but I’m fairly certain you just need to find the right hook from which to include the field value in the order data. Maybe the WooCommerce documentation will help you find this.

    If you have trouble finding the right hook, I recommend asking in the dedicated support forum for WooCommerce where its devs and expert users can help you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Advance custom field user details auto populate in woocommerce product’ is closed to new replies.