• Resolved johnfrl_15

    (@johnfrl_15)


    I’ve developed a custom theme – firstly I make a lot of these, many of which have Woocommerce installed and never had this issue before.

    So the /shop page displays all products fine (archive-products.php), click one for more info and it goes to the single product page (single-product.php) Now from here is where I have an issue. If I add an item to the basket and click ‘view basket’, it directs to the ‘Cart’ page which is fine but it isn’t loading the right template. It should be loading /templates/cart/cart.php but seems to be loading my homepage instead (index.php) so all I get is one div column (as my homepage dynamically picks up products) but there is no sign of the woo products at all so for some reason the cart is ignoring the template it should use and is looking at my index.php instead.

    The settings are all correct under Woocommerce > Settings, I have the cart set to be the ‘cart’ page and checkout set to be the ”checkout’ page. Note too that also the checkout won’t load, again it uses the index.php template in error.

    So in a nutshell, the cart and checkout pages both ignore the default templates and instead load my index.php.

    Has anyone seen this before or could work out why this is happening? I accept that it is definitely something to do with my theme as if I switch to the 2015 theme, the cart displays correctly but what could it be?

    This site now is pretty much identical to another clients I just finished last week so the woocommerce side on both should be exactly the same yet the previous site didn’t have these issues.

    https://wordpress.org/plugins/woocommerce/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    Cart and Checkout are regular pages. They should use page.php in your theme, and index.php if that does not exist.

    Thread Starter johnfrl_15

    (@johnfrl_15)

    Ok, this makes sense but I’m still lost. I assumed that as I can override the cart layout with my own cart.php in a /woocommerce folder in my root then that was the cart template but clearly not and thanks for clearing that up.

    I don’t have a page.php, just an index.php (this may be against the laws of WordPress perhaps but I have just never used one – bad practice perhaps)

    I do get that from what you’re saying, what SHOULD happen is when I click ‘View basket’, it would load the index.php template then populate the page content with the basket contents. This is what isn’t happening. It is loading the index.php but there are no sign of any products, prices or anything basket related. If I change the theme to one of the built in defaults then visit /cart my basket shows up and all it’s contents.

    My index.php is pretty basic, a grid of posts but clearly as it works fine on other themes, that suggests the issue lies with my index.php template, would you agree? (which is obviously for me to go away and sort)

    Thread Starter johnfrl_15

    (@johnfrl_15)

    Update on this, it is my template after all. I created a new template as a test which was simply a full width container, and applied this to the cart page and the cart now shows fine.

    Thanks for the reply though.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Default cart template not recognised?’ is closed to new replies.