- This topic has 5 replies, 3 voices, and was last updated 1 year ago by Fernando.
-
AuthorPosts
-
March 2, 2023 at 10:49 pm #2553593Sascha
Hi,
I have defined a custom-page “Angebote” as the default shop page, and only want to display products by custom query-loops (or by ninja-tables).
I checked GPP-Customizer and didn’t find the relevant option.
Then I added this code-snippet, but does not work:
function remove_woocommerce_shop_loop() { remove_action( 'woocommerce_shop_loop', 'woocommerce_output_all_notices', 10 ); remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 ); remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); remove_action( 'woocommerce_before_shop_loop', 'woocommerce_output_all_notices', 10 ); remove_action( 'woocommerce_before_shop_loop', 'woocommerce_breadcrumb', 20 ); remove_action( 'woocommerce_before_shop_loop', 'woocommerce_template_loop_product_link_open', 10 ); remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_template_loop_product_thumbnail', 10 ); remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_product_title', 10 ); remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 ); remove_action( 'woocommerce_shop_loop_item_title', 'woocommerce_template_loop_price', 10 ); remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_product_link_close', 5 ); } add_action( 'init', 'remove_woocommerce_shop_loop' );
Can you help me hiding or removing the products from the shop page?
Thank you in advance and kind regards,
SaschaMarch 3, 2023 at 4:20 am #2553894DavidStaffCustomer SupportHi there,
Woocommerce handles that.
In Dashboard > Woocommerce > Settings -> Products, theShop page
option, if that is set then Woo will automatically add the shop loop to that page.
So the simple fix is to NOT set the shop page.Then you need to change the return to shop url to match that with this snippet:
function return_to_static_shop_page() { return 'http://yourdomain.com/your-page/'; } add_filter( 'woocommerce_return_to_shop_redirect', 'return_to_static_shop_page' );
March 16, 2023 at 1:21 am #2569526SaschaThanks for your clarification.
By the way, will it be possible to display products-fields via GB dynamic data in the future? Or do you know of any solution about how to do so?
March 16, 2023 at 1:27 am #2569531Fernando Customer SupportHi Sascha,
Product meta should be already retrievable through GB dynamic data.
Just set the source to Post meta, and the field name to
_regular_price
for instance. That should work.April 20, 2023 at 1:15 pm #2616249SaschaHey Fernando, that’s great to hear, thanks!
Now, I have tried to find a list or guide about how to display product-meta correctly, any idea about where I find a list of possible meta to add to the custom meta field of a GB-Headline? Like for pricing variants, tax, “sales” badge etc.?
Thank you in advance and kind regards,
SaschaApril 20, 2023 at 5:49 pm #2616377Fernando Customer SupportI don’t think WooCommerce has an official public list of these.
I usually just Google and try whatever suggested meta field name works. I found this article which may help as well: https://docs.om4.io/woocommerce-zapier/data-fields/product/#data-fields-for-triggers-and-usage-in-create-and-update-actions
-
AuthorPosts
- You must be logged in to reply to this topic.