Home › Forums › WoodMart support forum › WooCommerce added bad button on thankyou page
WooCommerce added bad button on thankyou page
- This topic has 6 replies, 2 voices, and was last updated 34 minutes ago by
FreeRiderNSK.
-
AuthorPosts
-
March 12, 2025 at 10:11 am #645043
FreeRiderNSKParticipantHello!
WooCommerce added a button to the thankyou page. It wasn’t there before. This is from version 9.6.0.
This button is not logical for guest orders, since the link does not work if the user is not authorized.
Moreover, this button is not styled.
I know that I can remove it through a child theme, but it wouldn’t hurt you to make changes in the theme update too.
Will you remove it in future updates?woocommerce\templates\order\order-details.php
$order_items = $order->get_items( apply_filters( 'woocommerce_purchase_order_item_types', 'line_item' ) ); $show_purchase_note = $order->has_status( apply_filters( 'woocommerce_purchase_note_order_statuses', array( 'completed', 'processing' ) ) ); $downloads = $order->get_downloadable_items(); $actions = array_filter( wc_get_account_orders_actions( $order ), function ( $action ) { return 'View' !== $action['name']; } );
<?php if ( ! empty( $actions ) ) : ?> <tfoot> <tr> <th class="order-actions--heading"><?php esc_html_e( 'Actions', 'woocommerce' ); ?>:</th> <td> <?php $wp_button_class = wc_wp_theme_get_element_class_name( 'button' ) ? ' ' . wc_wp_theme_get_element_class_name( 'button' ) : ''; foreach ( $actions as $key => $action ) { // phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited if ( empty( $action['aria-label'] ) ) { // Generate the aria-label based on the action name. /* translators: %1$s Action name, %2$s Order number. */ $action_aria_label = sprintf( __( '%1$s order number %2$s', 'woocommerce' ), $action['name'], $order->get_order_number() ); } else { $action_aria_label = $action['aria-label']; } echo '<a href="' . esc_url( $action['url'] ) . '" class="woocommerce-button' . esc_attr( $wp_button_class ) . ' button ' . sanitize_html_class( $key ) . ' order-actions-button " aria-label="' . esc_attr( $action_aria_label ) . '">' . esc_html( $action['name'] ) . '</a>'; unset( $action_aria_label ); } ?> </td> </tr> </tfoot> <?php endif ?>
-
This topic was modified 1 day, 3 hours ago by
FreeRiderNSK.
Attachments:
You must be logged in to view attached files.March 12, 2025 at 11:50 am #645131
Artem TemosKeymasterHello,
Please test how this button works with the default WordPress theme first.
As for the style, it looks like a default theme button. If you want to make it have our primary color, let us know so we can give you a custom CSS code.Kind Regards
March 12, 2025 at 11:53 am #645136
FreeRiderNSKParticipantI don’t need CSS.
They added it in the update WooCommerce, but it’s not needed.
If the order was left by a guest, the link won’t lead anywhere!
It needs to be removed by default.
Make it the way it was before.I know that I can remove it through a child theme, but it wouldn’t hurt you to make changes in the theme update too.
Will you remove it in future updates?-
This reply was modified 1 day, 1 hour ago by
FreeRiderNSK.
March 12, 2025 at 11:56 am #645139
Artem TemosKeymasterCould you please test how it works with the default WordPress theme first to see if our theme affects this button somehow?
March 12, 2025 at 11:59 am #645143
FreeRiderNSKParticipantYour theme does not affect this button in any way.
You simply do not override this template. (woocommerce\templates\order\order-details.php)
WooCommerce added it in the 9.6.0 plugin update.
It was not there before, I am just telling you that they made such a change, and it needs to be fixed.March 13, 2025 at 10:14 am #645431
Artem TemosKeymasterIn this case, we will not remove this button since it is a part of the WooCommerce functionality. You can override this template in the child theme and remove it on your website if you want.
March 13, 2025 at 12:43 pm #645531
FreeRiderNSKParticipantI’ll try to convince you anyway.
Look, if guest orders are enabled in the store, the link is useless. It leads to the authorization page. But if the user is not registered, how can he authorize himself on the site?
This is not logical!
I suggest adding an option to disable this button in the theme settings…As for the styling of the button, this definitely needs to be done.
What do you think about this?
-
This topic was modified 1 day, 3 hours ago by
-
AuthorPosts
- You must be logged in to create new topics. Login / Register