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.

change option value

  1. cristianltorres
    Member

    Hi, I have a OPTION PRICING FIELD with values like this:

    Label: Desayuno Clásico (30,00€)
    Value: Desayuno Clásico (30,00€)
    Price: 30,00 €

    So when I look in the form:
    http://regalarcestasadomicilio.com/2012/?page_id=1713

    I Check the HTML and the OPTION VALUE shows like this:
    <option value="Desayuno Clásico (30,00€)|30">Desayuno Clásico (30,00€)</option>

    So I need to change the code, because I need the Option Value to be only "Desayuno Clásico (30,00€)" without "|30"

    Please can you help me? the deal is that I use another plug to take the forms entry and put it in a CRM.

    Thanks.

    Posted 11 years ago on Sunday December 16, 2012 | Permalink
  2. David Peralty

    It needs that value to understand what to price the option at. Without it, pricing wouldn't work.

    Posted 11 years ago on Monday December 17, 2012 | Permalink
  3. cristianltorres
    Member

    OK, I understand, then my question would be:

    Can I add a "€" (euro) simbol or a letter (like "e" or "euros") to the OPTION VALUE of the HTML?

    So It will be like:

    <option value="Desayuno Clásico (30,00€)|30€">Desayuno Clásico (30,00€)</option>

    Posted 11 years ago on Monday December 17, 2012 | Permalink
  4. You can use HTML in the option labels. Use the entity & # 8 3 6 4; (with no spaces) for the Euro symbol.

    Posted 11 years ago on Monday December 17, 2012 | Permalink
  5. cristianltorres
    Member

    Hi Chris, sorry but Im not sure I understand, see this image:

    https://docs.google.com/file/d/0B9U8WIYB0MRnRVlSMk1QSVg1VlE/edit

    So I have for eg.:
    Label: Desayuno Clásico (30,00€)
    Value: Desayuno Clásico (30,00€)
    Price: 30,00 €

    And that "become" in this HTML code:

    <option value="Desayuno Clásico (30,00€)|30">Desayuno Clásico (30,00€)</option>

    So what is exactly the "option labels"? and where can I find it so I can modify it?

    Thanks

    Posted 11 years ago on Monday December 17, 2012 | Permalink
  6. In your screenshot you have label, value and price. You asked about using the Euro symbol in the Value. You already have it in the value there. And you can use it in the label as well. I thought that was what you were asking?

    If not, and you want to solve the original problem, please let us know how you are using the data which is stored with your third party CRM. The stored value may need to be modified before the value can be used by the CRM.

    Posted 11 years ago on Tuesday December 18, 2012 | Permalink
  7. cristianltorres
    Member

    Hi Chris, I'll try to explain my self better:

    I'm using "gravity form to zoho crm" plug from "helpforwp.com"
    So they tell me their plug takes the whole HTML tag "option value" to put it in zoho crm
    So when I try to change the administration label or value, zoho crm gets this:

    "Desayuno clasico (30€)|30"

    And I need zoho crm to get this:

    "Desayuno clasico |30€"

    So i thing i have to modify some php code (just need to know where!) or use some "action hook" like this
    http://www.gravityhelp.com/documentation/page/Gform_pre_submission
    Just need to know how.

    Thanks, I hope this help you to understand me

    Posted 11 years ago on Tuesday December 18, 2012 | Permalink
  8. David Peralty

    Sorry, I was away in the evening. You can't change the value after the break line because it is used for cost. It is used for our calculations, and you can't have any symbols or values in it as it would break things. Basically, think of it as the product price that is available to our JavaScript.

    Posted 11 years ago on Tuesday December 18, 2012 | Permalink
  9. cristianltorres
    Member

    So you`re telling me that there's no solution to my problem?

    Are you completely sure? because if there's no solution, then I can't use Gravity forms, since is not suitable for my business. And in that case, Im gonna have to ask for a total refund, since I won't use your product
    This I don't want because I like gravity forms.

    Maybe you can tell me where to find the code, and I run some tests and see what happend.

    thanks

    Posted 11 years ago on Tuesday December 18, 2012 | Permalink
  10. cristianltorres
    Member

    please I need an answer, ASAP.

    Posted 11 years ago on Thursday December 20, 2012 | Permalink
  11. David Peralty

    Can you give me more information on why it won't work for you? You should be able to take the information and strip away whatever you want before you send it to your CRM of choice. How are you sending data to your CRM currently?

    Posted 11 years ago on Thursday December 20, 2012 | Permalink
  12. cristianltorres
    Member

    THanks David, Im using "gravity to zoho crm" plugin from "http://helpforwordpress.com/"

    Here's the info:
    http://helpforwp.com/plugins/gravity-forms-to-zoho-crm/

    PLease let me know if you need furter info.

    Cristian.

    Posted 11 years ago on Thursday December 20, 2012 | Permalink
  13. cristianltorres
    Member

    about "why it won't work for me", you can read it in the previous post.

    The info of this field that goes to the CRM, has to have the "€" symbol, or the words "euro" or something.

    Posted 11 years ago on Thursday December 20, 2012 | Permalink
  14. David Peralty

    They should be able to support you, as it is a paid plugin, to make a small change in how the data is manipulated before it gets to Zoho CRM.

    Posted 11 years ago on Thursday December 20, 2012 | Permalink
  15. cristianltorres
    Member

    Hi David, but they said there's nothing they can do, that they can't modify the data, it has to be manipulated by Gravity forms, I'm quoting there answer:

    "Sunidy said 5 days, 8 hours ago:
    Hi,

    When you checked your form you will see the option value in you drop down is “Desayuno Clásico (30,00€)|30″… and when the form submitted the Zoho will recieve the value of “Desayuno Clásico (30,00€)|30″ it is to say our plugin works successfully.

    Out plugin only post what received in Gravity form to Zoho crm and won’t processed any data before post to Zoho.

    You may consider adding a hook to Gravity form to process the data before submission. Please check http://www.gravityhelp.com/documentation/page/Gform_pre_submission for reference.

    Sunidy"

    So please, can you tell me what part of the code, handle this, so I can test, because it's been like 1 week now, and you're not giving me any solutions.... I'm tired of this, If I don't find a solution I really want a refund, I won't use your plug since it doesn't fits to my business.

    Posted 11 years ago on Thursday December 20, 2012 | Permalink
  16. We can change the value before it's stored using the gform_pre_submission filter, but then it can't be used by Gravity Forms any longer. David's recommendation was to find out from Zoho if there is a hook which can be used after the data is stored in the Gravity Forms format, but before it's being sent to Zoho. Because the "Gravity to Zoho" plugin is a 3rd party, paid plugin, we don't have access to it, and we can't help you find a suitable place to modify the data being sent to Zoho.

    The data needs to be stored in one format for Gravity Forms to work properly, but Zoho needs to see it in another format. So you will have to find a place you can hook into to modify the data after Gravity Forms stores it, but before it's sent to Zoho by this "Gravity to Zoho" plugin. From their support email, it does not sounds like they have a hook available to do that.

    Would it be possible to take an alternate approach, and have a hidden field in your form which could be use to store the altered value and send that field to Gravity Forms? You could use the gform_pre_submission hook to read the value you have now, and strip out what you don't need to send to Zoho, then save that in the hidden field. Then map that field to your Zoho field, rather than the real field which is stored in a format Zoho cannot use.

    Posted 11 years ago on Saturday December 22, 2012 | Permalink
  17. cristianltorres
    Member

    Thanks for your great answer Chris,

    I thing the alternate approach you're suggesting could work!

    But please, since Im no expert, I need your help, how do I proceed?

    Thanks

    Posted 11 years ago on Saturday December 22, 2012 | Permalink
  18. Ah, progress!

    I think we are talking about the same form here: http://www.gravityhelp.com/forums/topic/empty-default-value#post-105952

    I would like a copy of the form so I can install it. Please email that to chris@rocketgenius.com and I will install it, and look at which fields we need to strip out the text from, and then create a new field to store the stripped value. Then you can map that field to the Gravity > Zoho plugin.

    I need the form to start with though. Thank you.

    If you would rather, please send a WordPress administrator login for this website to chris@rocketgenius.com and I will do the work there.

    Posted 11 years ago on Saturday December 22, 2012 | Permalink
  19. cristianltorres
    Member

    Thanks a lot!! that would be great!
    I just send the form to your email, please confirm reception and tell me if you need anything else!

    Thanks.

    Posted 11 years ago on Saturday December 22, 2012 | Permalink
  20. I have the form and I will look at it over the weekend. Thank you.

    Posted 11 years ago on Saturday December 22, 2012 | Permalink
  21. cristianltorres
    Member

    Hi Chris! Any news? :)

    Posted 11 years ago on Thursday December 27, 2012 | Permalink
  22. I worked out some code to take your field #1 and split off the portion before the pipe symbol | and populate a hidden field in your form with that new value. You can then map that to the other plugin and send that to Zoho CRM.

    Here is a screenshot of the original value (first column) and modified value (3rd column): http://minus.com/lueT5ZMSSUX87

    Here is the code to modify the original value and store it in a hidden field: http://pastebin.com/aAnusb9f

    You will have to make a few changes to this.

    • Change the form ID on line 4 from 241 to your form ID.
    • Input 1 was the correct field in the form you sent me, but if you want to modify another option, please change line 8.
    • Add a hidden field to your form and resave the form.
    • Change the 58 to the ID of your hidden field.

    That should do it. Let us know if you need more help.

    Posted 11 years ago on Friday December 28, 2012 | Permalink
  23. cristianltorres
    Member

    Great Chris!! I'll try the modifications!! one more question:

    - I have more than 1 field to make this modification, so should I copy & paste the same code (with the proper modification to each field) for all the field I want to do this?

    Or there's some other way to add more fields to the same code.
    Like I don't know:
    "$haystack = $_POST['input_1'; 'input_5'; 'input_9' ];"

    thanks a lot!

    Posted 11 years ago on Friday December 28, 2012 | Permalink
  24. cristianltorres
    Member

    Chris!
    where should I modify the code? what is the name of the php file?

    Posted 11 years ago on Friday December 28, 2012 | Permalink
  25. The code I provided should be added to your theme's functions.php.

    To modify more than one field, you will need to do them all individually. Depending on how many fields you have to modify, I might create a loop and loop through all the inputs you need modify, assuming the modification is always the same. Then loop through each input (multiple fields just like line 8) and then store the value in the hidden field, just like it's stored on line 14 now.

    Posted 11 years ago on Monday December 31, 2012 | Permalink
  26. cristianltorres
    Member

    Hi Chris,

    I've made the modifications and It works! thanks a Lot!

    Now I Have another 4 fields that I have to do the same those fields are:

    - ¿Para cuantas personas?*
    - Añade un extra:
    - Población*
    - Forma de pago*

    So I Tryed to copy and paste the same code, changing the fields ID, but It didn't work. I checked the fields ID twice.
    I'm pretty sure there's something wrong in just "copy and paste" the same code. Something is missing..

    Please We're almost there, I just need to replicate the process with 4 more fields!

    Thanks a lot!

    Posted 11 years ago on Tuesday January 8, 2013 | Permalink
  27. cristianltorres
    Member

    Also Chris I've another question:

    After using the wordpress for a while I realise that putting the code into "functions.php" as you told me cause some troubles with the admin view of my WP. I get a lot of blank pages.

    When I remove te code from functions.php, WP works as fine as always.

    Could it be something about how do I put the code?

    I copy/paste the whole code into last line of functions.php, just after this line:
    } ?>

    Thanks.

    Posted 11 years ago on Tuesday January 8, 2013 | Permalink
  28. If you added the code to your functions.php correctly, you should not be getting any blank pages or errors in the admin at all.

    Please post the full functions.php at pastebin.com or pastie.org if you would like us to take a look at the syntax. Or, if you want us to check just the four new fields you want to modify, paste that section of code at pastebin.com or pastie.org and we will check the functionality of that.

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  29. cristianltorres
    Member

    OK Chris, I've paste the functions.php in pastebin.com:
    http://pastebin.com/acVRtKiM

    So if you take a look from line 1013 you'll see how Im pasting the code when I try to put it for all the 5 fields.

    Just for you know, when I paste the code for only 1 field, just like this:
    http://pastebin.com/ZCCcXEfQ
    (also in line 1013)
    It works fine.

    Thanks again!

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  30. You can't use the "strip_pricing" function multiple times in the functions.php. If you want to reuse the function, you will have to rename them to something like:

    strip_input_1
    strip_input_2
    strip_input_55
    strip_input_27
    strip_input_52

    Then in the lines where you add the filter, you need to call each function by its new name, not the old "strip_pricing" name.

    There is certainly a more efficient way to do this. I would use the add_filter line one time, and call one function which will modify each of the five fields individually, then return the form, rather than adding the filter five times. But this will get you headed in the right direction at least.

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  31. cristianltorres
    Member

    Thanks Chris, sorry, but I'm no expert, can you please write an example in pastebin for me? so I just copy and paste and replace the fields number.

    Thanks a lot and sorry :S

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  32. Please replace your functions.php with this functions.php http://pastebin.com/w4CdrGpz

    I combined the five functions into one. Here is just the portion I changed: http://pastebin.com/pJZ2Ex9Z

    This replaces from line 1083 in the original file until the end of the file.

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  33. cristianltorres
    Member

    Thanks a lot Chris! unfortunately it didn't work... :(

    I copied the all code in here: http://pastebin.com/w4CdrGpz

    Pasted in dreamweaver and save it as "functions.php"

    Then I've refreshed the form, filled it, and send it.

    Everything work normal, but none of the 5 hidded fields where filled.. (in gravity form) as you can see in this screenshot:
    https://dl.dropbox.com/u/31599860/Captura%20de%20pantalla%202013-01-09%20a%20la%28s%29%2016.09.45.png

    You will see 2 records, the first is the new one, the second is how it was working before changes.

    I'm very sorry man, can you fix it?

    Thanks a lot again, I'm very grateful you're doing a perfect work as support.

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  34. Cristian, please send me a WordPress administrator login for the site and I will take a look. chris@rocketgenius.com

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  35. cristianltorres
    Member

    done, please be careful.

    Thanks

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  36. I am unable to edit the functions.php file due to the file permissions on your server. So I exported your form and will work on the function on my server.

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  37. cristianltorres
    Member

    Yes it's true, I never knew how to fix that permissions thing..

    Thanks a lot Chris...

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  38. Sorry: I had two errors in my code:

    1. On the new line 8, I had input55 instead of input_55

    2. On the new line 18 I was using $array instead of $field_pair

    Here is the revised code, just the function at the bottom, not the whole functions.php http://pastebin.com/nurw2KMy

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  39. cristianltorres
    Member

    Great man! I'm glad you find the solution so quick!

    where is the code? I don't see any link

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  40. cristianltorres
    Member

    Hey Chris, I've just made those 2 changes manually, and now 4 of 5 fields are already working!! you're a genius man! thanks!

    but this one isn't :
    input_55' => 'input_59', // envia los extras al ZOHO

    The only diferent from the others fields is that this one is "checkboxes" field, and It should put all the options in the hidden text field (ID nº 59) separated by "; "

    So I though maybe there isn't enough space in a normal "single line text" field, and I delete and created a new "paragraph text" field (now ID nº64) but I didn't work...

    sorry to be such a pain in the xsx...

    Posted 11 years ago on Wednesday January 9, 2013 | Permalink
  41. 4 out of 5 is not bad!

    Checkboxes are referenced differently than other fields, since the information is stored in an array. Input 55 will have multiple values submitted, in fields like input_55_1 and input_55_12 (from the first choice being 1 to the last choice being whatever.)

    So, the process to get those values into your hidden field will have to be to go through each one of the submitted values in input_55_XX, strip off the end after the pipe symbol, then concatenate all the values, separated by semicolon and THEN store it in your hidden field.

    We've shown you how to do it and actually provided the code to handle 4 out of 5 of your fields. I know you said you're no expert, so you may need some local help to finish this up for you. We can't provide you with the complete solution, but we have shown clearly that it can be done.

    Posted 11 years ago on Thursday January 10, 2013 | Permalink
  42. cristianltorres
    Member

    I understand Chris,

    Can I paid you (instead of some local help) to finish this work? send me a budget by email and we'll talk the details over there.

    For me it's the faster option since you already know the details of what I need. Please, do it for me, I'll pay.

    Thanks Again. Now we can close this issue and continue with the other:
    http://www.gravityhelp.com/forums/topic/empty-default-value?replies=13#post-114756

    Posted 11 years ago on Thursday January 10, 2013 | Permalink
  43. Unfortunately, we don't offer any kind of paid support.

    Posted 11 years ago on Thursday January 10, 2013 | Permalink
  44. Cristian, take a look at this revised code, which should handle field 55 checkboxes without a problem and string them all together and store them in field 59: http://pastebin.com/iKVKJNiE

    Posted 11 years ago on Thursday January 10, 2013 | Permalink
  45. cristianltorres
    Member

    Chris.... I have no words man.... you really REALLY make my day.

    I couldn't believe when I saw your last post, now I'd already try the code, IT WORKS PERFECTLY!!!

    I'am so grateful, I can't even explain it here! I'm so aware that you went over your (far far) limits of the excellent support you have, and that not only make this support for customer even greater, but you as a person too...

    THANKS THANKS THANKS THANKS!, we can close this issue, Is done!

    Posted 11 years ago on Thursday January 10, 2013 | Permalink
  46. You're welcome. Thank you for the kind words.

    Posted 11 years ago on Friday January 11, 2013 | Permalink

This topic has been resolved and has been closed to new replies.