• Resolved farquhc

    (@farquhc)


    Hey everyone, I’m running into 2 issues, which I suspect are related. I have been using WooCommerce to give the WordPress project I’m working on e-commerce functionality, obviously. I’m using a child theme that extends a parent theme we developed. This is the first time we’ve used WooCommerce with any of the sites we’ve developed with our parent theme, so WooCommerce hasn’t been added anywhere else.

    On the WooCommerce Status page I am seeing a bunch of notices that say I’m using outdated templates. A bunch, actually. However, I have only modified the thankyou.php template and that’s it. What gets a little weird is the templates are referring to the Parent theme’s directory and not the child theme. For example, one of the outdated template messages is for macsites-theme/woocommerce/single-product/review-rating.php. “macsites-theme” is the name of our parent theme, so shouldn’t it say “offcampus-theme” which is the name of the child theme? All of the missing template file errors are looking for the same directory. I have 20 of those warnings and like I said earlier, I’ve only edited one WooCommerce plugin file and it’s thankyou.php.

    The other error is around the cart and probably related. I am only allowing users to add 1 item to their cart. Once in a while the user’s cart will say that there are 2 items in their cart, but only be charging for the item they added. So the user could’ve added a Basic package to the cart, but the Premium package will show as added. The cart subtotal would reflect the price of both packages, but the total would only show the price of the package they actually added.

    Any ideas on these 2 issues?

    • This topic was modified 6 years, 10 months ago by farquhc.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The sequence of execution is that WooCommerce will look for its page templates in the child theme first. If it doesn’t find them (as will be the case for all but one template), it will look in the parent theme.

    I’m not clear from your post whether the templates are missing or outdated, or some of each. If missing, reinstall the theme using a fresh download.

    If outdated, you’ll need to ensure you are using the latest version of your theme. If it is the latest version, check when it came out. Sometimes themes get abandoned or neglected by their authors. The latest version would normally have been published within the last few months.

    Regarding the second point, this sounds like some custom code that’s in play, not WooCommerce code? Forum members don’t have access to custom code, so you’ll need to refer to the relevant developer.

    Keep your theme up to date is one of the things you ahve to do. For the outdated templates: Just get the latest version of woocommerce and then upload the files via ftp to your server, that should work. Or you download the files which are outdatet and just replace the verison with the current version of the tempalte which is
    * @see https://docs.woocommerce.com/document/template-structure/
    * @package WooCommerce/Templates
    * @version 3.5.0
    For the cart problem: we had this issue for a while to, and this one here works for us. This just allows the customer one item in cart. If the customer adds a second one, it will override the first

    function woo_cart_ensure_only_one_item( $cart_contents ) {
        return array( end( $cart_contents ) );
    }
    add_filter( 'woocommerce_cart_contents_changed', 'woo_cart_ensure_only_one_item' );
    Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Howdy!

    We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please start a new thread.

    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Outdated Templates Error’ is closed to new replies.