Skip to content
Docs
Get RestroPress

Filter

rpress_payment_cart_details

Updated
On this page

Filters the cart details returned for a payment.

Applied when the cart_details property of an RPRESS_Payment is read. The value is the array of cart items stored with the payment. The filter runs on every read of the property, not only when the payment is loaded.

Parameters#

ParameterTypeDescription
$cart_detailsarrayCart item arrays.
$payment_idintID of the payment.
$paymentRPRESS_PaymentThe payment object.

Return value#

array. The cart details to return.

Example#

function my_payment_cart_details( $cart_details, $payment_id, $payment ) {
	return is_array( $cart_details ) ? $cart_details : array();
}
add_filter( 'rpress_payment_cart_details', 'my_payment_cart_details', 10, 3 );

Source#

Applied in:

  • includes/payments/class-rpress-payment.php (line 2154), in RPRESS_Payment::get_cart_details()

See also#

Was this page helpful?