• Roundup WP
  • Products
    • Registrations for the Events Calendar Pro – WordPress Event Registration
      • Buy Now
      • Setup (Pro)
      • Demo
    • Stripe Extension
      • Buy Now
      • Setup
    • Mailchimp Extension
      • Buy Now
      • Setup
    • RTEC Memberships
      • Getting Started
    • RTEC WooCommerce Payments
    • Mollie (iDEAL) Extension
      • Buy Now
      • Setup
    • Discount Codes Extension
      • Buy Now
      • Setup
  • Pricing
  • Features
    • Payments
    • Form Builder
    • Email Messages
    • Registration Management
    • Memberships
    • Event Specific
  • Blog
  • Support
    • FAQs and Troubleshooting
    • Codex
    • Contact Support
  • My Account
  • Get Started

Filter: rtec_payments_discounts

Last updated on January 10, 2015

rtec_payments_discounts is a filter for dynamically adding or changing discounts right before checkout.

Usage

<?php add_filter( 'rtec_payments_discounts', 'function_name', 10, 2 ); ?>

Parameters

$discounts – (array) Discount items including calculated discount and label.
$payment_data – (array) Data associated with the registration, event, and payment.
$line_items – (array) Line items including cost, label, and quantity.

Changelog

Pro
2.0 – introduced

Example: Give a Discount if Registering for More Than Three

function ru_fourth_guest_discount( $discounts, $payment_data, $line_items ) {
	$fourth_guest_discount_label = 'Fourth Guest Discount';

	$has_four_guests = $line_items['event']['quantity'] > 3;
	if ( $has_four_guests ) {
		$discounts['event'][] = array(
			'label'      => $fourth_guest_discount_label,
			'calculated' => 25
		);
	}

	return $discounts;
}
add_filter( 'rtec_payments_discounts', 'ru_fourth_guest_discount', 10, 3 );
Company
  • About
  • Contact
  • Careers
Products
  • Registrations for the Events Calendar
  • Stripe Payments (extension)
  • Mailchimp Email Lists (extension)
  • Event Memberships (extension)
  • WooCommerce Payments (extension)
  • Mollie iDEAL Payments (extension)
  • Discount Codes (extension)
Features
  • Form Builder
  • Event Registration Payments
  • Membership Features
  • Email Messaging
  • Registration Management
  • Event Specific
Resources
  • Support
  • My Account
  • Documentation
  • Pricing
  • Blog
Connect with Us
Follow us on Facebook Contact Us
Copyright © 2025 Roundup WP LLC
Terms & Conditions Privacy Policy Roundup WP Coupon Codes