0

I'm working on an e-commerce site with a custom theme and I have been trying to integrate it with woocommerece, the shop and product page display just fine and work the way they should but when I go to the basket/cart page, it's blank the HTML is exactly this

<html>
  <head></head>
  <body></body>
</html>

Things I've checked/done so far

  • Basket page is present (generated by woocommerce).
  • Basket page has [woocommerce_cart] short code.
  • Woocommerce is configured to use this page.
  • I changed my theme to twentytwenty and the basket page shows up just fine but if I revert to my theme, the blank page situation reappears
  • If I add page-basket.php to my theme and add some content to it like a header with hello in it, it shows up just fine
  • Tried deleting the basket page and regenerating it but no dice.
  • Turned on debug logs but nothing is there.
  • Removed the woocommerce folder under my theme and reload page but still nothing.

I don't know if this is relevant but I copied all of the contents of the templates folder under the woocommerce plugin into MYTHEME/woocommerce. I also copied the same folder into the twentytwenty theme but it still works.

I'm on woocommerce 4.0.1

I have no idea what this could be and I'm stumped, any suggestions would be welcome

EDIT: I've also looked at the twentytwenty source and I cannot see how they are implementing woocommerce support, there's no reference to woocommerce at all.

EDIT: I also have woocommerce support in my theme

function add_woocommerce_support()
{
   add_theme_support('woocommerce');
}

add_action('after_setup_theme', 'add_woocommerce_support');
2
  • did you add add_theme_support( 'woocommerce' ); in after_setup_theme action hook in your theme's functions.php file ? – Chetan Vaghela Apr 13 '20 at 12:02
  • Yes I have, I'll add that to the question, I've also discovered that basket is not the only page that is affected by this issue – Sangoma Apr 13 '20 at 12:04
0

I ended up reintroducing my page-basket.php to my project and adding the line below to it and everything worked out just fone.

<?php echo do_shortcode("[woocommerce_cart]"); ?>

I don't know if this is the correct way to do things but it works

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.