Home / eCommerce / Security Icons for Cart Page
Duplicate Snippet

Embed Snippet on Your Site

Security Icons for Cart Page

Dustin Lavoie
<10
Code Preview
php
<?php
/**
 * ============================================================
 * Cart Page — Security Trust Badge Bar
 * ============================================================
 * 
 * PURPOSE: Adds a clean trust badge row below the "Proceed to
 *          Checkout" button on the cart page to increase
 *          conversion confidence.
 * 
 * INSTALL: Code Snippets plugin → "Run Everywhere"
 * ============================================================
 */
add_action( 'wp_head', 'gp_cart_badges_styles' );
function gp_cart_badges_styles() {
    if ( ! is_cart() ) {
        return;
    }
    ?>
    <style id="gp-cart-badges">
        #gp-cart-trust-bar,
        #gp-cart-trust-bar * {
            text-transform: none !important;
        }
        #gp-cart-trust-bar {
            display: flex;
            align-items: center;
            justify-content: center;
            flex-wrap: wrap;
            gap: 15px;
            padding: 14px 16px;
            margin: 8px 0 0 0;
        }
        #gp-cart-trust-bar img {
            height: 35px;
            width: auto;
            flex-shrink: 0;
            opacity: 0.85;
            transition: opacity 0.2s ease;
        }
        #gp-cart-trust-bar img:hover {
            opacity: 1;
        }
        #gp-cart-trust-bar .gp-cart-secure {
            font-size: 17px;
            font-weight: 600;
            color: #059669;
            letter-spacing: 0.02em;
            flex-shrink: 0;
        }
        @media (max-width: 480px) {
            #gp-cart-trust-bar {
                gap: 10px;
                padding: 12px 10px;
            }
            #gp-cart-trust-bar img {
                height: 29px;
            }
            #gp-cart-trust-bar .gp-cart-secure {
                font-size: 15px;
            }
        }
    </style>
    <?php
}
add_action( 'woocommerce_after_cart_totals', 'gp_cart_trust_badges', 10 );
function gp_cart_trust_badges() {
    ?>
    <div id="gp-cart-trust-bar">
        <img src="https://purepeptides.bio/wp-content/uploads/2026/03/ssl-green-padlock.svg" alt="SSL Secure">
        <img src="https://purepeptides.bio/wp-content/uploads/2026/03/visa-4-logo-svgrepo-com.svg" alt="Visa">
        <img src="https://purepeptides.bio/wp-content/uploads/2026/03/mastercard-old-3-svgrepo-com.svg" alt="Mastercard">
        <img src="https://purepeptides.bio/wp-content/uploads/2026/03/google-pay-svgrepo-com.svg" alt="Google Pay">
        <img src="https://purepeptides.bio/wp-content/uploads/2026/03/apple-pay-svgrepo-com.svg" alt="Apple Pay">
        <img src="https://purepeptides.bio/wp-content/uploads/2026/03/green-shield-check-mark-1-2.svg" alt="Secure">
        <span class="gp-cart-secure">Secure Checkout</span>
    </div>
    <?php
}

Comments

Add a Comment