0

I have a wordpress system with the plugin "WooCommerce". A few days ago I modified a php file: wp-content > plugins > WooCommerce > templates > single-product > price.php

after a update to the new WooCommerce version, my modification was override. How can I solve this problem, that my modification is still available after a update

Trombone0904
  • 4,132
  • 8
  • 51
  • 104
  • Please refer to this answer [How to override WooCommerce template files?](https://wordpress.stackexchange.com/questions/256088/how-to-override-woocommerce-template-files) – Bhautik Mar 15 '21 at 07:14

2 Answers2

1

Better option you need to create the child theme of your theme, then copy woocoomerce templates files paste in child theme directory. In future if you update themes and plugins your files and code will be safe inside theme.

  • I have a child theme and i copy the price.php into the folder. I can see it in Wordpress under "Themes Editor" in my child theme. But the modification, which I have done there will not shown :/ – Trombone0904 Mar 15 '21 at 07:12
0

You can override your templates within your child-theme.

In your case you can place your own price.php within child-theme/woocommerce/single-product/price.php

If you are not sure about the path structure, woocommerce adds the needed path within the desired php file.

In the woocommerce-plugin price.php you can see the following:

<?php
/**
* Single Product Price
*
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/price.php.
Kalti
  • 491
  • 8
  • 19