Site logo

Archived topic

Styling the WooCommerce Shop-Page

7 replies · Started by Sascha on March 28, 2022

Viewing posts 1–8 of 8

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

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 ?

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

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

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

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.

This archived topic is closed to new replies.