Yazmin Yazmin - 10 months ago 102
PHP Question

WooCommerce Show Cart Items on Checkout Page

I'm working on this website where I was asked to add a list of the cart items to the checkout page. I decided to add the


shortcode to the checkout page, above the


shortcode and simply use CSS to hide the "Proceed to Checkout ->" button in the cart on the checkout page.

However, this has introduced a new problem. Now when shipping is selected on the Checkout page, it defaults to whatever shipping was set for the cart on the Cart page... even when new shipping is selected on the checkout page.

Clearly, this was not the way to add the cart output to the checkout page.

Is there a shortcode just to show the cart items themselves?

What do I need to edit to show the cart items on the checkout page?

Answer Source

I'm going to answer my own question, since I solved it with some additional poking around. Hopefully it will help someone else later down the road.

I didn't find a shortcode to to simply add the cart to the top of the checkout page. I had to edit the template file directly.

So, I copied:




to make my edits to that file directly so I wouldn't lose them when WooCommerce was upgraded. I then copied the form code from:


And pasted it in the file I copied to my theme directory:


where I wanted the form to appear.

There may be more elegant ways, but this fixed my issue.