• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Strip form plugin currency

ontarget

Active Member
Hi by default the Stripe plugin is set to USD.
Changing "Currency Code" to EUR or eur has no effect on the stripe popup but it does change the currency in the Price Tab> Cost field
How can we use Euro please?
I have starte looking at the stripe.php file and tried hard coding "EUR" into the value for $currencyCode but no joy so far.

In another non-Fabrik stripe system i wrote the following lines of code to ensure Euro was selected
Code:
<?php
  require_once('./config.php');
  include 'header.php';
  $token  = $_POST['stripeToken'];
  $amount = $_POST['amount'];
  $email = $_POST['stripeEmail'];

  $customer = \Stripe\Customer::create(array(
      'email' => $email,
      'source'  => $token
  ));

  $charge = \Stripe\Charge::create(array(
      'customer' => $customer->id,
      'amount'   => $amount*100,
      'currency' => 'eur'
  ));

  $thankyou = '<h1>Thank you for your payment</h1>';
  echo "<div id='thankyou' class='center'>" . $thankyou, $customer['email'] . "<br/> ",$charge['currency'], $amount . "</div>";
   include 'footer.php';
?>
 
Thanks Hugh
I changed the typo as suggested, deleted the stripe plugin from the form and re did it entering EUR in Currency Code -
However there is now no effect on the stripe popup or the currency in the Price Tab> Cost field - it stays firmly as $

UPDATE
you need to change /plugins/fabrik_form/stripe/stripe.php
Code:
line 562: $currencyCode       = $params->get('stripe_currency_code', 'USD');
This changes the currency label in the Price Tab> Cost field but popup now stays in $ still

Replacing all instances of USD with EUR in stripe.php
results in
Notice: Undefined index: in /home/xxxxxx/public_html/mindfulnesscourse/plugins/fabrik_form/stripe/stripe.php on line 200

Notice: Undefined index: in /home/xxxxxxx/public_html/mindfulnesscourse/plugins/fabrik_form/stripe/stripe.php on line 697
 
Last edited:
Hi Hugh
Sadly no - popup still shows $ on the amount.

UPDATE
I think we are close Hugh
I hard coded 'eur' into the js file and the popup now shows Euro. I wonder if it is case sensitive?


JavaScript:
currency: 'eur',
                    //currency: this.options.currencyCode,
 
Last edited:
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 !)


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);
//. ' AND  lastname = ' . $lastname  . ' AND travelcode =' . $travelcode);
$db->setQuery($query);
// Run the query
$found = $db->loadResult();

return $found;

Here is my example

http://finelines.pro/index.php/bookings/test-deposit

If you enter "11111" into booking deposit it will calc "135"
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top