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

Sentry blog image

How I fixed 20 seconds of lag for every user in just 20 minutes.

Our AI agent was running 10-20 seconds slower than it should, impacting both our own developers and our early adopters. See how I used Sentry Profiling to fix it in record time.

Read more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay