Home Forums WoodMart support forum WooCommerce added bad button on thankyou page

WooCommerce added bad button on thankyou page

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #645043

    FreeRiderNSK
    Participant

    Hello!
    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.
    #645131

    Artem Temos
    Keymaster

    Hello,

    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

    #645136

    FreeRiderNSK
    Participant

    I 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.
    #645139

    Artem Temos
    Keymaster

    Could you please test how it works with the default WordPress theme first to see if our theme affects this button somehow?

    #645143

    FreeRiderNSK
    Participant

    Your 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.

    #645431

    Artem Temos
    Keymaster

    In 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.

    #645531

    FreeRiderNSK
    Participant

    I’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?

Viewing 7 posts - 1 through 7 (of 7 total)