Description
The gravityflowwoocommerce_checkout_step_url filter allows developers to modify the checkout step URL generated for WooCommerce checkout steps.
Parameters
| Parameter | Type | Details |
|---|---|---|
| $url | string | The checkout step URL |
| $entry_id | int | The entry ID |
| $step | object | The current Gravity Flow step |
Examples
Customizing the Checkout Step URL in Gravity Flow WooCommerce
add_filter( 'gravityflowwoocommerce_checkout_step_url', 'gfw_gravityflowwoocommerce_checkout_step_url', 10, 3 );
function gfw_gravityflowwoocommerce_checkout_step_url( $url, $entry_id, $step ) {
$entry = GFAPI::get_entry( $entry_id );
if ( is_wp_error( $entry ) || empty( $entry['27'] ) ) {
return $url;
}
$url = add_query_arg( 'add-to-cart', $entry['27'], $url );
return $url;
}
Placement
This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.
See also the PHP section in this article: Where Do I Put This Code?
Source Code
This filter is located in includes/merge-tags/class-merge-tag-assignee-woocommerce-checkout-url.php