I'm trying to edit the checkout page, but can't find the template. What's the location inside plugin, of the file that has checkout fields?
-
1If you need to shift around the actual blocks, [this answer](https://wordpress.stackexchange.com/questions/188898/move-payment-options-at-checkout-in-woocommerce) is customizable to use different hooks (which, in turn, you can find in all the template files or the [WooCommerce hook documentation](https://docs.woocommerce.com/wc-apidocs/hook-docs.html)). – kontur Apr 05 '18 at 08:30
4 Answers
There are several php files that make up the checkout page.
wp-content/plugins/woocommerce/templates/checkout/
- cart-errors.php
- form-billing.php
- form-checkout.php
- form-coupon.php
- form-login.php
- form-pay.php
- form-shipping.php
- review-order.php
- thankyou.php
wp-content/plugins/woocommerce/templates/checkout/form-checkout.php is the main file.
[Template Structure from Woo Commerce Docs][1]
http://wcdocs.woothemes.com/codex/template-structure/
https://docs.woothemes.com/document/template-structure/
It's recommended that you copy the template folder It's recommended to copy over the template folder with the files you wish to change from the woocommerce plugin directory. Put it at the root of your theme and rename it to woocommerce (leaving the template folder intact in the plugin directory to allow for upgrading).

- 855
- 7
- 19
-
1So basically I can copy any file from WooCommerce into my theme's `woocommerce` directory, and the default file would be overwritten? Does this rule aplies to widgets, etc? – jOpacic Feb 12 '13 at 09:11
-
That is correct. I know for sure that it applies to the mini-cart widget (found in cart/mini-cart.php). I'm not sure about the others but am fairly certain that it does also apply to widgets (at least the default widgets.). It's important to follow the folder structure. (Use the link above and it will tell you all you need to know about structuring your theme). – Justin Beaudry Feb 12 '13 at 17:07
-
4One slight suggestion here is that it is actually not recommended that you copy the whole folder, and only the templates you actually change. This comes into play later when you upgrade woocommerce. – deweydb Jul 01 '14 at 02:08
-
@jOpacic Any file from the `woocommerce/templates` directory, not any file from the plugin folder. – kontur Apr 05 '18 at 08:31
-
Super helpful, thanks a lot! I was wondering which one holds all together (form-checkout.php it is)! – AlphaX Jan 28 '21 at 21:50
Be careful of your cart template which is by default the page.php
template from your general theme.
You can change the cart layout by changing the page.php
, or go to your WordPress cart page, edit and change the template for an other one.
Hope it helps, I just wasted 2h searching that.
There are a set of several templates that control the checkout page. They can be found in the WooCommerce plugin folder in templates/checkout.
You can put a woocommerce/templates/checkout folder inside your theme's folder and copy the templates you want to alter into it. Those will override the normal templates without altering the plugin itself. That way your changes won't get overwritten when WooCommerce is updated.

- 91
- 3
Note: I don't suggest to direct edit on plugin file because if by mistake you updated than you will lost all changes. so first copy /woocommerce/templates/ directory to your theme directory inside /theme/woocommerce/ and
Then you should edit files in theme/woocommerce/checkout/
Refer more: https://docs.woocommerce.com/document/template-structure/

- 6,939
- 3
- 40
- 50