My Orders Page – Change Buttons Text to Icon instead
-
Hello there!
I would like to know if it’s possible to change the buttons text for icons instead.
I would love to use images (icons) instead of the buttons text.
I tried adding PHP code and didn’t find out how to do. I have added an image to show the buttons that I’m doing reference to.
Also, below is the code that I tried using for the “View” button. It didn’t work for me.
function customize_view_button_icon_with_link( $actions, $order ) { // Change the 'View' button to an icon image with a link for all orders $icon_url = 'https://boutiquebonmarche.ca/wp-content/z.My%20Files/Icons/Eye-Icon-30x30.png'; // Update with your image URL // Output the HTML directly echo '<style>.woocommerce-orders-table__cell-order-actions a.view img { display: none; }</style>'; echo '<a href="' . esc_url( $order->get_view_order_url() ) . '" class="button view"><img src="' . esc_url( $icon_url ) . '" alt="View"></a>'; } add_action( 'woocommerce_my_account_my_orders_column_order-actions', 'customize_view_button_icon_with_link', 10, 2 );
Please let me know if this is possible to do! Eventually, I would love to change every button with an icon instead.
Thank you! ??
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘My Orders Page – Change Buttons Text to Icon instead’ is closed to new replies.