Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Fix potential regression in no products placeholder for All Products block #3158

@nerrad

Description

@nerrad

In the testing notes for the 3.2.0 release are the following instructions:

Broken link for "No Products" placeholder

  • In a store with no products (move them to trash).
  • Create a new page and add the All Products block.
  • Click on the Add new product link and verify it works.

These instructions look like they are intended to align with the fix implemented in #2961. However, in the current state of the plugin, the following is displayed given the above conditions for the All Products block:

Image 2020-09-17 at 10.18.43 AM.png

This may not be a regression, but rather an expectation issue here because:

  • when I trash all the products on my site, HAS_PRODUCTS is still true. Should HAS_PRODUCTS only be considering published products (which would be the bug here).
  • If HAS_PRODUCTS should include trashed products, we should maybe either clarify this constant name to something like HAS_ANY_PRODUCTSOR introduce a new constant HAS_PUBLISHED_PRODUCTS. Then I think we'll want to make sure that the conditional here is only considering published products.

It looks like in this case the testing notes described the expectation correctly, but the actual code implemented will not result in the testing instructions showing the expected results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    block: all productsIssues related to the all products block.priority: lowThe issue/PR is low priority—not many people are affected or there’s a workaround, etc.status: staleStale issues and PRs have had no updates for 60 days.type: bugThe issue/PR concerns a confirmed bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions