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

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay