I bought the "Woocommere Checkout Add-Ons" Plugin, which adds upsells to the checkout page - but it only allows to place text after the upsell checkbox.

So I got the idea to add an image with some styled text just above that upsell checkbox, which is wrapped in <div id="wc_checkout_add_ons">.

How would I do this? I read about the_contentbut can't quite figure it out.


Seems like jQuery is best for this case. Mainly answering for myself in case I'll need it again in the future:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<div id="wc_checkout_add_ons">stuff</div>

<div id="this_comes_before">something</div>


Edit for future me:

Use this instead you lazy asshole...

add_action( 'woocommerce_checkout_after_customer_details', 'test99' );
function test99() {
echo "your shit";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.