0
votes

I am setting up a woocommerce shop and I want to add a new page between the shopping cart and the final payment. I currently have my cart page (cart. php), and for example the finalize purchase button, be "next", on this new page I want to add a number of functions and the finalize purchase button to make the final payment.

By default the configuration is: product page -> shopping cart -> payment_final. My idea is to add one more page to this cycle: product page -> shopping cart -> My_page_with_other_options -> final payment.

What files would I have to touch to modify the purchase cycle?

A greeting and thank you in advance.

1
you can change the checkout button url to My_page_with_other_options page urlVel

1 Answers

0
votes

Try like this

add_action( 'woocommerce_widget_shopping_cart_buttons', function(){
    // Removing Buttons
    remove_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_proceed_to_checkout', 20 );

    // Adding customized Buttons
    add_action( 'woocommerce_widget_shopping_cart_buttons', 'custom_widget_shopping_cart_proceed_to_checkout', 20 );
}, 1 );



// Custom Checkout button
function custom_widget_shopping_cart_proceed_to_checkout() {   
    $custom_link = 'your page url'; 
    echo '<a href="' . esc_url( $custom_link ) . '" class="button checkout wc-forward">' . esc_html__( 'Checkout', 'woocommerce' ) . '</a>';
}

Change cart and checkout button links on WooCommerce mini cart widget