- This topic has 3 replies, 2 voices, and was last updated 3 years, 3 months ago by
David.
-
AuthorPosts
-
January 22, 2023 at 1:35 pm #2505154
Stephane Bergeron
Hi,
I’m trying to create a custom products category archive with GPP element and GenerateBlocks. It doesn’t work as I expect but my settings may be wrong. I am able to display content on the oroduct cat archive but the regular WooCommerce loop remains in place.
I’m actually trying to replace the same thing I have done in Elementor as I want to remove Elementor from that site. I was able to use Elementor’s theme builder template and assign it to the same product category archive and what I put in the Elementor template completely replaced the default WooCommerce output which is what I want here too (I’m replacing it with a custom shortcode for the content and some Search WP search and dropdown field).
What happens is that what I put in simply appears above the Woo breadcrumb and and rest of the content is Woo defeult.
Can I achieve the same I did with Elementor with GPP and GBP? Custom code is not an isse but I don’t know where to begin.
Thanks!
January 23, 2023 at 4:03 am #2505653David
StaffCustomer SupportHi there,
Block Element – Content Templates and Loop Templates only works with Theme Templates.
The Theme templates contain the filters and hooks necessary for those to work.So It won’t work on templates added by plugins such as Woocommerce.
And Query Loop block doesn’t have support for woo functions such as Add to Cart, or the Get Price.
All of which are quite complicated.But, these are things we are looking at as possible future additions.
January 23, 2023 at 7:16 am #2505859Stephane Bergeron
Hi David,
Thanks for the clarification, yes that would be good for this to work. In this case and many similar I came accross, I do not need the Query Loops block to work or any other hooks, just for the default Woo category archive to be replaced. In this case I handle the display of products with a custom shortcode I created + 2 more to display SearchWP fields.
Not sure how Elementor achieves this but that works as expected as far as replacing the product cat loop. I just want to be rid of that builder’s overhead 🙂
Thanks again!
January 23, 2023 at 9:53 am #2506156David
StaffCustomer SupportI checked the Woocommerce
archive-product.phpand there is no function to disable the loop.
You would have to make a copy of that template to a child theme.And remove the loop as marked here:
And then you can hook in your own code to either the:
woocommerce_before_shop_looporwoocommerce_after_shop_loophook. Or simply add in your own code to the template.Elementor will be doing something similar or a template redirect
-
AuthorPosts
- You must be logged in to reply to this topic.