FacetWP Integration [Solved]

Hi.

I need to use FacetWP to handle some filtering on a WooCommerce Site.

FacetWP works wonderfully on stock theme, sorting woo products very nicely.

But for some reason I can’t get it to take on X theme, Integrity Stack, or any stack for that matter.

Tried messing with archive-product.php files as well, but to no avail.

Any suggestions?

Thanks.

Got it working with this code:

Remember to setup Child theme correctly based on how X does things.

This file is simply pro-child/framework/views/global/_index-cpt.php

Uses FacetWP with XTHEME and Essential Grid successfully.

<?php if ( have_posts() ) : $my_post_ids = array(); ?>
<div class="facetwp-template">      
      <?php while ( have_posts() ) : the_post(); ?>
       <?php $my_post_ids[] = get_the_ID() ; ?>
      <?php endwhile; ?>

    <?php echo do_shortcode('[ess_grid alias="weekly_grid" posts="'.implode(',', $my_post_ids).'"]'); ?>

    <?php else : ?>
      <?php x_get_view( 'global', '_content-none' ); ?>
    <?php endif; ?>
</div>

Marking as resolved.

Nice work @xlightwaverx!

May I ask you, if you have a paginated grid on the page, let’s say 10 pages of products, will FacetWP return every item, no matter of the page, or will it do what Essential Grid does, return content only from the page that is currently seen?

Thanks!

Btw, I guess, this code can be modified to make it work with The Grid. Thanks again!

Essential Grid should only display the rows of product you have it set to display in their layout settings.

Just make sure posts count is set higher in WP backend as in above 100 or so so you can feed all the data to the grid plugin and then let the plugin handle the display of the data.

With lots of woo items this may not be a good idea.

B

Thanks!

With a shop that has 800+ sunglasses, this is not an option then. I’ll go with standard WooCommerce or CPT, plus FacetWP then. That should be able to filter the whole database.

Thanks again @xlightwaverx

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.