Paypal Description and Amount Empty No mater what I Do

How to fix empty PayPal description and amount fields in ChronoForms.

Overview

The issue occurs because the PHP code setting the values lacks proper string syntax, causing the data to be ignored.
Ensure the PHP code uses correct quotes for strings and add hidden form fields with the required values to pass data to PayPal.

Answered
jm jm1968a 08 Feb, 2015
I cannot get the PayPal fields to fill in.

Here is me custom action located before the PayPal redirect action.
<?php
$form->data['amount'] = 5.99;
$form->data['item'] = 1 x Send Glitter;
 ?>


Any Ideas - Ive spent a good 14 hours on this.
jm jm1968a 08 Feb, 2015
From debug:

https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=info%40sendglitter.ca&no_shipping=1&no_note=1&return=www.sendglitter.ca¤cy_code=CAD&item_name=&amount=0&first_name=&last_name=&address1=&address2=&city=&state=&zip=&country=&custom=&night_phone_a=&
jm jm1968a 08 Feb, 2015
I got it!!!😀

I added 2 hidden fields to my form:


<input name="amount" id="amount" value="5.99" type="hidden" class="form-control A" /><input name="item" id="item" value="1 x Send Glitter" type="hidden" class="form-control A" />
Gr GreyHead 09 Feb, 2015
Answer
Hi jm1968a,

In PHP strings need to have quotes around them - if they aren't there your PHP is ignored or shows an error message. Please try
<?php
$form->data['amount'] = 5.99;
$form->data['item'] = '1 x Send Glitter';
 ?>

Bob
This topic is locked and no more replies can be posted.