WordPress.org

Ready to get started?Download WordPress

Forums

[woocommerce] Override theme files doesn't work (12 posts)

  1. cinematic
    Member
    Posted 2 years ago #

    Hi experts,
    did anybody succeed overwriting woocommerce files in a subfolder via the new structure /wp-content/themes/my-theme/woocommerce/subfolder/file.php ?

    I can override files from the woocommerce root folder by placing them in my theme directory directly (not in a woocommerce subfolder as the theme documentary is suggesting). The new template structure from the theme documentary doesn't seem to work.
    http://www.woothemes.com/woocommerce-docs/codex/template-structure/
    Any ideas how to solve this? I need to alter price.php (no hook available).
    I need to add some notes regarding vat etc. (legal requirements in my country)

  2. allancole
    Member
    Posted 2 years ago #

    Overriding theme files isn’t working for me either.

  3. matt_fisher
    Member
    Posted 2 years ago #

    Same issue here-- doesn't seem to matter where I put my customized woocommerce templates. I've tried emulating the same folder/file structure as in the woocommerce folder in my theme and also putting them in the root of my theme. No effect at all.

  4. dustylavender
    Member
    Posted 2 years ago #

    This has worked for me for the most part.

    Take the folder 'templates' from the woocommerce plug-in and add them to the theme folder in 'woocommerce'. It should have the folders; cart, checkout, emails, etc. with a few files outside those; archive-product.php, loop-product-cats.php, loop-shop.php, etc.

    So, once you add all the files you will need to edit; /wp-content/themes/your-theme/woocommerce/single-product/price.php

    Although, for some reason, when my client adds a new variable product, it uses the formatting from the plug-in folder and when I add a new variable product it uses the formatting from the theme/woocommerce folder.

  5. cinematic
    Member
    Posted 2 years ago #

    I just found this in the woocommerce forum

    4) today I made another change (single-product.php)
    original location:
    wp-content /plugins /woocommerce /templates /single-product.php

    5) BUT accidentally I placed the edited file to a wrong directory:
    wp-content /themes / child-theme /single-product.php
    AND guess what? it works !

    6) changed the directory again to another "wrong" one
    wp-content /themes / child-theme /woocommerce /single-product.php
    it works AGAIN !

    7) then place it to one directory down to the "right" one
    wp-content /themes / child-theme /woocommerce /templates /single-product.php

    at last it stops working !

    To summarize:
    * files are not working in the place where they should be.
    * but works in every other place except the right directory!

  6. cruxwireweb
    Member
    Posted 2 years ago #

    I'm glad to have found this, but I'm worried when this get fixed, my files that are in the wrong location won't be found anymore. I guess I'll do it both ways - the file in a folder where it will work, and the file in the place it "should" be.

  7. Zach "The Z Man" Abernathy
    Member
    Posted 2 years ago #

    According to the Woo Documentation, /your-theme /woocommerce /woocommerce-template-file.php is the correct setup. Notice "/template(s)" was not part of the mix.

    More info found here in their documentation under "Theming" > "Template Structure"
    http://wcdocs.woothemes.com/codex/template-structure/

  8. jnui
    Member
    Posted 1 year ago #

    Zach... you are correct, but it still does not work for me.

  9. Zach "The Z Man" Abernathy
    Member
    Posted 1 year ago #

    jnui, what does your folder structure look like? Is the theme containing the WooCommerce template updates active?

  10. shnalla
    Member
    Posted 1 year ago #

    Just put the content of the Template folder in your theme folder like this : youThemeName/Woocommerce/placeHereTheContentOfTemplateFolder

    It works this way ;)

  11. SigurdSvela
    Member
    Posted 1 year ago #

    I am having a problem overriding the shop templates. I Want to override the hole shop template. I managed to use it by removing the "Shop Base Page" from the settings page. But i need to use it by overriding instead. Does anyone have any ide what im doing wrong?

  12. Alex
    Member
    Posted 1 year ago #

    @shnalla, you're right it works if you place template files in "woocommerce" directory

Topic Closed

This topic has been closed to new replies.

About this Topic