Hello,
I need to put classes ‘price’ and ‘cart’ into a new class. I need to add border around these two classes, so maybe adding them into a new class could solve the problem.
I have tried to make it by my own, I have added a class before and after add to cart button (filled red rectangle in the image), but that’s not the result I would expected. Maybe the addition of class’s opening tag before ‘price’ and class’s close tag after ‘cart’ could solve my problem.
To clarify, I would need to add class’s open tag before ‘price’ class and class’s close tag after ‘cart’ class – please see the image.
Best Regards
—————————-
I have tried this code, but it doesn’t do what I need to:
add_action( 'woocommerce_before_add_to_cart_button', 'add_content_before_addtocart_button_func' );
function add_content_before_addtocart_button_func() {
// Echo content.
echo '<span class="classname">';
}
add_action( 'woocommerce_after_add_to_cart_button', 'add_content_after_addtocart_button_func' );
function add_content_after_addtocart_button_func() {
// Echo content.
echo '</span>';
}
Attachments:
You must be
logged in to view attached files.