Marinus Klasen

Marinus Klasen

  • Development
  • Consultancy
  • Developer Resources
  • Blog
  • Contact

January 31, 2022

Gravity Forms & Mollie: De omschrijving in het Mollie dashboard aanpassen

Marinus Klasen

Voor het aanschaffen van tickets voor enementen heb ik voor een klant Gravity Forms & Mollie ingezet, als uitbreiding van de Event Manager plugin.

Wanneer er tickets aangeschaft worden staat er in de omschrijving “Product: Productnaam”, dat is niet handig voor de administratie, dus lossen we even op!

De Gravity Forms Mollie plugin heeft een fijne filter, namelijk: gform_mollie_payment_description

We haken een functie aan deze filter:

add_filter( 'gform_mollie_payment_description', array( $this, 'update_mollie_description' ), 10, 5 );

En vullen deze functie als volgt:


	public function update_mollie_description( $description, $strings, $entry, $submission_data, $feed ) {
		$description = $entry['15'];

		$form = \GFAPI::get_form( $entry['form_id'] );

		$order = \GFCommon::get_product_fields( $form, $entry, false, true );

		if ( ! isset( $order['products'] ) || empty( $order['products'] ) ) {
			$description .= ' - geen producten gevonden';
		} else {
			$tickets_text = $this->get_purchased_tickets_text( $order, $form );
			$description .= ' - ' . $tickets_text;
		}

		$description .= ' (#' . $entry['id'] . ')';

		return $description;
	}

About Marinus Klasen

Marinus has been working in software/web development for more than a decade. Since 2020 his attention shifted on sharing knowledge and developing products and tools for sharing knowledge.

Marinus Klasen on Twitter

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Ready to take action?

I'm looking forward to discuss your projects and goals!
Feel free to reach out using the contact details below.

Marinus Klasen

[email protected]
twitter.com/marinusklasen
linkedin.com/in/marinusklasen

  • GitHub
  • LinkedIn
  • Twitter

Have you read?

  • An easy way to copy code blocks from the WordPress Block EditorJune 9, 2022
  • Set a static IP for docker-compose containersMay 25, 2022
  • Justified auto width in Media Carousel Widget in ElementorMay 18, 2022
  • Using the WordPress REST APIMay 18, 2022
  • Remove all edit post links in WordPress with a simple filterMay 11, 2022

Copyright © 2022 · Marinus Klasen | Webdesign by Team Rood