Reply 335237 to: How to add custom field and logic in Cart page?

Avatar: Rose Tyler
Rose Tyler
Support staff
September 28, 2022 at 07:32

Hello,

It is good to say we have lately implemented a few types of Advanced Cart/Checkout pages which you may check in Theme Options -> WooCommerce -> Cart/Checkout Layout.

According to the fact you want to rewrite cart.php file you may do it in a next way:
Go to Parent (XStore) theme -> WooCommerce folder
-> cart -> cart.php (copy file) and paste it in the same path but in your child-theme (XStore-child theme -> WooCommerce folder
-> cart -> cart.php (copied file)). In the file of your child theme you may edit it to your needs (if you do any changes in your child-theme it does not affect to theme updates and your changes will be in safe)

WordPress docs: https://developer.wordpress.org/themes/advanced-topics/child-themes/

All hooks and filters you may find directly in the file you want to use for improving. Example: https://prnt.sc/5Pae2LNutPG5 (cart.php)

WordPress docs: https://developer.wordpress.org/plugins/hooks/

As you know we don’t provide customization service but we can direct you in the right way of customization 🙂
We found a topic where were asked a similar question as you want to have too -> https://wordpress.org/support/topic/creating-custom-field-on-cart-page/. We would recommend you check the answer and try to implement it on your side.

It is asked in the WooCommerce plugin’s authors so you may also submit a topic on their forum.

Regards

Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.