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

Add required to product master price field #2262

Merged
merged 1 commit into from
Oct 16, 2017

Conversation

gregdaynes
Copy link

This adds required: true to the master price field on the products
form. The label for the field indicates that it is required, but the
field can be cleared, and the form submitted - resulting in the price
being defaulted to 0.00

This is part of issue #1861. Though in the issue report it talks of the
product price showing a deleted value when removed (which has been
resolved). This further makes it a conscious decision to set the price
to 0.

@@ -32,7 +32,7 @@
<div data-hook="admin_product_form_price">
<%= f.field_container :price do %>
<%= f.label :price, class: 'required' %>
<%= render "spree/admin/shared/number_with_currency", f: f, amount_attr: :price,
<%= render "spree/admin/shared/number_with_currency", f: f, amount_attr: :price, required: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a Spree::Config.require_master_price (which I don't know how widely is used but exists).

Can we change this line to required: Spree::Config.require_master_price?

Depending on Spree::Config.require_master_price, this adds
`required: true` to the master price field on the products form, as well
as the indicator to the field label. When config is set to false, the
field can be cleared, and the form submitted - resulting in the price
being defaulted to `0.00`

This is part of issue solidusio#1861. Though in the issue report it talks of the
product price showing a deleted value when removed (which has been
resolved). This further makes it a conscious decision to set the price
to `0`.
@jhawthorn jhawthorn merged commit 9e0ef8f into solidusio:master Oct 16, 2017
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

3 participants