• Resolved rplinux

    (@rplinux)


    HI,

    single-product.php is not calling content-single-product.php
    when is try to remove sidebar by commenting get_sidebar on single-product.php it don’t remove from single product page. Even is commented wc_get_template_part( ‘content’, ‘single-product’ ); even then I got single product page. How is this possible.
    I just removed single-product.php still I am getting single product page.

    Then I comment get_sidebar in single.php of wordpress, you know what happens sidebar disappeared from single product page.

    It means content-single-product.php called through wordpress’s single.php, how is this possible to get content of single product page through wordpress’s single.php.

    Is it a Bug?

Viewing 9 replies - 1 through 9 (of 9 total)
  • Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    If you want to override templates, you need to declare WooCommerce theme support: https://github.com/woocommerce/woocommerce/wiki/Declaring-WooCommerce-support-in-themes

    Thread Starter rplinux

    (@rplinux)

    But this doesn’t solve my problem. specified above.

    Thread Starter rplinux

    (@rplinux)

    Tell me if I delete single-product.php from plugin then will content-single-product.php called or not.
    I think not.
    But when I deleted single-product.php file still content-single-product.php called and I can see single product page.

    This is working well in 3.2.6

    • This reply was modified 6 years, 9 months ago by rplinux.
    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Any template changes through your theme will be ignored until you define WC support. Deleting templates from the plugin itself is not recommended or supported.

    Thread Starter rplinux

    (@rplinux)

    I used storefront theme which is fully compatible with woocommerce still same problem exists.
    Is storefront don’t have woocommerce support?

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    Storefront is compatible and uses hooks and filters rather than template modifications.

    Thread Starter rplinux

    (@rplinux)

    @mikejolley I think think you didn’t understand the problem here.
    I said that I used storefront theme but still getting above bug it means it is the bug in new woocommerce release it is working in 3.2.6 fine but not in 3.3.1

    @mikejolley you said
    Any template changes through your theme will be ignored until you define WC support.

    So that i used storefront theme but still saw that content-single-product.php is called by single.php and not by single-product.php

    Now did you understand that. or still have confusion to understand the bug.

    Plugin Contributor Mike Jolley (a11n)

    (@mikejolley)

    No I don’t follow you because if I add some test text to single-product.php I see it on the single product page under storefront. So I know it’s being used.

    Thread Starter rplinux

    (@rplinux)

    @mikejolley Thanks.

    Resolved by these.

    //declare WC support
    function theme_rp_wc_support() {
    add_theme_support( ‘woocommerce’ );
    }
    add_action( ‘after_setup_theme’, ‘theme_rp_wc_support’ );

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Bug in 3.3.1’ is closed to new replies.