Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Products Shortcode does not allow displaying a single result in the grid template #424

Open
corgalore opened this issue Apr 11, 2023 · 0 comments

Comments

@corgalore
Copy link

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

  1. Create a BigCommerce category and add only one product to it. Sync into Wordpress.
  2. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant