Skip to content

Instantly share code, notes, and snippets.

@djrmom
Last active January 19, 2021 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save djrmom/d6d01522e1b74cc3e27bac395b8f077b to your computer and use it in GitHub Desktop.
Save djrmom/d6d01522e1b74cc3e27bac395b8f077b to your computer and use it in GitHub Desktop.
facetwp bigcommerce shortcode
<?php
/**
* Product Group Template for Bigcommerce modified for FacetWP
* add to your_theme/bigcommerce/components/products/product-shortcode-grid.php
* @var string[] $cards
* @var string $pagination
* @var bool $wrap Whether to wrap the output in a div
* @var int $columns The number of columns to use for the grid
* @version 1.0.0
*/
?>
<?php if ( $wrap ) { ?>
<div class="bc-load-items bc-shortcode-product-grid-wrapper">
<!-- class="bc-product-grid bc-load-items-container" removes "bc-load-items-container--has-pages" for facet -->
<div class="facetwp-template bc-product-grid bc-product-grid--<?php echo intval( $columns ); ?>col bc-load-items-container">
<?php } ?>
<?php
foreach ( $cards as $card ) {
echo $card;
}
echo facetwp_display( 'pager', true ); // change this to a custom facet pager if preferred - facetwp_display( 'facet', 'my_pager_facet_name )
?>
<?php if ( $wrap ) { ?>
</div>
</div>
<?php } ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment