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.

Pre populate product field & send amount to paypal

  1. Hi,

    Is it possible to pre populate a product field with a price in php (calculation is done in php) & send it to paypal?
    I've tried some options with calculation etc. but it doesn't work.

    The price will display in the form when the calculation formula is changed but will not be send to paypal.

    & when user defined price is selected it works, however users can change the price.
    When the field is disabled by jquery paypal doesn't work...

    Posted 9 years ago on Sunday January 13, 2013 | Permalink
  2. Do you have an example of what you tried to do, online now where we can see it?

    Can you explain also what you are trying to accomplish? Maybe we can help you achieve what you're trying to do by approaching it a different way.

    Posted 9 years ago on Sunday January 13, 2013 | Permalink
  3. A live example:

    Login on http://dev.effectiva.nl/dutchforwarder/change-account-details/
    with testklant@hotmail.com & test

    Page: http://dev.effectiva.nl/dutchforwarder/orders/ -> check checkboxes
    - ship packages.
    - select address
    - price is calculated in php and then pay with paypal ( but this doesn't work with the correct price ).

    form is filled & processed like:

    // proces post & update data
    		add_action('gform_after_submission', array( $this ,'proces_forms' ), 20, 2);	
    
    		// Filters Gravity Forms/GForms, add values to front-end area for profile
    		add_filter("gform_pre_render", array($this ,"fill_forms" ), 10, 2 );

    Pre renderd like this, same for after submission:

    if( $field['id'] == '19' ){
    
    				  $field['calculationFormula']= number_format($price,2);
    
    				}
    			}
    Posted 9 years ago on Sunday January 13, 2013 | Permalink
  4. I'll bring this to the attention of the development team.

    Posted 9 years ago on Monday January 14, 2013 | Permalink
  5. Ok Chris, if possible an fast answer will be appreciated, customer is waiting ;)

    Posted 9 years ago on Monday January 14, 2013 | Permalink
  6. Before we hear from the development team, I wonder if you can explain why the calculations did not work?

    Posted 9 years ago on Monday January 14, 2013 | Permalink
  7. The calculation in gravityforms work, however when i place the calculation by php in the calculation field it displays the value but doesn't pass the value through to paypal.

    Posted 9 years ago on Monday January 14, 2013 | Permalink
  8. I see. I thought you were saying that the Gravity Forms calculation was not working when you added it to a number field. I misunderstood you.

    Posted 9 years ago on Tuesday January 15, 2013 | Permalink
  9. Calculations works yes, passing the data that is the answer from the calculation to paypal doesn't work ;)

    Posted 9 years ago on Tuesday January 15, 2013 | Permalink
  10. Can you provide me an XML export of your form (Forms > Import/Export > top center menu item Export Forms) and email it to chris@rocketgenius.com along with the functions you are using (your complete functions.php file is fine.)

    We'd like to install this locally and see if we can recreate your problem. Thank you.

    Posted 9 years ago on Tuesday January 15, 2013 | Permalink
  11. Mail have been send

    Posted 9 years ago on Tuesday January 15, 2013 | Permalink
  12. Hi, did you find a fix for this? I have a similar problem on this page:
    http://dengronnekurer.dk/?origin=Skydebanegade%2C+Copenhagen&destination=Skydebanevej%20Aalborg&extras=
    If you cick on the big orange round button, you'll see 2 fields with an address that are disabled. The input data is not submitted for those two disabled input fields.

    Posted 9 years ago on Friday February 1, 2013 | Permalink
  13. Okay, I found the cause for my issue. The data in Input fields that are tagged disabled are not submitted, so I changed my jQuery so it renders the inputfield as readonly.
    Thanks to this page: http://arafatbd.net/post-item/29/html-form-difference-between-disabled-and-readonly-element/

    Posted 9 years ago on Friday February 1, 2013 | Permalink
  14. Thank you for sharing your findings.

    Posted 9 years ago on Friday February 1, 2013 | Permalink