-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Admin pricing view #1510
Admin pricing view #1510
Conversation
db966e7
to
da34d38
Compare
I love this. 👍 |
@@ -7,8 +7,14 @@ def index | |||
params[:q] ||= {} | |||
|
|||
@search = @product.prices.accessible_by(current_ability, :index).ransack(params[:q]) | |||
@prices = @search.result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing instance variable names in controllers can be hazardous if people overrode those views. This has not been around for long at all, and I do not suspect many people have used this instance variable name, so I won't ask for a deprecation warning, but maybe a short note in the ChangeLog.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, noted in the ChangeLog.
👍 I'd like to see master variants displayed to users throughout Solidus admin alongside regular variants. That is, instead of saying "this is a product with no variants", we should be saying "this is a product with one variant – click here if you want to make another". I appreciate the original intent was to avoid complexity for beginners, but I've worked on too many sites where clients and former devs had apparently never encountered the concept of a variant at all, and instead extended the product model in cumbersome ways. Variants aren't hard to understand, and the concept only has to be learnt once to forestall a lot of expensive re-writing later. So... this is a positive step. |
@@ -1115,6 +1115,8 @@ en: | |||
hints: | |||
spree/price: | |||
country: "This determines in what country the price is valid.<br/>Default: Any Country" | |||
master_variant: "Changing these prices will not change variant prices below, but will be used to populate all new variants" | |||
options: "These are the options used in the table below. They can be changed in the variants tab" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to make the text "variants tab" actually link to the variants tab?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be more explicit with the name of the table. "These options are used to create variants in the variant table. They can be changed in the variants tab"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but not if it is displayed as a Tooltip because the Tooltip is only displayed on mouseover. We could instead place this text so it is always visible and attach the link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new bootstrap layouts have a place for this kind of information where we could also put links. Let's leave it in the tooltip for now, and when we convert over to the new layouts we can augment the text with a link in the sidebar.
This looks great! My only comment/concern would be pulling those table titles out of the merged table cell and making them a proper heading so that it's a bit easier to scan the page. We could also then add one for "Variant pricing" which could be referred to in the tooltip messaging instead of "the table below". |
@@ -1115,6 +1115,8 @@ en: | |||
hints: | |||
spree/price: | |||
country: "This determines in what country the price is valid.<br/>Default: Any Country" | |||
master_variant: "Changing these prices will not change variant prices below, but will be used to populate all new variants" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change "these" to "master variant" to be more explicit
1647224
to
d16b057
Compare
d16b057
to
06e2a64
Compare
While not a fan of that fieldset style, I do like the hierarchy it gives to the page and it's a better middle ground for us to work from when we update styles. 👍 |
@@ -36,6 +36,9 @@ | |||
|
|||
* The `lastname` field on `Address` is now optional. [#1369](https://github.com/solidusio/solidus/pull/1369) | |||
|
|||
* Change backend `prices_controller` instance variable `@prices` to `@master_prices` and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably mention what user-facing change was made. Maybe:
The backend prices listing page now shows master prices separate from variant prices. This changes instance variable
@prices
to@master_prices
and@variant_prices
.
I don't understand the purpose of the Options table here. I think the option types relate only loosely to Prices (in that the options are what variants use, and variants have prices) and is going to be more confusing to users than helpful. New variants aren't created from this page. I think that table would make sense on the Variants page, but not here. |
@jhawthorn Yep, I have to agree. The user needs to know which option types are selected for a particular variant she's pricing, but she doesn't create new variants here, which she would need that table for. |
@jhawthorn @mamhoff The options table was suggested to help the user quickly reference if they have prices set for all the relevant variants. |
06e2a64
to
77e0847
Compare
77e0847
to
bcff2f0
Compare
This PR expands on the Admin Prices view to clarify master/variant pricing. See #1167
Master and Variant related prices have been separated into their own tables utilising new scopes on the Price model. Additionally, Option Types and Option Values are shown in a table as a reference for the user. As recommended by @Mandily Tooltips are shown in the Master Variant and Options tables to clarify their content.
Tests regarding assigns in this context have been updated to reflect these changes.
Here is a screenshot for reference: