Hi @xabdu
I’m sorry, but I’m not sure if I understood your question.
Can you provide us with more details, so we can understand what exact you want to achieve?
Thread Starter
xabdu
(@xabdu)
Hi @hegenberg
I want to make the order again button to have another link.
The buttons appear on the thank you page.
So, when someone clicks on it redirects him to that page instead of the cart.
-
This reply was modified 4 years, 2 months ago by
xabdu.
-
This reply was modified 4 years, 2 months ago by
xabdu.
Hi @xabdu,
Thanks so much for the clarification.
You can use the template override method to override the Order again button’s template which is under the \wp-content\plugins\woocommerce\templates\order\order-again.php file.
Here is how to Template structure & Overriding templates via a theme.
On this line, you can remove the variable $order_again_url and add your own URL. For example testing locally I was able to redirect to my website’s homepage.
If you require more help with the actual coding, we’d recommend hiring a developer or one of the customization experts listed at https://woocommerce.com/customizations/.
I hope this information helps.
Thread Starter
xabdu
(@xabdu)
Thank you @rainfallnixfig
but i saw that you wrote
<a href="<?php echo esc_url( home_url ('/') ); ?>" class="button"><?php esc_html_e( 'Order again', 'woocommerce' ); ?></a>
can I replace
( home_url ('/') )
to normal link? because I am redirecting to ( https://******.****/dashboard/enrolled-courses/ )
so if I did this, it will work?
<a href="<?php echo esc_url( home_url ('/dashboard/enrolled-courses/') ); ?>" class="button"><?php esc_html_e( 'Order again', 'woocommerce' ); ?></a>
-
This reply was modified 4 years, 2 months ago by
xabdu.
Hi @xabdu,
You can enter an URL there like in this example. Tested and working on my local installation and it redirects the Order again button to Google.
Support for this type of customization is limited on this forum so if you need further help I recommend getting in touch with customization experts using the link above or using the available channels for developers like the WooCommerce Facebook Community group or the #developers channel of the WooCommerce Community Slack.
Cheers.
Thread Starter
xabdu
(@xabdu)
I did this and it worked
<a href="<?php echo esc_url( home_url ('/dashboard/enrolled-courses/') ); ?>" class="button"><?php esc_html_e( 'Order again', 'woocommerce' ); ?></a>
Great to hear. Thanks for letting us know that worked!
If you have any other questions, please feel free to create a new topic.
Regards!