- This topic has 5 replies, 3 voices, and was last updated 4 months, 3 weeks ago by Tom.
October 15, 2020 at 9:35 am #1490745Matt
Hello, hopefully simple request.
On Adding to cart, the cart panel shows up correctly. There is a checkout button that also is there.
Can you help change that “Checkout” button to go to the Cart (and say View Cart) instead of the checkout page on the cart panel?
We are requiring coupon codes to be entered in the cart, so they need to go there first.
Thanks for the great theme, we have used it for years!October 15, 2020 at 11:40 am #1490905LeoStaffCustomer Support
This might be something you will need to check with WooCommerce support team as the theme only adds appearance options to WooCommerce and does not alter the functionality.
Can you link me to the page in question so I can confirm that?
Thanks 🙂October 15, 2020 at 12:09 pm #1490925Matt
The code for it is in your functions.php file.
Lines 1264-1266 of /functions/functions.php
<div class="checkout"> <a href="<?php echo wc_get_checkout_url(); ?>" class="button"><?php _e( 'Checkout', 'gp-premium' ); ?></a> </div>
Changing it to
<div class="checkout"> <a href="<?php echo wc_get_cart_url(); ?>" class="button"><?php _e( 'View Cart', 'gp-premium' ); ?></a> </div>
Creates the functionality I prefer. I just have no clue how to do that via filter/hook.
Thanks 🙂October 15, 2020 at 12:15 pm #1490934LeoStaffCustomer Support
Ok so all you wanted to do is to change the Checkout text and not the link?October 15, 2020 at 12:30 pm #1490957Matt
I must not be explaining myself well, I am sorry.
In the Generatepress theme customization option, you can layout, then woocommerce. In there, there is an option for “Display cart panel on add to cart”
When you add an item to the cart, an ajax header slides down, and gives you the option to “continue shopping”, Notify you the item was added to your cart, cart quantity, and cart totals. Then there is a button that says “Checkout”.
I want only that button to say “View Cart”, and that to go to the cart. I dont want Checkout, nor the URL to checkout. The regular cart page is fine, and the regular checkout process is fine. Only on this “cart panel”
The code mentioned above makes it look and function they way I want it to. All said and done it looks like this.
This is the only button/text I want changed. Everywhere else its fine. Thanks for all your help!October 15, 2020 at 2:41 pm #1491105TomLead DeveloperLead Developer
Usually I add filters and hooks everywhere, but I didn’t in this case for some reason.
I’ve made a note to add this in 1.13.0 – feel free to give me a shout in this thread once 1.13.0-alpha.1 is out and I’ll help with the filter 🙂
- You must be logged in to reply to this topic.