Site logo

[Support request] GPP Elements – Creating Woo Product Category Archive

Home Forums Support [Support request] GPP Elements – Creating Woo Product Category Archive

Home Forums Support GPP Elements – Creating Woo Product Category Archive

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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!

    #2505653
    David
    Staff
    Customer Support

    Hi 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.

    #2505859
    Stephane 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!

    #2506156
    David
    Staff
    Customer Support

    I checked the Woocommerce archive-product.php and 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:

    https://github.com/woocommerce/woocommerce/blob/447379a424d13498434b08d5044ee1b484ccf06b/plugins/woocommerce/templates/archive-product.php#L59-L74

    And then you can hook in your own code to either the: woocommerce_before_shop_loop or woocommerce_after_shop_loop hook. Or simply add in your own code to the template.

    Elementor will be doing something similar or a template redirect

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