Use tags in shipping labels
-
Hi Diego,
How can I use HTML tags (<a><br><small>) in Shipping labels?
I am able to add them and see them on the WooCommerce shipping settings but then they disappear on the fluid checkout.
As an alternative I tried to add them through jQuery but elements get reloaded a few seconds after page was loaded (which is why I’m using the setTimeout function) and also when changing the shipping method selection so the elements added by jQuery disappear and can’t seem to find the correct trigger.
This is the code that I’m using
add_action('woocommerce_after_checkout_form', 'add_link_to_shipping');
function add_link_to_shipping() {
if ( is_checkout() ) {
?>
<script>
jQuery(document).ready(function ($) {
setTimeout(function() {
$("label[for='shipping_method_0_local_pickup3'] .shipping-method__option-text").append(jQuery("<a target='_blank'>Ver en Google Maps</a>"));
}, 2000);
});
</script><?php
}
}Of course, using HTML tags would be the best solution for me.
Looking fwd to your comments.
Best!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.