My Courses > CustomizeWoo > Module 4 > Lesson 07: Cart Page: ADD Content
Cart Page: ADD Content
This is how to add content to the cart page by using the visual hook guide. Always start from displaying some simple “TEXT” in the correct position, and then make your functions more complex. A little win is better than hours spent troubleshooting.
Video
Please note: English captions are enabled by default (click on “CC” in the video player to disable). Also, you can click on the “gear” icon to manage quality and playback speed. Enjoy!
If you joined already, please log in.
Otherwise, here is why you should join the Club.
Useful Links
WooCommerce Visual Hook Guide: Cart Page
Related Snippets
WooCommerce: Add Content to Empty Cart Page
WooCommerce: Display Categories Under Product Name @ Cart
WooCommerce: Display Weight @ Cart & Checkout
WooCommerce: βYou Only Need $$$ to Get Free Shipping!β @ Cart
Hello Rodolfo,
How could we change “Proceed to checkout” button text on the cart, based on the product category? Let’s suppose there is only a product category on the cart, not more. Is it possible?
Thank you!
Of course, but you should watch https://www.businessbloomer.com/lesson/cuwm5l05/ (so you can find the correct “filter” and not an “action” in this case) and then https://www.businessbloomer.com/lesson/cuwm5l02/ (so you can apply “conditional logic”). Let me know how it goes!
Hello Rodolfo,
I was able to change the βProceed to checkoutβ button text (and other strings) on the cart page for a specific product category. But I was not able to imagine where to insert conditionals if another product category is in the cart.
Here is the code snippet I used:
Please give me a hint where should I include in the function above the conditional for the product category “albums”. Where should I add:
and where should I add filter ‘gettext’ for the product category “albums”?
Tried a lot, but with no success. Please advice.
Ok Marcel, let’s see if I can help. First of all, use “elseif” and redefine $cat_in_cart because you have 2 categories now:
Second, take the function bbb_translate_woocommerce_strings() out of the nesting, and leave it on its own. Now you will need two of them:
All it’s left now is to call the right filters, so you’d do this in the existing function:
Does this help?
Hello Rodolfo,
Thank you very much. Until now, all worked as expected, except the fact I had to use this code:
instead of
Without “$translated, $untranslated, $domain” between brackets, the cart shows empty fields. I will dig more, to find why. Anyway, thank you very much!
Sorry yes you definitely need to use those 3 parameters