Skip to content
Advertisement

How to modify woocommerce_before_cart action

I’m trying to make my woocommerce cart template display as a full 12 column layout.

The existing layout is using bootstrap’s col-sm-8 column. I need to change it to col-sm-12.

JavaScript

I checked out the relevant woo-templates shown here, and copied the cart.php template into my theme to override. However, it looks like I need to modify the woocommerce_before_cart action to change the <main> layout and insert the col-sm-12 class. I found the relevant actions on this woocommerce page.

I can see from the cart.php template the action called before the <form> element as shown below:

JavaScript

I’m new to php, my question is how do I modify the output of this action so I can change the layout to 12 columns?

Advertisement

Answer

Woocommerce inserts the content in cart.php into page.php in the root of your theme. 🙂

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement