Support » Plugins and Hacks » [woocommerce] Override theme files doesn't work

  • cinematic

    (@cinematic)


    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)

Viewing 11 replies - 1 through 11 (of 11 total)
  • Overriding theme files isn’t working for me either.

    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.

    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.

    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!

    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.

    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/

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

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

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

    It works this way 😉

    SigurdSvela

    (@sigurdsvela)

    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?

    Alex

    (@netxm)

    @shnalla, you’re right it works if you place template files in “woocommerce” directory

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[woocommerce] Override theme files doesn't work’ is closed to new replies.