• Resolved Alex R

    (@apollolux)


    Hello! I tried searching for a resolution for this issue that did not involve creating or modifying a child theme, but so far could not find such.

    For a vanilla WooCommerce installation on a WordPress using a default theme like Twenty Twenty, at least four pages are created or assigned to WooCommerce-specific use during setup: Shop (main page with product grid expected to be the hub), Cart, Checkout, and My Account. There also exists default templates within Woo for shop things like single product detail pages such as woocommerce/templates/single-product.php . While Cart, Checkout, and My Account simply create regular pages that contain Woo shortcodes for embedding the specific functionalities, Shop and single product pages instead use Woo’s built-in templates rather than leverage the active theme’s templates or checking for theme-specific template existence and falling back to built-in if missing, and do not leverage its existing theme-checking functionality to more closely replicate what the themes actually do for template parts and such.

    Using a default theme like Twenty Twenty, the result is some content (all non-Woo and some Woo) with proper loading of Twenty Twenty’s template parts and some content (only Woo) only loading Twenty Twenty’s header (get_header) and footer (get_footer) without realizing that Twenty Twenty puts its footer widgets and menu loading (get_template_part( 'template-parts/footer-menus-widgets' );) in the page templates, index.php, and singular.php, rather than in footer.php . Twenty Twenty’s index.php in particular also tries to load multiple other template parts that Woo’s shop page template doesn’t account for. The Shop page in particular also no longer has the Template dropdown option in the Page Attributes meta box even though Twenty Twenty is still the active theme.

    For a previous semi-recent topic on this issue, Footer widgets – Twenty Twenty, the prevailing recommendation was to have a child theme with a modified footer to check is_woocommerce and include the relevant template part. While this is a short term solution to the problem of WooCommerce-specific pages missing entire template parts, it does not solve the problem of removing Template from Page Attributes on a Woo-specific page like Shop and especially on a default theme like Twenty Twenty should not be necessary, and subjectively a plugin preferably should not remove functionality related to theming unless as a last resort and absolutely necessary.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support RK a11n

    (@riaanknoetze)

    Hi there,

    Thanks for the breakdown of the template flow although I’m a little unsure of the question here: What exactly are you looking for help on?

    Thread Starter Alex R

    (@apollolux)

    I thought I was basically giving a bug report to update WooCommerce’s built-in templates to better utilize its checking of default theme usage in order to conditionally add the missing template parts; is this not the place to submit such a bug report?

    Plugin Support Missy a11n

    (@m155y5)

    Automattic Happiness Engineer

    Hi @apollolux

    If you’d like to submit a bug report for the core WooCommerce plugin, you can do so via the WooCommerce Github Repository here.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Missing template parts on default themes’ is closed to new replies.