PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Using Post Title as Product Name

  1. Hello Gravity Forums,

    I'm creating a order form for products we are selling via our website. I searched but couldn't come across anything like I needed.

    Basically what I need is the order form to pull the post title as the products name. I'm not real familiar with PHP or coding but I get things done. I understand you can use the dynamic option but I fail to understand how to do this correctly and efficiently.

    Another thing is I'm using Cart66 as well. So when they decide to Add to Cart this will work too.

    Any help on this would be greatly apperciated. Thanks for you time.

    Posted 10 years ago on Friday June 24, 2011 | Permalink
  2. Just to make it clear, your form has a single product field and you would like the product name field in the form to be populated with the current post title.
    Did I get this right?

    Posted 10 years ago on Friday June 24, 2011 | Permalink
  3. Yes that it right.

    Posted 10 years ago on Wednesday June 29, 2011 | Permalink
  4. Ok, this is what you need to do:

    1- Set your product field to "Allow field to be populated dynamically" and enter "prod_name" for the Name parameter.
    http://tardis1.tinygrab.com/asRY

    2- Copy the following code snippet to your theme's function.php, replacing the form ID and field ID with your actual values.
    http://pastie.org/2145419

    Posted 10 years ago on Thursday June 30, 2011 | Permalink
  5. gregreimer
    Member

    This is along the lines of something I'm trying to figure out.

    I'd like to create a list of products based on a custom post category. These posts have a Product Name and Price entered as the title and a custom field, respectively. I'm guessing that just adding a loop to the above code won't quite do it.

    Thanks in advance for your help.

    Posted 9 years ago on Wednesday January 4, 2012 | Permalink