wordpresswoocommercestorefront

How to edit the WooCommerce storefront shop page


I'm building a child theme of the storefront WooCommerce theme. How do I edit the shop page, I can't seem to find a php template for it. Which files should I look into?


Solution

  • You will not find the template files inside StoreFront Theme as they are altering the shop pages using hooks and you can find those hooks inside

    inc>woocommerce>storefront-woocommerce-template-hooks.php

    so if you want to target specific area you need to remove that action and added again with your custom output

    for Example Let's Say you want to remove the StoreFront Pagination you can do it as following from your child theme:

    add_action('woocommerce_before_main_content', 'remove_shop_hooks');
    
    function remove_shop_hooks()
    {
    
    remove_action('woocommerce_before_shop_loop', 'storefront_woocommerce_pagination', 30);
    }
    

    and then you can add your custmized function normally Example:

    add_action('woocommerce_before_shop_loop', 'testfunc', 10);
    
    function testfunc()
        {
            echo 'test';
        }