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_content
but can't quite figure it out.
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_content
but can't quite figure it out.
1 Answer
Reset to default -1Seems like jQuery is best for this case. Mainly answering for myself in case I'll need it again in the future:
<head>
<script src="https://ajax.googleapis/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("#this_comes_before").insertBefore("#wc_checkout_add_ons");
});
</script>
</head>
<body>
<div id="wc_checkout_add_ons">stuff</div>
<div id="this_comes_before">something</div>
</body>
Edit for future me:
Use this instead you lazy asshole...
add_action( 'woocommerce_checkout_after_customer_details', 'test99' );
function test99() {
echo "your shit";
}