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

Control price visibility #4396

Closed
wants to merge 2 commits into from

Conversation

EmlynC
Copy link
Contributor

@EmlynC EmlynC commented Jul 4, 2019

I want to merge this change because I'd like to able to control the visibility of prices for products. Either prices are publicly available, for registered customers or for staff only.

There are a few reasons for this feature:

  • Businesses that cannot publicly publish prices, can choose to only shown prices to known users.
  • Once a user is shown a price, there is an obligation to offer that price. This allows for more protection over publicly showing the price.
  • Businesses that have complex products and allow users to 'shop' for products before getting a price quoted to them.

The feature isn't finished as it requires support on the GraphQL API, which would require field-level permissions. PWA support can be added, but it's probably best to get some agreement on what a user would see if the price is unavailable; show "Price unavailable" or a "Ask a question" etc.

Tasks outstanding

  • Remove price from cart
  • Remove price from checkout
  • API support i.e. price not shown if user can't request it
  • PWA support
  • Dashboard 2.0 support

Screenshots

If a user does not have permission to see the price, the following is shown:

image

Dashboard edit view:

image

Dashboard detail view:

image

Pull Request Checklist

  1. Privileged views and APIs are guarded by proper permission checks.
  2. All visible strings are translated with proper context.
  3. All data-formatting is locale-aware (dates, numbers, and so on).
  4. Database queries are optimized and the number of queries is constant.
  5. Database migration files are up to date.
  6. The changes are tested.
  7. The code is documented (docstrings, project documentation).
  8. GraphQL schema and type definitions are up to date.
  9. Changes are mentioned in the changelog.

* Add a property to availability
* Add DEFAULT_PRICE_VISIBILITY to settings, default to existing behaviour
* Migration
@EmlynC
Copy link
Contributor Author

EmlynC commented Jul 6, 2019

Old dashboard — will raise a separate PR for dashboard-next

@EmlynC EmlynC closed this Jul 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant