• Resolved zamaanonline

    (@zamaanonline)


    Hi guys, i am able to override the default shop page by copying plugins/woocomerce/template/archive-product.php. to my_child_theme/woocommerce/archive-product.php. My problem is, the echo function works. But not short codes. i have nearly 50 products in the shop. what could be wrong? i have given the core part of the code below from the whole page.

    do_action( 'woocommerce_before_main_content' );

    /**
    * Hook: woocommerce_shop_loop_header.
    *
    * @since 8.6.0
    *
    * @hooked woocommerce_product_taxonomy_archive_header - 10
    */
    do_action( 'woocommerce_shop_loop_header' );

    if ( woocommerce_product_loop() ) {

    /**
    * Hook: woocommerce_before_shop_loop.
    *
    * @hooked woocommerce_output_all_notices - 10
    * @hooked woocommerce_result_count - 20
    * @hooked woocommerce_catalog_ordering - 30
    */
    do_action( 'woocommerce_before_shop_loop' );

    echo '<h1>test1 !!</h1>';
    do_shortcode('[products orderby="menu_order" columns="2" limit="2"]');
    //do_shortcode('[products orderby="menu_order" columns="2" limit="2"]');
    //do_shortcode('[products category="cch-curry" class="m-popular" pagination="no" columns="2" limit="2"]');
    //do_shortcode('[products ids="7671,7605" class="m-popular" pagination="false" columns="2" limit="2"]');
    //do_shortcode ('[product_categories number="0" parent="0"]');


    /**
    * Hook: woocommerce_after_shop_loop.
    *
    * @hooked woocommerce_pagination - 10
    */
    do_action( 'woocommerce_after_shop_loop' );
    } else {
    /**
    * Hook: woocommerce_no_products_found.
    *
    * @hooked wc_no_products_found - 10
    */
    do_action( 'woocommerce_no_products_found' );
    }

    /**
    * Hook: woocommerce_after_main_content.
    *
    * @hooked woocommerce_output_content_wrapper_end - 10 (outputs closing divs for the content)
    */
    do_action( 'woocommerce_after_main_content' );

    /**
    * Hook: woocommerce_sidebar.
    *
    * @hooked woocommerce_get_sidebar - 10
    */
    do_action( 'woocommerce_sidebar' );

    Please see the output here : https://prnt.sc/v809huB_mmLj

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.