Getting value from text boxes on "Add to Cart" button click

This topic has 6 replies, 2 voices, and was last updated 8 years, 9 months ago ago by Eva Kemp

  • Avatar: pixel_account
    pixel_account
    Participant
    July 23, 2015 at 22:36

    Hi there,

    I’m having some trouble getting values out of some custom text boxes that I added to the product page. I’ve hooked into “woocommerce_add_cart_item_data” and tried to get them using $_POST['text_box_name']; but that doesn’t seem to be working.

    Ajax is enabled so I’m guessing that I might be missing something? Any help is appreciated. If admins need access to the files I’m happy to send them over.

    5 Answers
    Avatar: Eva
    Eva Kemp
    Support staff
    July 24, 2015 at 08:21

    Hello,

    Please show screenshots of the issue and provide us with wp-admin panel credentials in Private Content.

    Regards,
    Eva Kemp.

    Avatar: pixel_account
    pixel_account
    Participant
    July 24, 2015 at 15:44

    I would like to be able to get the values inside the text boxes once the “add to cart” button has been clicked. Check line 282-288 in the functions.php file; this is where I was trying to gather the details.

    Just to be entirely clear, the values from the text boxes should show up in the invoice; I hard coded a string value to show you what I mean.

    Please, contact administrator
    for this information.
    Avatar: Eva
    Eva Kemp
    Support staff
    July 26, 2015 at 07:31

    Hello,

    You didn’t provide us with the site name.

    If you want to include those values in order you’d better create attributes “Chest Width”, “Shoulder Widget” etc. and use them as variations for variable products:
    http://docs.woothemes.com/document/variable-product/
    https://www.youtube.com/watch?v=iUcAf89LfCc

    Please try it.

    Regards,
    Eva Kemp.

    Avatar: pixel_account
    pixel_account
    Participant
    July 26, 2015 at 15:13

    Hi Eva,

    Variations aren’t an option because the input is custom text; as far as I’m aware you can only create pre-defined options with variations.

    The site link is below

    http://176.32.230.27/lorenzoborghese.co.uk/product/classic/

    Avatar: Eva
    Eva Kemp
    Support staff
    July 27, 2015 at 09:02

    Hello,

    In this case you have to contact Woocommerce support team as Checkout page is their configuration.

    Sorry for inconveniences.

    Regards,
    Eva Kemp.

  • Viewing 6 results - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.