bigcommerce-for-wordpress
bigcommerce-for-wordpress copied to clipboard
Products Shortcode does not allow displaying a single result in the grid template
Expected behavior
Use the Products Shortcode to display a grid of products in a category, rendered using card template, even if there's only one result.
Actual behavior
If only one product is returned in query of Products Shortcode, the result is rendered using the Product_Shortcode_Single template, instead of Product_Shortcode_Grid.
Steps to reproduce behavior
- Create a BigCommerce category and add only one product to it. Sync into Wordpress.
- Use this shortcode on a page with your category slug: [bigcommerce_product category=my-category order=DESC orderby=date paged=1 per_page=9]
Line causing issue
https://github.com/bigcommerce/bigcommerce-for-wordpress/blob/master/src/BigCommerce/Shortcodes/Products.php#L71