DEV Community

Cover image for WooCommerce Info Boxes under Add to Cart
SnippFlow
SnippFlow

Posted on

WooCommerce Info Boxes under Add to Cart

Put informative Woocommerce Info Boxes below the “Add to Cart” button and you’ll supercharge your WooCommerce product pages.

// Add Info Boxes under Add to Cart
function sf_add_to_cart_info_boxes(){

    echo '<div class="sf-add-to-cart-infobox">';
        echo '<i class="fa-solid fa-truck-fast"></i>';
        echo '<div class="desc">';
        echo '<h5>Need fast shipping?</h5>';
        echo '<p>Select the Express Service, and the shipping will be completed within 24 hours from project approval.</p>';
        echo '<a href="#">Read more</a>';
        echo '</div>';
    echo '</div>';

    echo '<div class="sf-add-to-cart-infobox">';
        echo '<i class="fa-regular fa-circle-question"></i>';
        echo '<div class="desc">';
        echo '<h5>How to place an order?</h5>';
        echo '<p>See the detailed step-by-step process for placing an order in our store.</p>';
        echo '<a href="#">Read more</a>';
        echo '</div>';
    echo '</div>';

}
add_action( 'woocommerce_after_add_to_cart_button', 'sf_add_to_cart_info_boxes', 25 );


Enter fullscreen mode Exit fullscreen mode

Read full article: WooCommerce Info Boxes under Add to Cart
WordPress Snippets

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please show some love ❤️ or share a kind word in the comments if you found this useful!

Got it!