ontarget
Active Member
Hi
On the stripe plugin is there any way of getting Price tab >Cost to change value via ajax?
I have a "booking id" field element which creates an amount via a calc element - i need the stripe popup to take the value of the calc element
I tried setting
Eval to Element > Yes > Selected my Calc Element but this has no effect.
If i set Eval to Yes and enter the php below the stripe value only updates on submit ( which is too late !)
UPDATE MY WORK AROUND!
To get this working I created a calc element which generated a URL containing my values
I could then return the url as a bitly link
In the stripe plugin i set Cost >Eval = Yes then
The stripe plugin is now prepopulated with my value
When a successful payment was made i have a php onformsubmit which updates the booking table with a paid value
On the stripe plugin is there any way of getting Price tab >Cost to change value via ajax?
I have a "booking id" field element which creates an amount via a calc element - i need the stripe popup to take the value of the calc element
I tried setting
Eval to Element > Yes > Selected my Calc Element but this has no effect.
If i set Eval to Yes and enter the php below the stripe value only updates on submit ( which is too late !)
PHP:
$bookingid = '{aaa_deposits___enter_booking_id}';
// Get the db object
$db =JFactory::getDbo();
// Quote the values for security reasons:
$bookingid = $db->quote($bookingid);
// Build the query
$query = $db->getQuery(true);
$query->select('deposit_amount')
->from('aaa_bookings')
->where('booking_id = ' . $bookingid);
$db->setQuery($query);
// Run the query
$found = $db->loadResult();
return $found;
UPDATE MY WORK AROUND!
To get this working I created a calc element which generated a URL containing my values
PHP:
$fullUrl = 'http://xxxx.com/index.php?option=com_fabrik&view=form&formid=2' .
'&aaa_deposits___enter_booking_id='. urlencode('{aaa_bookings___unique_id}') .
'&aaa_deposits___deposit_amount=' . urlencode('{aaa_bookings___deposit_amount}');
return $fullUrl;
In the stripe plugin i set Cost >Eval = Yes then
PHP:
return '{aaa_deposits___deposit_amount}';
The stripe plugin is now prepopulated with my value
When a successful payment was made i have a php onformsubmit which updates the booking table with a paid value
PHP:
$uniqueid = '{aaa_deposits___enter_booking_id}';
$myDb = JFactory::getDbo();
$myQuery = $myDb->getQuery(true);
$myQuery
->update($myDb->quoteName('aaa_bookings'))
->set('deposit_paid =' . 1)
->where('unique_id = ' . $myDb->quote($uniqueid));
$myDb->setQuery($myQuery);
try {
$result = $myDb->execute();
}
catch (Exception $e) {
}
Last edited: