• Resolved vlsbilodeau

    (@vlsbilodeau)


    I inherited a custom theme and tested deactivating to confirm that my issue is with the theme. The shop, cart, and checkout pages are okay, but the product detail page displays blank. What parent page from the theme does the single-product.php use?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The WooCommerce file is:
    wp-content/plugins/woocommerce/templates/content-single-product.php

    If your theme overrides this file, the override will be at:
    wp-content/themes/your-theme-name/woocommerce/content-single-product.php

    In either case, that file makes calls to several other template files for the individual parts of the page. In turn, these other files will call functions in various WooCommerce includes. Its likely you’ll need PHP skills or a developer to track down the problem.

    Have you tried looking at the console in Google Chrome? Often times this will give you a hint on what is causing it.

    Thread Starter vlsbilodeau

    (@vlsbilodeau)

    I figured out where the issue stems from. The custom theme single post template points at another custom template which is nothing like the standard theme structure and overwrites everything for some work around to display posts differently, so woocommerce doesn’t work. Is there a way to call out an if statement that says if the post is a woocommerce post then do this instead?

    Like:
    if have_posts do this
    if have_posts-woocommerce do this

    I’ll hunt around the internet for an answer too.

    In case you’re still looking for this, there is a conditional tag you can use to check and see if this is a WooCommerce product being viewed.

    
    is_singular( 'product' ); {
    
    // run your code here if it's a product
    
    }
    

    If you’re curious about the is_singular() conditional tag you can read more about it at https://developer.ww.wp.xz.cn/reference/functions/is_singular/

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

The topic ‘Theme Conflict’ is closed to new replies.