Add_filter | Pi | Change Wallet Payment loctaion’s
Overview
This filter allows you to customise where the Apple Pay and Google Pay wallet payment options appear on your site.
By default, wallet buttons can be displayed:
- At the top of the checkout page
- At the bottom of the checkout page
- On the cart page
But what if you’d prefer them somewhere else. For example, under the cart totals or in a custom area of your theme? This filter gives you full control.
How to Use
To change the location(s), add the following snippet to your site:
php
123456789
add_filter( 'ag_opayo_express_checkout_locations', function( $locations ) {
// Clear all default locations
$locations = [];
// Add a custom hook location
$locations['woocommerce_after_cart'] = 10;
return $locations;
} );In the example above, we:
- Remove all existing placement hooks
- Add the wallet buttons to display after the cart table using WooCommerce’s built-in woocommerce_after_cart hook
This filter is ideal if you’re using a custom layout or want full control over where wallet options appear.
If you’re a developer or using a bespoke theme, this gives you the flexibility to position wallet buttons exactly where you want them.
Was this helpful?