[Support request] Using a GP page as the Woo shop page

Home Forums Support [Support request] Using a GP page as the Woo shop page

Home Forums Support Using a GP page as the Woo shop page

Viewing 15 posts - 1 through 15 (of 26 total)
  • Author
    Posts
  • #615018
    Max

    I want to create a Shop page like the one located here.

    I know that I can create this layout using GP Section and Woo shortcodes.

    However I am having problems with creating the custom shop page template.

    I am successfully calling a custom template (that put in my child theme) for the shop page using the following snippet:

    // INCLUDE CUSTOM TEMPLATE FOR SHOP PAGE
    
    add_filter( 'template_include', 'custom_shop_page_template_include', 50, 1 );
    function custom_shop_page_template_include( $template ) {
        if( is_shop() ) {
            $template = get_stylesheet_directory() . '/woocommerce/archive-product-custom-shop-page.php';
        } 
        return $template;
    }

    Is there any way to call a standard GP page for the shop instead of the woo template?

    I successfully edited out all of the content in the custom woo shop page template that I have created. But then editing it in the GP front does not work. The GP front end offers sections, but these do not function properly. The add custom header function does not work as well.

    What is the easiest way to replicate a custom shop page template like the one I have linked to above in GeneratePress?

    GeneratePress 2.1.3
    GP Premium 1.6.2
    #615033
    David
    Staff
    Customer Support

    Hi there,

    The shop page is an archive so cannot be edited directly.
    The simplest way, in GP only, is as you propose; to use Sections and Woo shortcodes.
    You can wrap them in a grid container, like a CSS Flexbox or use a plugin like Tom’s Lightweight Grid Columns to build the columns for the side content.

    The rest could be achieved using some CSS.

    Alternatively you may want to look at a plugin for skinning the products. Not used it but this looks pretty good:

    https://theme-one.com/the-grid/

    #615180
    Max

    Hello David

    Thanks for trying to help.

    To be clear I don’t have any problem creating the required layout. I have already set my homepage up with a similar layout using GPs semantic grid (grid-25 with text and button and grid-75 with woo shortcode to display 3 products in 3 columns). From the home page I have linked directly to shop categories. If you check out the site I have linked to above you will see that they have done the same. They have then restyled there shop page with the same grid/sectioned layout. That is what I want to replicate.

    How can I do that?

    If I try to edit the shop archive page in the GP back end nothing works. For example if I select content only (no sidebar) the sidebar still appears. If I use the GP sections I can insert some text but the settings for each section (for example using a background color) does not work.

    From the example I have provided clearly this can be achieved. How?

    #615192
    Max

    Using a custom shop archive page in my child theme I can create a page with just the required header and footer. I know i can pull the content for that page with PHP. But where would I be pulling that content from?

    #615205
    David
    Staff
    Customer Support

    The example you have provided is the Divi equivalent of using Sections and Woo Shortcodes (or any pagebuilder). Each of the rows you see will be a shop loop query, which is the same function that the shortcodes output.

    To build this as a template would require a lot of custom development. And again the loop elements would become uneditable. so the best route without paying for development is the sections and shortcodes or pagebuilder as an option.

    If you have a link to your site we can help resolve the section background issues you are experiencing.

    #615298
    Max

    I think you are missing the gist of my question.

    Sure I can use GP sections, semantic grid and woo shortcodes to build the required page layout.

    What page am I going to use those items on?

    #615309
    David
    Staff
    Customer Support

    Aah ok (yes not enough coffee lol), so if you don’t want to have the standard Woocommerce shop then don’t assign one in the Woocommerce settings. Just create a normal Page name that Shop (or whatever you want) and then build that out with Sections and Shortcodes. Then you can save this and add it to your menu as a normal page item.

    You can then assign a page header to that page as per normal (not the archive). Note: GP 1.7 is coming out soon where Page Headers will be replaced with a new Elements module. Old Page headers will be kept as Legacy Page Headers so not a problem but if you can wait for 1.7 update might be a good move.

    #615312
    Max

    No that will not work.

    The primary reason this is important is as follows:

    I am using my home page (which has shortcodes displaying a section of products from each category) and lots of links into those categories (for good SEO).

    Then if someone visits one of the categories there is the woo breadcrumb at the top of the page. For example:

    Home > Shop > Category One

    If a user clicks on the shop part of the breadcrumb they will be taken to the shop archive page.

    #615327
    Max

    So It would appear I am back to where I started with my first post in this topic.

    I have put a custom shop archive page in my child theme. I am successfully calling it using he if shop function I pasted above. I can edit out all but the header, footer and the do_action( 'woocommerce_before_main_content' ); hook which is where any content in a GP section ends up.

    #615332
    David
    Staff
    Customer Support

    This may not be required if no Shop has been assigned, might want to test first, alternatively we can try this filter to performa a redirect of the shop url:

    add_filter( 'woocommerce_return_to_shop_redirec', 'custom_woocommerce_return_to_shop_redirect' ,20 );
    function custom_woocommerce_return_to_shop_redirect(){
        return site_url('/my_url');
    }

    Alternatively there are plugins on wp . org that can do this as well.

    #615340
    Max

    That snippet is just for the redirect back from the cart is it not?

    #615346
    Max

    Not assigning a shop page is not a solution.

    #615348
    Max

    Ok better I press on with some specific questions:

    1. If I remove the sidebar hook from the custom woo shop page and then insert content into a section on the GP front end, that content is not displayed at full width. How can I fix this.
    2. If I use the set a background color in the settings part of a section the background does not appear in the shop page. How can I fix this.

    #615350
    Max

    3. If I chose the option Content (no sidebars) in the GP layout meta box when editing the shop page, the sidebar is still displayed. How can I fix this?

    #615355
    David
    Staff
    Customer Support

    If you don’t assign a Shop page in the woocommerce settings then it will not be displayed in the breadcrumb. Instead it will display: Home > Category > Product. The only redirect to the shop is from the return to shop button which, yes, that filter provides the fix for.

Viewing 15 posts - 1 through 15 (of 26 total)
  • You must be logged in to reply to this topic.