[Support request] Styling the WooCommerce Shop-Page

Home Forums Support [Support request] Styling the WooCommerce Shop-Page

Home Forums Support Styling the WooCommerce Shop-Page

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #2169783
    Sascha

    Hi

    I would like to change the layout & style of the default “Shop” page.

    Is this possible with GeneratePress & GenerateBlocks? How?

    I have Pro versions of both …

    Thank you in advance and kind regards,
    Sascha

    #2169784
    David
    Staff
    Customer Support

    Hi there,

    that depends on what you want to do with it. Do you have a mockup or example of a site you’re trying to match ?

    #2170028
    Sascha

    Hey there,

    I want to display a custom table on this Shop page and added this code snippet:

    /**
     * @snippet       Remove Product Loop @ WooCommerce Shop
     * @how-to        Get CustomizeWoo.com FREE
     * @author        Rodolfo Melogli
     * @compatible    WooCommerce 6
     * @donate $9     https://businessbloomer.com/bloomer-armada/
     */
     
    add_action( 'pre_get_posts', 'bbloomer_remove_products_from_shop_page' );
     
    function bbloomer_remove_products_from_shop_page( $q ) {
       if ( ! $q->is_main_query() ) return;
       if ( ! $q->is_post_type_archive() ) return;
       if ( ! is_admin() && is_shop() ) {
          $q->set( 'post__in', array(0) );
       }
       remove_action( 'pre_get_posts', 'bbloomer_remove_products_from_shop_page' );
    }

    as recommended by https://www.businessbloomer.com/woocommerce-remove-loop-shop-page/

    Unfortunately, the products are still being displayed. Can you tell me what I have done wrong?

    Thank you in advance and kind regards,
    Sascha

    #2170066
    David
    Staff
    Customer Support

    Remove that code, as its not going to work if you want to edit the Shop page yourself.
    See my reply here:

    https://generatepress.com/forums/topic/shop-page-woocommerce-layout-options/#post-1860799

    #2251169
    Sascha

    Thanks David, very good tutorial on the linked forum-post!

    Now I have created a custom shop-page, where I’m going to display products per category via shortcodes. I have realized, that the GP-Customizer-Settings for the “Shop” page will also apply everywhere the [product] shortcode is being applied, nice 🙂

    However, I want to display “some text” between the product title and the pricing info on my custom shop-page. So I was hoping for Elements > Block/Hook to achieve this. The location is set to this page already, but I cannot find the relevant hook-name. When I apply “woocommerce_after_shop_loop_item_title” or “woocommerce_before_shop_loop_item_title” it is not placed between title & pricing, but rather above or below both of them. Any idea about how to “insert” the block between these 2 strings?

    My 2nd issue is to not only display “some text”, but to use Dynamic Data for displaying the default “description” info. So I have replaced the “some text” paragraph block with the GBP-headline-block. Then I did some research for the correct post-meta “Meta field name”, but didn’t find any. Can you please help me out with this?

    If the product-description cannot be fetched this way, I can still use the custom field (text area type), which I have applied to the products using the “Meta Box” plugin, but would prefer to use the description field, because it’s a default field. And also, the styling (incl. line-breaks) is not being displayed, as you can see on this screenshot.

    Thank you in advance and kind regards,
    Sascha

    #2251429
    Fernando
    Customer Support

    Hi Sascha,

    With regards to your first concern, can you try setting the hook to woocommerce_after_shop_loop_item_title and the priority to 1 as such: https://share.getcloudapp.com/o0uGgdeL

    With regards to your second concern, you can use a Dynamic Content Block instead. For instance: https://share.getcloudapp.com/nOuX8x5k

    Hope this helps! Kindly let us know how it goes.

    #2252213
    Sascha

    Hi Fernando,

    awesome, the “Dynamic Content Block” was helping a lot!

    I was able to fetch the data from the custom field, which I have previously created via Meta Box and added some values per product.

    By the way, I wonder which “default” meta field names are available for posts, pages and products, that could be used here. Didn’t find an overview for this.

    Also, since many plugins add their own custom post types & custom fields, is there a workaround to find out about the Post Meta Names, e.g. for Courses (LearnDash), Events (Event Calendar) or any other of these widely used plugins?

    Thank you in advance and kind regards,
    Sascha

    #2252318
    Ying
    Staff
    Customer Support

    By the way, I wonder which “default” meta field names are available for posts, pages and products, that could be used here. Didn’t find an overview for this.

    All the defaults are showing as published date/updated date/author name and so on.

    Also, since many plugins add their own custom post types & custom fields, is there a workaround to find out about the Post Meta Names, e.g. for Courses (LearnDash), Events (Event Calendar) or any other of these widely used plugins?

    The theme wouldn’t know, you’ll need to contact the plugins for that info, unfortunately.

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