In the Woocommerce plugin for Wordpress, I want to change the html block markup and text headers. How and where to look?

I searched this way - I found the name of the styles in the inspector, and used the search in Wordpress source files using the notepad ++ editor. In PHP files I changed the text, the lines, then I uploaded all this for test hosting. Moreover, in most cases nothing happened at all, sometimes it was possible to “break” the site and had to roll back.

    1 answer 1

    Translation of documentation " Template Structure + Overriding Templates via a Theme "

    WooCommerce template files contain markup for the client interface and the HTML of your store. After reviewing their contents, you can see that all these files contain hooks that allow you to add or move content without having to edit these files directly. This method of editing the content without changing the source files avoids the problems associated with updating the system.

    Template files are located in the /woocommerce/templates/ folder.

    You can see the folder structure and file contents for version v2.5.0 here .
    A complete list of WooCommerce versions and their respective template files can be found at the link to the documentation at the very beginning of the answer.

    To avoid problems with updating WooCommerce, template files should be modified by overriding them.

    Copy the template files of the appropriate version of WooCommerce inside your theme into the /woocommerce , keeping the original folder structure, excluding the /templates/ subfolder.

    For example, to override order notifications for an administrator, copy

     woocommerce/templates/emails/admin-new-order.php 

    to folder

     ваша_тема/woocommerce/emails/admin-new-order.php 

    The copied file now overrides the original one.

    Attention : if your topic has a file woocommerce.php ,
    you can not override woocommerce/archive-product.php
    file within your theme because woocommerce.php
    takes precedence over all other template files. This is done to prevent problems with the display of information.

    Do not edit the template files directly, as all changes you have made will be lost after updating the system.

    Update

    The search form template is located in the folder.

     woocommerce/templates/product-searchform.php 

    Copy it to

     ваша_тема/woocommerce/product-searchform.php 

    And change the way you want.

    • Example: here my test site supershop.imperiasoblazna.ru should be replaced in the search bar "Enter kewords" with something else and replaced with the inscription in the button "search" with a picture. In the child theme I create the woocommerce folder, put the file product-searchform.php into it, make changes to it and nothing happens - mxd
    • one
      @mxd, my answer already contained the information you need. However, I have specified a specific file that you need to copy into your theme and edit. Do not forget that WooCommerce is translated into Russian. - VenZell
    • I copied the file to my theme in the folder. I erased everything inside the form. Filled in on hosting - the form stands still and does not think to change. What am I doing wrong? - mxd
    • I tried to change other files according to the scheme you specified: everything changes normally. But with the form something does not work. - mxd
    • @mxd, The file may have been redefined in the theme itself. Do a search for the phrase "Enter keywords" in the *.php and *.html files. - VenZell