How do I get an WooCommerce SKU in the form?

Hi folks,

Using GF for work website and I am trying to create a request a quote form where the SKU can be dynamically added to the form when sent to the info@ email.

I have created the following:

But this is just this - (See next post - can only post 1 image…)

How do I simply get the WooCommerce SKU to be in this form dynamically so the users doesn’t need to fill out the form.

Thank you very much for any help!!

WooCommerce uses the meta key _sku to store the SKU for products.

So if your form is being embedded in the product page, you can use {custom_field:_sku} as default value in a field to get the SKU.

2 Likes

Thank you, I will try this out and report back :slight_smile:

Thanks again for the help but it isn’t working for me.

Nothing Coming Through

See how I’ve set it up: (I can only upload 1 image at a time as I’m new)



I have the form pop up on click using pop-up plugin. What should I do?
Thank you,
Ben.

Ooops! My mistake, sorry. I told you the wrong merge tag, my previous post is now updated with the correct one.

2 Likes

Thanks again for your help. This is awesome and it works fine. My question to you is where could I find the info such as:

{custom_field:_sku}

online? I’ve looked all over and not found anything,

Cheers,

Ben.

Well, it’s a combination of the two worlds. Knowing about Gravity Forms merge tags https://docs.gravityforms.com/merge-tags/ and about how WooCommerce is storing the information you want to get from the product. I was unable to find an official doc for a list of WooCommerce product meta keys, but in the following third-party link you can find a list of of them https://wedevs.com/support/topic/meta-keys-for-attributes/#post-4742

I’m not sure if the list is complete, I would recommend you to check it with WooCommerce support.

1 Like

So I have tried this and it works great. The question I have is how can I achieve both this result and have it show the sku when it is a product with variations.
The sku only shows for single product with sku, not product with variations, although I thought the variations and the normal sku on a simple product are the same.

Any help is appreciated.

© 2008 - 2019. Gravity Forms is a project by Rocketgenius Inc.