Payment and Trust Icons Under the Add to Cart Button
Adds a short secure-checkout line with accepted payment methods under the add to cart button on product pages.
Opens WPIDE on
Code
add_action( 'woocommerce_after_add_to_cart_form', function () {
$methods = array( 'Visa', 'Mastercard', 'PayPal', 'Apple Pay' ); // Accepted methods.
echo '<div class="wpide-trust-line" style="margin:12px 0 0;font-size:.9em;color:#50575e;">';
echo '<span aria-hidden="true">🔒</span> ' . esc_html( 'Secure checkout' ) . ' · ';
echo esc_html( implode( ' / ', $methods ) );
echo '</div>';
} );
Notes
Edit $methods to list the payment methods you accept.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.