How to Use ChronoForm ReDirect Plugin to Submit PayPal Shopping Cart Form
The Joomla ChronoForm component includes a ReDirect Plugin that can be used to pay for a submitted form of shopping cart variables.
Here is an example of its setup. This form allows the user to purchase tickets and to give an optional donation. It requests the user’s name, email and phone. It goes to PayPal, accepts payment and returns to a thank you page.
Setup the Form
Create a new form, give it a unique name
Email the results or not. Leave the rest of the General tab variables at their defaults.
Enter the form code:
<h2>Animal Allies SIPS FOR STRAYS Fundraiser</h2>
<p style="font-size: 16px;"><strong>Milly's Tavern, April 21st 2011, 6pm - 8pm</strong></p>
<fieldset><legend>Tickets</legend>
<label for="quantity_1">$20 Each Ticket </label><span class="reqMark">*</span>
<!-- amount_1 calculated -->
<input type="hidden" name="amount_1" value="" />
<!-- quantity_1 -->
<select id="quantity_1" name="quantity_1" class="required">
<option value="">Please select...</option>
<option value="1" class="" selected>1</option>
<option value="2" class="">2</option>
<option value="3" class="">3</option>
<option value="4" class="">4</option>
<option value="5" class="">5</option>
<option value="6" class="">6</option>
<option value="7" class="">7</option>
<option value="8" class="">8</option>
<option value="9" class="">9</option>
<option value="10" class="">10</option>
<option value="11" class="">11</option>
<option value="12" class="">12</option>
<option value="13" class="">13</option>
<option value="14" class="">14</option>
<option value="15" class="">15</option>
<option value="16" class="">16</option>
<option value="17" class="">17</option>
<option value="18" class="">18</option>
<option value="19" class="">19</option>
<option value="20" class="">20</option></select> tickets<br>
</fieldset>
<fieldset><legend>About You</legend>
<!-- First Name, Last Name, Email, Phone -->
<label for="firstName">First Name: </label><span class="reqMark">*</span>
<input type="text" id="firstName" name="firstName" value="" size="35" class="required"><br>
<label for=”lastName”>Last Name: </label><span class=”reqMark”>*</span>
<input type=”text” id=”lastName” name=”lastName” value=”" size=”35″ class=”required”><br>
<label for=”email”>Email: </label><span class=”reqMark”>*</span>
<input type=”text” id=”email” name=”email” value=”" size=”35″ class=”validate-email required”> <br>
<label for=”phone”>Phone: </label><span class=”reqMark”>*</span>
<input type=”text” id=”phone” name=”phone” value=”" size=”35″ class=”validate-phone required”><br>
</fieldset>
<fieldset><legend>Donation</legend>
<label>We always welcome donations! </label><span class=”reqMark”>*</span>
<!– amount_2 placeholder on server too –>
<input type=”hidden” name=”amount_2″ value=”" />
<!– price_2 –>
<select id=”price_2″ name=”price_2″ class=”required”>
<option value=”">Please select…</option>
<option value=”0.00″ class=”" selected>
Sorry I can’t give a donation this time</option>
<option value=”10.00″ class=”">Yes, I want to give $10 to Animal Allies Rescue!</option>
<option value=”20.00″ class=”">I want to give $20 to Animal Allies Rescue</option>
<option value=”30.00″ class=”">I want to give $30 to Animal Allies Rescue</option>
<option value=”40.00″ class=”">I want to give $40 to Animal Allies Rescue</option>
<option value=”50.00″ class=”">I want to give $50 to Animal Allies Rescue</option></select>
<br></fieldset>
<fieldset><legend>Click to Buy</legend>
Click submit to pay for your tickets at PayPal:
<input type="submit" id="sipssubmit" name="sipssubmit" value="submit"></fieldset>